diff --git a/src/test/correct/arrays_simple/clang/arrays_simple.expected b/src/test/correct/arrays_simple/clang/arrays_simple.expected index aece6f15e..cdbb1ceb9 100644 --- a/src/test/correct/arrays_simple/clang/arrays_simple.expected +++ b/src/test/correct/arrays_simple/clang/arrays_simple.expected @@ -1,38 +1,38 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1872bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1872bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -73,7 +73,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -82,9 +82,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -181,17 +181,17 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R8); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000089b"} true; R8, Gamma_R8 := 7bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000008a8"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000008b7"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/arrays_simple/clang_O2/arrays_simple.expected b/src/test/correct/arrays_simple/clang_O2/arrays_simple.expected index 863d7bd46..dfc8a4e7d 100644 --- a/src/test/correct/arrays_simple/clang_O2/arrays_simple.expected +++ b/src/test/correct/arrays_simple/clang_O2/arrays_simple.expected @@ -1,14 +1,14 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1840bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1840bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -49,7 +49,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -58,9 +58,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -155,7 +155,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple.expected b/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple.expected index aece6f15e..cdbb1ceb9 100644 --- a/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple.expected +++ b/src/test/correct/arrays_simple/clang_no_plt_no_pic/arrays_simple.expected @@ -1,38 +1,38 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1872bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1872bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -73,7 +73,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -82,9 +82,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -181,17 +181,17 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R8); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000089b"} true; R8, Gamma_R8 := 7bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000008a8"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000008b7"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/arrays_simple/clang_pic/arrays_simple.expected b/src/test/correct/arrays_simple/clang_pic/arrays_simple.expected index aece6f15e..cdbb1ceb9 100644 --- a/src/test/correct/arrays_simple/clang_pic/arrays_simple.expected +++ b/src/test/correct/arrays_simple/clang_pic/arrays_simple.expected @@ -1,38 +1,38 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1872bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1872bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -73,7 +73,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -82,9 +82,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -181,17 +181,17 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R8); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000089b"} true; R8, Gamma_R8 := 7bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000008a8"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000008b7"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/arrays_simple/gcc_O2/arrays_simple.expected b/src/test/correct/arrays_simple/gcc_O2/arrays_simple.expected index 418f9a5da..db578d839 100644 --- a/src/test/correct/arrays_simple/gcc_O2/arrays_simple.expected +++ b/src/test/correct/arrays_simple/gcc_O2/arrays_simple.expected @@ -1,14 +1,14 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1896bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1896bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -49,7 +49,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -58,9 +58,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -155,7 +155,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_arrays_read/clang/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/clang/basic_arrays_read.expected index 89944a5ec..51a10f3b8 100644 --- a/src/test/correct/basic_arrays_read/clang/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/clang/basic_arrays_read.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert true; @@ -190,16 +190,16 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002d1"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> true); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), true); assert true; - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002dd"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; diff --git a/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read.expected index 62beee9a8..efc782dbb 100644 --- a/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/clang_O2/basic_arrays_read.expected @@ -1,33 +1,33 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -68,7 +68,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); { @@ -76,12 +76,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert true; @@ -179,13 +179,13 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> true); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), true); assert true; - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002c9"} true; return; } diff --git a/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read.expected index 89944a5ec..9677616ad 100644 --- a/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/clang_no_plt_no_pic/basic_arrays_read.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert true; @@ -190,16 +190,16 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000863"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> true); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), true); assert true; - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000086f"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; diff --git a/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read.expected index e16692dc4..119db2945 100644 --- a/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/clang_pic/basic_arrays_read.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -93,7 +93,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69598bv64) == 0bv8); free ensures (memory_load8_le(mem, 69599bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); { @@ -101,12 +101,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert true; @@ -222,10 +222,10 @@ procedure main() free ensures (memory_load8_le(mem, 69599bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002d5"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4056bv64)) || L(mem, bvadd64(R8, 4056bv64))); @@ -233,7 +233,7 @@ procedure main() assert (L(mem, R8) ==> true); mem, Gamma_mem := memory_store32_le(mem, R8, 0bv32), gamma_store32(Gamma_mem, R8, true); assert true; - assume {:captureState "addr:0x764"}true; + assume {:captureState "%000002e8"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; diff --git a/src/test/correct/basic_arrays_read/gcc/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/gcc/basic_arrays_read.expected index cf4f9458e..aa2899d20 100644 --- a/src/test/correct/basic_arrays_read/gcc/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/gcc/basic_arrays_read.expected @@ -1,36 +1,36 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -71,7 +71,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); { @@ -79,12 +79,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert true; @@ -182,14 +182,14 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); assert (L(mem, R0) ==> true); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert true; - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002d6"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); diff --git a/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read.expected index 697310dfc..8b51616b4 100644 --- a/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/gcc_O2/basic_arrays_read.expected @@ -1,33 +1,33 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -68,7 +68,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); { @@ -76,12 +76,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert true; @@ -179,13 +179,13 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, bvadd64(R1, 24bv64)) ==> true); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 24bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R1, 24bv64), true); assert true; - assume {:captureState "addr:0x608"}true; + assume {:captureState "%000001b7"} true; return; } diff --git a/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read.expected index cf4f9458e..e14123c99 100644 --- a/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/gcc_no_plt_no_pic/basic_arrays_read.expected @@ -1,36 +1,36 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -71,7 +71,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); { @@ -79,12 +79,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert true; @@ -182,14 +182,14 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); assert (L(mem, R0) ==> true); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert true; - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000866"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); diff --git a/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read.expected b/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read.expected index 583888bee..4ce3ddd81 100644 --- a/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read.expected +++ b/src/test/correct/basic_arrays_read/gcc_pic/basic_arrays_read.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69014bv64) == 0bv8); free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, bvadd64($arr_addr, 0bv64))) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); { @@ -95,12 +95,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert true; @@ -214,7 +214,7 @@ procedure main() free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4080bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4080bv64)) || L(mem, bvadd64(R0, 4080bv64))); @@ -222,7 +222,7 @@ procedure main() assert (L(mem, R0) ==> true); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert true; - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%000002d7"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4080bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4080bv64)) || L(mem, bvadd64(R0, 4080bv64))); diff --git a/src/test/correct/basic_arrays_write/clang/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/clang/basic_arrays_write.expected index f8f5ec6b5..fa1ca5a2b 100644 --- a/src/test/correct/basic_arrays_write/clang/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/clang/basic_arrays_write.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures true; @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures true; { @@ -87,12 +87,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert true; } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -194,19 +194,19 @@ procedure main() { var arr$0_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R9, Gamma_R9 := 69632bv64, true; R9, Gamma_R9 := bvadd64(R9, 52bv64), Gamma_R9; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002e5"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, bvadd64(R9, 4bv64)) ==> Gamma_R8); arr$0_old := memory_load32_le(mem, bvadd64($arr_addr, 0bv64)); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 4bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 4bv64), Gamma_R8); assert (arr$0_old == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000002f4"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write.expected index d809dcc3f..e22e851bb 100644 --- a/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/clang_O2/basic_arrays_write.expected @@ -1,36 +1,36 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures true; @@ -71,7 +71,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures true; { @@ -79,12 +79,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert true; } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -184,7 +184,7 @@ procedure main() { var arr$0_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := zero_extend32_32(R0[32:0]), Gamma_R0; R9, Gamma_R9 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -193,6 +193,6 @@ procedure main() arr$0_old := memory_load32_le(mem, bvadd64($arr_addr, 0bv64)); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); assert (arr$0_old == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d4"} true; return; } diff --git a/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write.expected index f8f5ec6b5..6f9a27b7f 100644 --- a/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/clang_no_plt_no_pic/basic_arrays_write.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures true; @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures true; { @@ -87,12 +87,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert true; } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -194,19 +194,19 @@ procedure main() { var arr$0_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R9, Gamma_R9 := 69632bv64, true; R9, Gamma_R9 := bvadd64(R9, 52bv64), Gamma_R9; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000890"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, bvadd64(R9, 4bv64)) ==> Gamma_R8); arr$0_old := memory_load32_le(mem, bvadd64($arr_addr, 0bv64)); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 4bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 4bv64), Gamma_R8); assert (arr$0_old == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000089f"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write.expected index 026bdc6e2..5f24ac94c 100644 --- a/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/clang_pic/basic_arrays_write.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures true; @@ -95,7 +95,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69598bv64) == 0bv8); free ensures (memory_load8_le(mem, 69599bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures true; { @@ -103,12 +103,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert true; } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -226,20 +226,20 @@ procedure main() { var arr$0_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4056bv64)) || L(mem, bvadd64(R9, 4056bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002e6"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, bvadd64(R9, 4bv64)) ==> Gamma_R8); arr$0_old := memory_load32_le(mem, bvadd64($arr_addr, 0bv64)); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 4bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 4bv64), Gamma_R8); assert (arr$0_old == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%000002f5"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_arrays_write/gcc/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/gcc/basic_arrays_write.expected index 75be2e279..842329e9c 100644 --- a/src/test/correct/basic_arrays_write/gcc/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/gcc/basic_arrays_write.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures true; @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures true; { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert true; } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -192,10 +192,10 @@ procedure main() { var arr$0_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002da"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); @@ -204,7 +204,7 @@ procedure main() arr$0_old := memory_load32_le(mem, bvadd64($arr_addr, 0bv64)); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R0, 4bv64), R1[32:0]), gamma_store32(Gamma_mem, bvadd64(R0, 4bv64), Gamma_R1); assert (arr$0_old == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000002f4"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write.expected index 185310dc9..1d10bd0a8 100644 --- a/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/gcc_O2/basic_arrays_write.expected @@ -1,36 +1,36 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures true; @@ -71,7 +71,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures true; { @@ -79,12 +79,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert true; } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -184,7 +184,7 @@ procedure main() { var arr$0_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 0bv64, true; @@ -193,6 +193,6 @@ procedure main() arr$0_old := memory_load32_le(mem, bvadd64($arr_addr, 0bv64)); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 28bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 28bv64), Gamma_R2); assert (arr$0_old == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); - assume {:captureState "addr:0x60c"}true; + assume {:captureState "%000001be"} true; return; } diff --git a/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write.expected index 75be2e279..dfc86a463 100644 --- a/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/gcc_no_plt_no_pic/basic_arrays_write.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures true; @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures true; { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert true; } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -192,10 +192,10 @@ procedure main() { var arr$0_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000885"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); @@ -204,7 +204,7 @@ procedure main() arr$0_old := memory_load32_le(mem, bvadd64($arr_addr, 0bv64)); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R0, 4bv64), R1[32:0]), gamma_store32(Gamma_mem, bvadd64(R0, 4bv64), Gamma_R1); assert (arr$0_old == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000089f"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write.expected b/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write.expected index b86cc5bfe..f0df48118 100644 --- a/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write.expected +++ b/src/test/correct/basic_arrays_write/gcc_pic/basic_arrays_write.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$arr_addr: bv64; -axiom {:extern }($arr_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $arr_addr: bv64; +axiom ($arr_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if ((index == bvadd64($arr_addr, 4bv64)) || (index == bvadd64($arr_addr, 0bv64))) then false else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures true; @@ -93,7 +93,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69014bv64) == 0bv8); free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures true; { @@ -101,12 +101,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert true; } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, bvadd64($arr_addr, 0bv64)) == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); @@ -224,10 +224,10 @@ procedure main() { var arr$0_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002da"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4080bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4080bv64)) || L(mem, bvadd64(R0, 4080bv64))); @@ -237,7 +237,7 @@ procedure main() arr$0_old := memory_load32_le(mem, bvadd64($arr_addr, 0bv64)); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R0, 4bv64), R1[32:0]), gamma_store32(Gamma_mem, bvadd64(R0, 4bv64), Gamma_R1); assert (arr$0_old == memory_load32_le(mem, bvadd64($arr_addr, 0bv64))); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%000002f5"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_assign_assign/clang/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/clang/basic_assign_assign.expected index 79f7e8bea..9c8f8e054 100644 --- a/src/test/correct/basic_assign_assign/clang/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/clang/basic_assign_assign.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -184,7 +184,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 5bv64, true; call rely(); @@ -192,7 +192,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002ce"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign.expected index 9077f5b9d..e95a25ce5 100644 --- a/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/clang_O2/basic_assign_assign.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -184,7 +184,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 5bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -193,6 +193,6 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d3"} true; return; } diff --git a/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign.expected index 79f7e8bea..b64e6256d 100644 --- a/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/clang_no_plt_no_pic/basic_assign_assign.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -184,7 +184,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 5bv64, true; call rely(); @@ -192,7 +192,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000845"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign.expected index a79f954f2..9adc4bc36 100644 --- a/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/clang_pic/basic_assign_assign.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -86,7 +86,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69598bv64) == 0bv8); free ensures (memory_load8_le(mem, 69599bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); { @@ -94,12 +94,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -216,7 +216,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4040bv64)) || L(mem, bvadd64(R9, 4040bv64))); @@ -226,7 +226,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_assign_assign/gcc/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/gcc/basic_assign_assign.expected index 493399a9b..38fd4e9ff 100644 --- a/src/test/correct/basic_assign_assign/gcc/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/gcc/basic_assign_assign.expected @@ -1,33 +1,33 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -68,7 +68,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); { @@ -76,12 +76,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -182,7 +182,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 5bv64, true; @@ -191,7 +191,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d8"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign.expected index 8c5ad69c8..55dc84373 100644 --- a/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/gcc_O2/basic_assign_assign.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -184,7 +184,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := 5bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -193,6 +193,6 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); - assume {:captureState "addr:0x60c"}true; + assume {:captureState "%000001bd"} true; return; } diff --git a/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign.expected index 493399a9b..60efa0cb5 100644 --- a/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/gcc_no_plt_no_pic/basic_assign_assign.expected @@ -1,33 +1,33 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -68,7 +68,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); { @@ -76,12 +76,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -182,7 +182,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 5bv64, true; @@ -191,7 +191,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000085b"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign.expected b/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign.expected index 9df5b4933..2e59e747e 100644 --- a/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign.expected +++ b/src/test/correct/basic_assign_assign/gcc_pic/basic_assign_assign.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -84,7 +84,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69014bv64) == 0bv8); free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); { @@ -92,12 +92,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -214,7 +214,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -224,7 +224,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 5bv32)); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_assign_increment/clang/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/clang/basic_assign_increment.expected index eb5c00566..aad1b3b63 100644 --- a/src/test/correct/basic_assign_increment/clang/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/clang/basic_assign_increment.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); { @@ -84,12 +84,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -190,7 +190,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R9, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R9, 52bv64)) || L(mem, bvadd64(R9, 52bv64))); @@ -200,7 +200,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002da"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment.expected index 05ad161e1..f1e4916f6 100644 --- a/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/clang_O2/basic_assign_increment.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); { @@ -84,12 +84,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -190,7 +190,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; call rely(); @@ -201,6 +201,6 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000002df"} true; return; } diff --git a/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment.expected index eb5c00566..5b8b8cf93 100644 --- a/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/clang_no_plt_no_pic/basic_assign_increment.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); { @@ -84,12 +84,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -190,7 +190,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R9, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R9, 52bv64)) || L(mem, bvadd64(R9, 52bv64))); @@ -200,7 +200,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000085f"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment.expected index 1c3b1ec98..c37e6ca48 100644 --- a/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/clang_pic/basic_assign_increment.expected @@ -1,49 +1,49 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -92,7 +92,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69598bv64) == 0bv8); free ensures (memory_load8_le(mem, 69599bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); { @@ -100,12 +100,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -222,7 +222,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4040bv64)) || L(mem, bvadd64(R9, 4040bv64))); @@ -234,7 +234,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%000002e5"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_assign_increment/gcc/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/gcc/basic_assign_increment.expected index 60a051dbc..c5b62995a 100644 --- a/src/test/correct/basic_assign_increment/gcc/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/gcc/basic_assign_increment.expected @@ -1,39 +1,39 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -74,7 +74,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); { @@ -82,12 +82,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -188,7 +188,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -201,7 +201,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000002f7"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment.expected index d839cbae8..7ae4e3385 100644 --- a/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/gcc_O2/basic_assign_increment.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); { @@ -84,12 +84,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -190,7 +190,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R2, Gamma_R2 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; call rely(); @@ -201,6 +201,6 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R2, 20bv64), R1[32:0]), gamma_store32(Gamma_mem, bvadd64(R2, 20bv64), Gamma_R1); assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001c5"} true; return; } diff --git a/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment.expected index 60a051dbc..56bb581a8 100644 --- a/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/gcc_no_plt_no_pic/basic_assign_increment.expected @@ -1,39 +1,39 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -74,7 +74,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); { @@ -82,12 +82,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -188,7 +188,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -201,7 +201,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%0000089f"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment.expected b/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment.expected index c47643c28..1b021ed21 100644 --- a/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment.expected +++ b/src/test/correct/basic_assign_increment/gcc_pic/basic_assign_increment.expected @@ -1,47 +1,47 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); @@ -90,7 +90,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69014bv64) == 0bv8); free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (memory_load32_le(mem, $x_addr) == 5bv32)); { @@ -98,12 +98,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 5bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); @@ -220,7 +220,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -235,7 +235,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (((memory_load32_le(mem, $x_addr) == x_old) || (memory_load32_le(mem, $x_addr) == 1bv32)) || (memory_load32_le(mem, $x_addr) == 6bv32)); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%000002f9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller.expected index a10273415..c07d90bb6 100644 --- a/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/clang/basic_function_call_caller.expected @@ -1,66 +1,66 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -102,7 +102,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -111,13 +111,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -227,21 +227,21 @@ procedure main() var Gamma_y_old: bool; var x_old: bv32; lmain: - assume {:captureState "addr:0x71c"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000304"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000030a"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), Gamma_R0); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000318"} true; R30, Gamma_R30 := 1840bv64, true; call zero(); goto l00000321; l00000321: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000321"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> Gamma_R0); @@ -251,7 +251,7 @@ procedure main() assert ((bvadd64(R8, 52bv64) == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%0000032c"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R29, 18446744073709551612bv64))), gamma_load32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64)); R9, Gamma_R9 := 69632bv64, true; call rely(); @@ -262,7 +262,7 @@ procedure main() assert ((bvadd64(R9, 56bv64) == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000340"} true; R0, Gamma_R0 := 0bv64, true; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); @@ -348,7 +348,7 @@ procedure zero() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lzero: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lzero"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller.expected index 5fbc30ede..092049e86 100644 --- a/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/clang_O2/basic_function_call_caller.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -80,7 +80,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -89,13 +89,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -197,7 +197,7 @@ procedure main() var Gamma_y_old: bool; var x_old: bv32; lmain: - assume {:captureState "addr:0x71c"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 0bv64, true; R9, Gamma_R9 := 69632bv64, true; @@ -210,7 +210,7 @@ procedure main() assert ((bvadd64(R9, 52bv64) == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000002f2"} true; call rely(); assert (L(mem, bvadd64(R10, 56bv64)) ==> Gamma_R8); x_old := memory_load32_le(mem, $x_addr); @@ -219,6 +219,6 @@ procedure main() assert ((bvadd64(R10, 56bv64) == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%000002fa"} true; return; } diff --git a/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller.expected index 7ef9fd5f4..22ee5ada7 100644 --- a/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/clang_no_plt_no_pic/basic_function_call_caller.expected @@ -1,66 +1,66 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -102,7 +102,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -111,13 +111,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -227,21 +227,21 @@ procedure main() var Gamma_y_old: bool; var x_old: bv32; lmain: - assume {:captureState "addr:0x71c"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000091b"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000921"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), Gamma_R0); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000092f"} true; R30, Gamma_R30 := 1840bv64, true; call zero(); goto l00000938; l00000938: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000938"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> Gamma_R0); @@ -251,7 +251,7 @@ procedure main() assert ((bvadd64(R8, 52bv64) == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000943"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R29, 18446744073709551612bv64))), gamma_load32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64)); R9, Gamma_R9 := 69632bv64, true; call rely(); @@ -262,7 +262,7 @@ procedure main() assert ((bvadd64(R9, 56bv64) == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000957"} true; R0, Gamma_R0 := 0bv64, true; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); @@ -348,7 +348,7 @@ procedure zero() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lzero: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lzero"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller.expected index 44c1da5db..4b7a73526 100644 --- a/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/clang_pic/basic_function_call_caller.expected @@ -1,66 +1,66 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -118,7 +118,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -127,13 +127,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -275,21 +275,21 @@ procedure main() var Gamma_y_old: bool; var x_old: bv32; lmain: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%0000030c"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000312"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), Gamma_R0); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000320"} true; R30, Gamma_R30 := 1904bv64, true; call zero(); goto l00000329; l00000329: - assume {:captureState "addr:0x770"}true; + assume {:captureState "addr:l00000329"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4032bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4032bv64)) || L(mem, bvadd64(R8, 4032bv64))); @@ -301,7 +301,7 @@ procedure main() assert ((R8 == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%0000033b"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R29, 18446744073709551612bv64))), gamma_load32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64)); R9, Gamma_R9 := 65536bv64, true; call rely(); @@ -314,7 +314,7 @@ procedure main() assert ((R9 == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%00000356"} true; R0, Gamma_R0 := 0bv64, true; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); @@ -432,7 +432,7 @@ procedure zero() free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); { lzero: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lzero"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller.expected index 7fc5cb92b..ffb17ca5f 100644 --- a/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/gcc/basic_function_call_caller.expected @@ -1,64 +1,64 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -100,7 +100,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -109,13 +109,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -223,21 +223,21 @@ procedure main() var Gamma_y_old: bool; var x_old: bv32; lmain: - assume {:captureState "addr:0x71c"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000302"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000308"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000031a"} true; R30, Gamma_R30 := 1836bv64, true; call zero(); goto l00000323; l00000323: - assume {:captureState "addr:0x72c"}true; + assume {:captureState "addr:l00000323"} true; R1, Gamma_R1 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; @@ -249,7 +249,7 @@ procedure main() assert ((R0 == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000033a"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -261,7 +261,7 @@ procedure main() assert ((R0 == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000354"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); @@ -346,7 +346,7 @@ procedure zero() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lzero: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lzero"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller.expected index d381cc1fc..b7a8e4c30 100644 --- a/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/gcc_O2/basic_function_call_caller.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R3: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }R3: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R3: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } R3: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -80,7 +80,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -89,13 +89,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -197,7 +197,7 @@ procedure main() var Gamma_y_old: bool; var x_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := bvadd64(R1, 20bv64), Gamma_R1; R3, Gamma_R3 := zero_extend32_32(R0[32:0]), Gamma_R0; @@ -210,7 +210,7 @@ procedure main() assert ((bvadd64(R1, 20bv64) == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001d7"} true; call rely(); assert (L(mem, bvadd64(R2, 4bv64)) ==> Gamma_R3); x_old := memory_load32_le(mem, $x_addr); @@ -219,6 +219,6 @@ procedure main() assert ((bvadd64(R2, 4bv64) == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x614"}true; + assume {:captureState "%000001df"} true; return; } diff --git a/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller.expected index 679815f97..9549d6dff 100644 --- a/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/gcc_no_plt_no_pic/basic_function_call_caller.expected @@ -1,64 +1,64 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -100,7 +100,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -109,13 +109,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -223,21 +223,21 @@ procedure main() var Gamma_y_old: bool; var x_old: bv32; lmain: - assume {:captureState "addr:0x71c"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000929"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000092f"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000941"} true; R30, Gamma_R30 := 1836bv64, true; call zero(); goto l0000094a; l0000094a: - assume {:captureState "addr:0x72c"}true; + assume {:captureState "addr:l0000094a"} true; R1, Gamma_R1 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; @@ -249,7 +249,7 @@ procedure main() assert ((R0 == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000961"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); @@ -261,7 +261,7 @@ procedure main() assert ((R0 == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%0000097b"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); @@ -346,7 +346,7 @@ procedure zero() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lzero: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lzero"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller.expected b/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller.expected index af7d75a4b..914d32dd1 100644 --- a/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller.expected +++ b/src/test/correct/basic_function_call_caller/gcc_pic/basic_function_call_caller.expected @@ -1,64 +1,64 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -116,7 +116,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -125,13 +125,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -271,21 +271,21 @@ procedure main() var Gamma_y_old: bool; var x_old: bv32; lmain: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%00000302"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%00000308"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%0000031a"} true; R30, Gamma_R30 := 1900bv64, true; call zero(); goto l00000323; l00000323: - assume {:captureState "addr:0x76c"}true; + assume {:captureState "addr:l00000323"} true; R1, Gamma_R1 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 65536bv64, true; call rely(); @@ -298,7 +298,7 @@ procedure main() assert ((R0 == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%0000033b"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); @@ -311,7 +311,7 @@ procedure main() assert ((R0 == $x_addr) ==> (L(mem, $y_addr) ==> Gamma_y_old)); assert ((x_old == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (Gamma_y_old ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%00000356"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); @@ -428,7 +428,7 @@ procedure zero() free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); { lzero: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lzero"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader.expected index 682ce7324..a56d3accc 100644 --- a/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/clang/basic_function_call_reader.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -88,7 +88,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); ensures (old(gamma_load32(Gamma_mem, $y_addr)) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); @@ -97,13 +97,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (gamma_load32(Gamma_mem, $y_addr) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -214,15 +214,15 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000301"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000315"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); @@ -250,21 +250,21 @@ procedure main() } goto l0000037a; l00000350: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000350"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%00000362"} true; goto l00000365; l0000037a: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l0000037a"} true; goto l0000037b; l0000037b: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:l0000037b"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000383"} true; goto l00000365; l00000365: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l00000365"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader.expected index 2529e078a..201254189 100644 --- a/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/clang_O2/basic_function_call_reader.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -78,7 +78,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); ensures (old(gamma_load32(Gamma_mem, $y_addr)) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); @@ -87,13 +87,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (gamma_load32(Gamma_mem, $y_addr) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -202,7 +202,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; call rely(); diff --git a/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader.expected index 6466cd9a6..ea1b0d5bb 100644 --- a/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/clang_no_plt_no_pic/basic_function_call_reader.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -88,7 +88,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); ensures (old(gamma_load32(Gamma_mem, $y_addr)) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); @@ -97,13 +97,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (gamma_load32(Gamma_mem, $y_addr) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -214,15 +214,15 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000944"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000958"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); @@ -250,21 +250,21 @@ procedure main() } goto l000009bd; l00000993: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000993"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%000009a5"} true; goto l000009a8; l000009bd: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l000009bd"} true; goto l000009be; l000009be: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:l000009be"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%000009c6"} true; goto l000009a8; l000009a8: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l000009a8"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader.expected index edf97b8b3..23c1b1cd6 100644 --- a/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/clang_pic/basic_function_call_reader.expected @@ -1,60 +1,60 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -112,7 +112,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); ensures (old(gamma_load32(Gamma_mem, $y_addr)) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); @@ -121,13 +121,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (gamma_load32(Gamma_mem, $y_addr) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -270,17 +270,17 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000309"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4048bv64)) || L(mem, bvadd64(R8, 4048bv64))); call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000324"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4032bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4032bv64)) || L(mem, bvadd64(R8, 4032bv64))); @@ -310,21 +310,21 @@ procedure main() } goto l00000390; l00000366: - assume {:captureState "addr:0x790"}true; + assume {:captureState "addr:l00000366"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x794"}true; + assume {:captureState "%00000378"} true; goto l0000037b; l00000390: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:l00000390"} true; goto l00000391; l00000391: - assume {:captureState "addr:0x788"}true; + assume {:captureState "addr:l00000391"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%00000399"} true; goto l0000037b; l0000037b: - assume {:captureState "addr:0x79c"}true; + assume {:captureState "addr:l0000037b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader.expected index ff841269b..3d639e3be 100644 --- a/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/gcc/basic_function_call_reader.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -86,7 +86,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); ensures (old(gamma_load32(Gamma_mem, $y_addr)) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); @@ -95,13 +95,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (gamma_load32(Gamma_mem, $y_addr) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -212,14 +212,14 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000304"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -235,15 +235,15 @@ procedure main() } goto l00000349; l00000332: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000332"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); goto l0000033e; l00000349: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000349"} true; R0, Gamma_R0 := 0bv64, true; goto l0000033e; l0000033e: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l0000033e"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader.expected index e872eb01d..5790272c3 100644 --- a/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/gcc_O2/basic_function_call_reader.expected @@ -1,33 +1,33 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -69,7 +69,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); ensures (old(gamma_load32(Gamma_mem, $y_addr)) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); @@ -78,13 +78,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (gamma_load32(Gamma_mem, $y_addr) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -183,7 +183,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R1, Gamma_R1 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -194,11 +194,11 @@ procedure main() } goto l00000398; l00000398: - assume {:captureState "addr:0x610"}true; + assume {:captureState "addr:l00000398"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 4bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 4bv64)) || L(mem, bvadd64(R1, 4bv64))); goto l000001bc; l000001bc: - assume {:captureState "addr:0x614"}true; + assume {:captureState "addr:l000001bc"} true; return; } diff --git a/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader.expected index 52411ea30..2a379e808 100644 --- a/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/gcc_no_plt_no_pic/basic_function_call_reader.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -86,7 +86,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); ensures (old(gamma_load32(Gamma_mem, $y_addr)) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); @@ -95,13 +95,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (gamma_load32(Gamma_mem, $y_addr) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -212,14 +212,14 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000909"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -235,15 +235,15 @@ procedure main() } goto l0000094e; l00000937: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000937"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); goto l00000943; l0000094e: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l0000094e"} true; R0, Gamma_R0 := 0bv64, true; goto l00000943; l00000943: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000943"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader.expected b/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader.expected index 09c74a7fb..23d468816 100644 --- a/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader.expected +++ b/src/test/correct/basic_function_call_reader/gcc_pic/basic_function_call_reader.expected @@ -1,58 +1,58 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then (memory_load32_le(memory, $x_addr) == 1bv32) else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); @@ -110,7 +110,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); ensures (old(gamma_load32(Gamma_mem, $y_addr)) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); @@ -119,13 +119,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == 0bv32) ==> (memory_load32_le(mem, $x_addr) == 0bv32)); assert (gamma_load32(Gamma_mem, $y_addr) ==> ((memory_load32_le(mem, $x_addr) == 0bv32) || gamma_load32(Gamma_mem, $y_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -268,7 +268,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 65536bv64, true; call rely(); @@ -276,7 +276,7 @@ procedure main() call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%00000305"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -293,15 +293,15 @@ procedure main() } goto l0000034b; l00000334: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:l00000334"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); goto l00000340; l0000034b: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l0000034b"} true; R0, Gamma_R0 := 0bv64, true; goto l00000340; l00000340: - assume {:captureState "addr:0x788"}true; + assume {:captureState "addr:l00000340"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_lock_read/clang/basic_lock_read.expected b/src/test/correct/basic_lock_read/clang/basic_lock_read.expected index 22fd43f64..30cd1ee30 100644 --- a/src/test/correct/basic_lock_read/clang/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/clang/basic_lock_read.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -95,12 +95,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -212,12 +212,12 @@ procedure main() var ZF: bv1; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002f9"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000300"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -245,24 +245,24 @@ procedure main() } goto l00000352; l00000352: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l00000352"} true; goto l00000353; l00000353: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000353"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); assert (memory_load32_le(mem, $z_addr) == z_old); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000360"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%0000036f"} true; goto l0000033b; l0000033b: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l0000033b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_read/clang_O2/basic_lock_read.expected b/src/test/correct/basic_lock_read/clang_O2/basic_lock_read.expected index 1e52ae958..6346d7bd6 100644 --- a/src/test/correct/basic_lock_read/clang_O2/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/clang_O2/basic_lock_read.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -84,12 +84,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -189,7 +189,7 @@ procedure main() { var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -199,18 +199,18 @@ procedure main() } goto l000002f7; l000002dc: - assume {:captureState "addr:0x728"}true; + assume {:captureState "addr:l000002dc"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); assert (memory_load32_le(mem, $z_addr) == z_old); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000002eb"} true; R0, Gamma_R0 := 0bv64, true; return; l000002f7: - assume {:captureState "addr:0x720"}true; + assume {:captureState "addr:l000002f7"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read.expected b/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read.expected index 1aa1173c4..ce75ac8f3 100644 --- a/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/clang_no_plt_no_pic/basic_lock_read.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -95,12 +95,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -212,12 +212,12 @@ procedure main() var ZF: bv1; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000924"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000092b"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -245,24 +245,24 @@ procedure main() } goto l0000097d; l0000097d: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l0000097d"} true; goto l0000097e; l0000097e: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l0000097e"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); assert (memory_load32_le(mem, $z_addr) == z_old); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%0000098b"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%0000099a"} true; goto l00000966; l00000966: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l00000966"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_read/clang_pic/basic_lock_read.expected b/src/test/correct/basic_lock_read/clang_pic/basic_lock_read.expected index 850826886..497ebae33 100644 --- a/src/test/correct/basic_lock_read/clang_pic/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/clang_pic/basic_lock_read.expected @@ -1,60 +1,60 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -111,7 +111,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -119,12 +119,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -268,12 +268,12 @@ procedure main() var ZF: bv1; var z_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000301"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%00000308"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4032bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4032bv64)) || L(mem, bvadd64(R8, 4032bv64))); @@ -303,10 +303,10 @@ procedure main() } goto l00000361; l00000361: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l00000361"} true; goto l00000362; l00000362: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l00000362"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4040bv64)) || L(mem, bvadd64(R8, 4040bv64))); @@ -315,14 +315,14 @@ procedure main() z_old := memory_load32_le(mem, $z_addr); mem, Gamma_mem := memory_store32_le(mem, R8, 0bv32), gamma_store32(Gamma_mem, R8, true); assert (memory_load32_le(mem, $z_addr) == z_old); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%00000376"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x78c"}true; + assume {:captureState "%00000385"} true; goto l0000034a; l0000034a: - assume {:captureState "addr:0x794"}true; + assume {:captureState "addr:l0000034a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_read/gcc/basic_lock_read.expected b/src/test/correct/basic_lock_read/gcc/basic_lock_read.expected index d69adfe90..ed5ba3f3c 100644 --- a/src/test/correct/basic_lock_read/gcc/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/gcc/basic_lock_read.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -85,7 +85,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -93,12 +93,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -210,10 +210,10 @@ procedure main() var ZF: bv1; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002f9"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -229,7 +229,7 @@ procedure main() } goto l0000033e; l0000033e: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l0000033e"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -237,16 +237,16 @@ procedure main() z_old := memory_load32_le(mem, $z_addr); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert (memory_load32_le(mem, $z_addr) == z_old); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000034e"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000368"} true; goto l00000327; l00000327: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l00000327"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read.expected b/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read.expected index 37026eb07..4ce9ccd20 100644 --- a/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/gcc_O2/basic_lock_read.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69656bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69656bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -190,7 +190,7 @@ procedure main() { var z_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R1, Gamma_R1 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -201,16 +201,16 @@ procedure main() } goto l0000039c; l0000039c: - assume {:captureState "addr:0x610"}true; + assume {:captureState "addr:l0000039c"} true; call rely(); assert (L(mem, bvadd64(R1, 4bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 4bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R1, 4bv64), true); assert (memory_load32_le(mem, $z_addr) == z_old); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000003a1"} true; goto l000001bd; l000001bd: - assume {:captureState "addr:0x614"}true; + assume {:captureState "addr:l000001bd"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read.expected b/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read.expected index eda8d8e1d..57655f452 100644 --- a/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/gcc_no_plt_no_pic/basic_lock_read.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -85,7 +85,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -93,12 +93,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -210,10 +210,10 @@ procedure main() var ZF: bv1; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%0000091a"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -229,7 +229,7 @@ procedure main() } goto l0000095f; l0000095f: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l0000095f"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -237,16 +237,16 @@ procedure main() z_old := memory_load32_le(mem, $z_addr); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert (memory_load32_le(mem, $z_addr) == z_old); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000096f"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000989"} true; goto l00000948; l00000948: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l00000948"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read.expected b/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read.expected index 924c0f016..3ec27ec86 100644 --- a/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read.expected +++ b/src/test/correct/basic_lock_read/gcc_pic/basic_lock_read.expected @@ -1,58 +1,58 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -109,7 +109,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -117,12 +117,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -266,10 +266,10 @@ procedure main() var ZF: bv1; var z_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002f9"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -286,7 +286,7 @@ procedure main() } goto l0000033f; l0000033f: - assume {:captureState "addr:0x770"}true; + assume {:captureState "addr:l0000033f"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -295,17 +295,17 @@ procedure main() z_old := memory_load32_le(mem, $z_addr); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert (memory_load32_le(mem, $z_addr) == z_old); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%00000350"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%0000036b"} true; goto l00000328; l00000328: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l00000328"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read.expected index b9ea1d366..5fe7cdbb9 100644 --- a/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/clang/basic_lock_security_read.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -95,12 +95,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); @@ -210,12 +210,12 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002f5"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002fc"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -243,18 +243,18 @@ procedure main() } goto l0000034e; l0000034e: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l0000034e"} true; goto l0000034f; l0000034f: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l0000034f"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000364"} true; goto l00000337; l00000337: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000337"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read.expected index 571be95a3..4acf8a3d2 100644 --- a/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/clang_O2/basic_lock_security_read.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); @@ -198,7 +198,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; call rely(); diff --git a/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read.expected index a0bc8c357..34072fcf8 100644 --- a/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/clang_no_plt_no_pic/basic_lock_security_read.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -95,12 +95,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); @@ -210,12 +210,12 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000913"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000091a"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -243,18 +243,18 @@ procedure main() } goto l0000096c; l0000096c: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l0000096c"} true; goto l0000096d; l0000096d: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l0000096d"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000982"} true; goto l00000955; l00000955: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000955"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read.expected index 68ce0c704..17531a14b 100644 --- a/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/clang_pic/basic_lock_security_read.expected @@ -1,60 +1,60 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -111,7 +111,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -119,12 +119,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); @@ -266,12 +266,12 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002fd"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%00000304"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4032bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4032bv64)) || L(mem, bvadd64(R8, 4032bv64))); @@ -301,20 +301,20 @@ procedure main() } goto l0000035d; l0000035d: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l0000035d"} true; goto l0000035e; l0000035e: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l0000035e"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4040bv64)) || L(mem, bvadd64(R8, 4040bv64))); call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%0000037a"} true; goto l00000346; l00000346: - assume {:captureState "addr:0x790"}true; + assume {:captureState "addr:l00000346"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read.expected index 8ba373a5c..ca05a5a54 100644 --- a/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/gcc/basic_lock_security_read.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -85,7 +85,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -93,12 +93,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); @@ -208,10 +208,10 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002ed"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -227,16 +227,16 @@ procedure main() } goto l00000332; l00000332: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000332"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%0000034a"} true; goto l0000031b; l0000031b: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:l0000031b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read.expected index cd0ed4b17..98cce1343 100644 --- a/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/gcc_O2/basic_lock_security_read.expected @@ -1,36 +1,36 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69656bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69656bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -71,7 +71,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -79,12 +79,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); @@ -182,7 +182,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := bvadd64(R1, 20bv64), Gamma_R1; R0, Gamma_R0 := 0bv64, true; @@ -194,11 +194,11 @@ procedure main() } goto l0000039c; l0000039c: - assume {:captureState "addr:0x614"}true; + assume {:captureState "addr:l0000039c"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R2, 4bv64))), (gamma_load32(Gamma_mem, bvadd64(R2, 4bv64)) || L(mem, bvadd64(R2, 4bv64))); goto l000001c2; l000001c2: - assume {:captureState "addr:0x618"}true; + assume {:captureState "addr:l000001c2"} true; return; } diff --git a/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read.expected index bd67c46dc..0ec9d6cd9 100644 --- a/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/gcc_no_plt_no_pic/basic_lock_security_read.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -85,7 +85,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -93,12 +93,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); @@ -208,10 +208,10 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000008ea"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -227,16 +227,16 @@ procedure main() } goto l0000092f; l0000092f: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l0000092f"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000947"} true; goto l00000918; l00000918: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:l00000918"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read.expected b/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read.expected index 4f6536f8d..a260e19ab 100644 --- a/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read.expected +++ b/src/test/correct/basic_lock_security_read/gcc_pic/basic_lock_security_read.expected @@ -1,58 +1,58 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); @@ -109,7 +109,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) && (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))))); { @@ -117,12 +117,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); @@ -264,10 +264,10 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002ed"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -284,17 +284,17 @@ procedure main() } goto l00000333; l00000333: - assume {:captureState "addr:0x770"}true; + assume {:captureState "addr:l00000333"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x77c"}true; + assume {:captureState "%0000034c"} true; goto l0000031c; l0000031c: - assume {:captureState "addr:0x780"}true; + assume {:captureState "addr:l0000031c"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write.expected index 24daf725a..3215ac6c4 100644 --- a/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/clang/basic_lock_security_write.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); { @@ -91,12 +91,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -201,10 +201,10 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002ea"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 1bv64, true; call rely(); @@ -215,7 +215,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert ((bvadd64(R8, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000002fc"} true; R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := 69632bv64, true; call rely(); @@ -226,7 +226,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R10); assert ((bvadd64(R9, 56bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%00000310"} true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> true); @@ -236,7 +236,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), true); assert ((bvadd64(R9, 56bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000031c"} true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); @@ -245,7 +245,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), true); assert ((bvadd64(R8, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000323"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write.expected index c6578965b..610776107 100644 --- a/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/clang_O2/basic_lock_security_write.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); { @@ -84,12 +84,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -192,7 +192,7 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; @@ -204,7 +204,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); assert ((bvadd64(R8, 56bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d6"} true; call rely(); assert (L(mem, bvadd64(R9, 52bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); @@ -213,6 +213,6 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), true); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000002dd"} true; return; } diff --git a/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write.expected index 24daf725a..545f5c2ee 100644 --- a/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/clang_no_plt_no_pic/basic_lock_security_write.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); { @@ -91,12 +91,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -201,10 +201,10 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000008c7"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 1bv64, true; call rely(); @@ -215,7 +215,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert ((bvadd64(R8, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000008d9"} true; R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := 69632bv64, true; call rely(); @@ -226,7 +226,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R10); assert ((bvadd64(R9, 56bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%000008ed"} true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> true); @@ -236,7 +236,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), true); assert ((bvadd64(R9, 56bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%000008f9"} true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); @@ -245,7 +245,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), true); assert ((bvadd64(R8, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000900"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write.expected index 9df716c53..de3ed4f9c 100644 --- a/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/clang_pic/basic_lock_security_write.expected @@ -1,56 +1,56 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); @@ -107,7 +107,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); { @@ -115,12 +115,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -257,10 +257,10 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002f2"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4032bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4032bv64)) || L(mem, bvadd64(R8, 4032bv64))); @@ -273,7 +273,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R8, R9[32:0]), gamma_store32(Gamma_mem, R8, Gamma_R9); assert ((R8 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%0000030b"} true; R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := 65536bv64, true; call rely(); @@ -286,7 +286,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R9, R10[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R10); assert ((R9 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%00000326"} true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, R9) ==> true); @@ -296,7 +296,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R9, 0bv32), gamma_store32(Gamma_mem, R9, true); assert ((R9 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000332"} true; call rely(); assert (L(mem, R8) ==> true); z_old := memory_load32_le(mem, $z_addr); @@ -305,7 +305,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R8, 0bv32), gamma_store32(Gamma_mem, R8, true); assert ((R8 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%00000339"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write.expected index cc85715b0..1bde78af8 100644 --- a/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/gcc/basic_lock_security_write.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); { @@ -87,12 +87,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -197,10 +197,10 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000302"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -212,7 +212,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000031a"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); @@ -224,7 +224,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000334"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -235,7 +235,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%00000346"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -246,7 +246,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x750"}true; + assume {:captureState "%00000358"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write.expected index d76f52173..d0674a81c 100644 --- a/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/gcc_O2/basic_lock_security_write.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); { @@ -84,12 +84,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -192,7 +192,7 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := bvadd64(R1, 20bv64), Gamma_R1; R0, Gamma_R0 := 0bv64, true; @@ -204,7 +204,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), true); assert ((bvadd64(R1, 20bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x60c"}true; + assume {:captureState "%000001bd"} true; call rely(); assert (L(mem, bvadd64(R2, 4bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); @@ -213,6 +213,6 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R2, 4bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R2, 4bv64), true); assert ((bvadd64(R2, 4bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001c4"} true; return; } diff --git a/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write.expected index cc85715b0..756ec0e54 100644 --- a/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/gcc_no_plt_no_pic/basic_lock_security_write.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); { @@ -87,12 +87,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -197,10 +197,10 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000925"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -212,7 +212,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000093d"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); @@ -224,7 +224,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000957"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -235,7 +235,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%00000969"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -246,7 +246,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x750"}true; + assume {:captureState "%0000097b"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write.expected b/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write.expected index 1289cc1d0..d3d4f6717 100644 --- a/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write.expected +++ b/src/test/correct/basic_lock_security_write/gcc_pic/basic_lock_security_write.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); @@ -103,7 +103,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))) && (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr)))); { @@ -111,12 +111,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)) && (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -253,10 +253,10 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000302"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -269,7 +269,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%0000031b"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -282,7 +282,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%00000336"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -294,7 +294,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%00000349"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -306,7 +306,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x790"}true; + assume {:captureState "%0000035c"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock.expected index 8b9536cd6..8571e0d28 100644 --- a/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/clang/basic_lock_unlock.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -186,7 +186,7 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 1bv64, true; call rely(); @@ -195,7 +195,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002d6"} true; R8, Gamma_R8 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; call rely(); @@ -204,6 +204,6 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000002e7"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock.expected index e5fa90b68..1c48c94b8 100644 --- a/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/clang_O2/basic_lock_unlock.expected @@ -1,39 +1,39 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -74,7 +74,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); { @@ -82,12 +82,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -188,7 +188,7 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 1bv64, true; @@ -199,13 +199,13 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000002e0"} true; call rely(); assert (L(mem, bvadd64(R10, 56bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R10, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R10, 56bv64), true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000002e7"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock.expected index 8b9536cd6..38fc839c6 100644 --- a/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/clang_no_plt_no_pic/basic_lock_unlock.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -186,7 +186,7 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 1bv64, true; call rely(); @@ -195,7 +195,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000865"} true; R8, Gamma_R8 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; call rely(); @@ -204,6 +204,6 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000876"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock.expected index 5d1ee5164..f9c42273c 100644 --- a/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/clang_pic/basic_lock_unlock.expected @@ -1,45 +1,45 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -96,7 +96,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); { @@ -104,12 +104,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -242,7 +242,7 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4040bv64)) || L(mem, bvadd64(R9, 4040bv64))); @@ -253,7 +253,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002e5"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4032bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4032bv64)) || L(mem, bvadd64(R8, 4032bv64))); @@ -264,6 +264,6 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R8, 0bv32), gamma_store32(Gamma_mem, R8, true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x770"}true; + assume {:captureState "%000002fd"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock.expected index c7c3d5b67..92fa648ce 100644 --- a/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/gcc/basic_lock_unlock.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -184,7 +184,7 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -194,7 +194,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002e4"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -203,7 +203,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000002f6"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock.expected index cb994b9e1..e16dad000 100644 --- a/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/gcc_O2/basic_lock_unlock.expected @@ -1,39 +1,39 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R3: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }R3: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R3: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } R3: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -74,7 +74,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); { @@ -82,12 +82,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -188,7 +188,7 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := bvadd64(R1, 20bv64), Gamma_R1; R3, Gamma_R3 := 1bv64, true; @@ -199,13 +199,13 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R3[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R3); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001c3"} true; call rely(); assert (L(mem, bvadd64(R2, 4bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R2, 4bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R2, 4bv64), true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x614"}true; + assume {:captureState "%000001ca"} true; return; } diff --git a/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock.expected index c7c3d5b67..3fd503dac 100644 --- a/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/gcc_no_plt_no_pic/basic_lock_unlock.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -184,7 +184,7 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -194,7 +194,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000088b"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -203,7 +203,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%0000089d"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock.expected b/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock.expected index ad9e338ed..21faf7ae0 100644 --- a/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock.expected +++ b/src/test/correct/basic_lock_unlock/gcc_pic/basic_lock_unlock.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -94,7 +94,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); { @@ -102,12 +102,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)))); @@ -240,7 +240,7 @@ procedure main() var x_old: bv32; var z_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -251,7 +251,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002e5"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -261,7 +261,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((z_old == 0bv32) ==> ((memory_load32_le(mem, $x_addr) == x_old) && (memory_load32_le(mem, $z_addr) == z_old))); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%000002f8"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_loop_assign/clang/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/clang/basic_loop_assign.expected index d8438552b..e640f145d 100644 --- a/src/test/correct/basic_loop_assign/clang/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/clang/basic_loop_assign.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsle"}bvsle32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvslt"}bvslt32(bv32, bv32) returns (bool); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsle"} bvsle32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvslt"} bvslt32(bv32, bv32) returns (bool); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(memory_load32_le(mem, $x_addr), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (memory_load32_le(mem, $x_addr) == 20bv32))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (memory_load32_le(mem, $x_addr) == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(memory_load32_le(mem, $x_addr), 10bv32))); @@ -186,7 +186,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 20bv64, true; call rely(); @@ -194,7 +194,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002ce"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign.expected index e70e4ae90..fd335dcf3 100644 --- a/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/clang_O2/basic_loop_assign.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsle"}bvsle32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvslt"}bvslt32(bv32, bv32) returns (bool); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsle"} bvsle32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvslt"} bvslt32(bv32, bv32) returns (bool); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(memory_load32_le(mem, $x_addr), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (memory_load32_le(mem, $x_addr) == 20bv32))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (memory_load32_le(mem, $x_addr) == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(memory_load32_le(mem, $x_addr), 10bv32))); @@ -186,7 +186,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 20bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -195,6 +195,6 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d3"} true; return; } diff --git a/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign.expected index d8438552b..1fa831faf 100644 --- a/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/clang_no_plt_no_pic/basic_loop_assign.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsle"}bvsle32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvslt"}bvslt32(bv32, bv32) returns (bool); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsle"} bvsle32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvslt"} bvslt32(bv32, bv32) returns (bool); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(memory_load32_le(mem, $x_addr), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (memory_load32_le(mem, $x_addr) == 20bv32))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (memory_load32_le(mem, $x_addr) == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(memory_load32_le(mem, $x_addr), 10bv32))); @@ -186,7 +186,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 20bv64, true; call rely(); @@ -194,7 +194,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000845"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign.expected index ef03cf161..a4d7eaa2e 100644 --- a/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/clang_pic/basic_loop_assign.expected @@ -1,45 +1,45 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsle"}bvsle32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvslt"}bvslt32(bv32, bv32) returns (bool); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsle"} bvsle32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvslt"} bvslt32(bv32, bv32) returns (bool); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); @@ -88,7 +88,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69598bv64) == 0bv8); free ensures (memory_load8_le(mem, 69599bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); { @@ -96,12 +96,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(memory_load32_le(mem, $x_addr), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (memory_load32_le(mem, $x_addr) == 20bv32))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (memory_load32_le(mem, $x_addr) == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(memory_load32_le(mem, $x_addr), 10bv32))); @@ -218,7 +218,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4040bv64)) || L(mem, bvadd64(R9, 4040bv64))); @@ -228,7 +228,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_loop_assign/gcc/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/gcc/basic_loop_assign.expected index bdb3e223c..136c8bbe8 100644 --- a/src/test/correct/basic_loop_assign/gcc/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/gcc/basic_loop_assign.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsle"}bvsle32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvslt"}bvslt32(bv32, bv32) returns (bool); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsle"} bvsle32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvslt"} bvslt32(bv32, bv32) returns (bool); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(memory_load32_le(mem, $x_addr), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (memory_load32_le(mem, $x_addr) == 20bv32))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (memory_load32_le(mem, $x_addr) == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(memory_load32_le(mem, $x_addr), 10bv32))); @@ -184,7 +184,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 20bv64, true; @@ -193,7 +193,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d8"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign.expected index de64496b6..c4ffcbeff 100644 --- a/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/gcc_O2/basic_loop_assign.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsle"}bvsle32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvslt"}bvslt32(bv32, bv32) returns (bool); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsle"} bvsle32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvslt"} bvslt32(bv32, bv32) returns (bool); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(memory_load32_le(mem, $x_addr), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (memory_load32_le(mem, $x_addr) == 20bv32))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (memory_load32_le(mem, $x_addr) == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(memory_load32_le(mem, $x_addr), 10bv32))); @@ -186,7 +186,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := 20bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -195,6 +195,6 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); - assume {:captureState "addr:0x60c"}true; + assume {:captureState "%000001bd"} true; return; } diff --git a/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign.expected index bdb3e223c..c57072406 100644 --- a/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/gcc_no_plt_no_pic/basic_loop_assign.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsle"}bvsle32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvslt"}bvslt32(bv32, bv32) returns (bool); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsle"} bvsle32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvslt"} bvslt32(bv32, bv32) returns (bool); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(memory_load32_le(mem, $x_addr), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (memory_load32_le(mem, $x_addr) == 20bv32))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (memory_load32_le(mem, $x_addr) == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(memory_load32_le(mem, $x_addr), 10bv32))); @@ -184,7 +184,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 20bv64, true; @@ -193,7 +193,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000085b"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign.expected b/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign.expected index b473c8028..263ae5ca8 100644 --- a/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign.expected +++ b/src/test/correct/basic_loop_assign/gcc_pic/basic_loop_assign.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsle"}bvsle32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvslt"}bvslt32(bv32, bv32) returns (bool); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsle"} bvsle32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvslt"} bvslt32(bv32, bv32) returns (bool); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); @@ -86,7 +86,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69014bv64) == 0bv8); free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (((memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(old(memory_load32_le(mem, $x_addr)), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (old(memory_load32_le(mem, $x_addr)) == 20bv32))); { @@ -94,12 +94,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || (bvsle32(memory_load32_le(mem, $x_addr), 10bv32) && bvslt32(memory_load32_le(mem, $x_addr), 10bv32))) || ((memory_load32_le(mem, $x_addr) == 21bv32) && (memory_load32_le(mem, $x_addr) == 20bv32))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (memory_load32_le(mem, $x_addr) == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(memory_load32_le(mem, $x_addr), 10bv32))); @@ -216,7 +216,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -226,7 +226,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (((memory_load32_le(mem, $x_addr) == x_old) || ((memory_load32_le(mem, $x_addr) == 20bv32) && (x_old == 0bv32))) || ((memory_load32_le(mem, $x_addr) == 20bv32) && bvsle32(x_old, 10bv32))); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation.expected index 6e420eccc..887ea3b58 100644 --- a/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/clang/basic_operation_evaluation.expected @@ -1,64 +1,64 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1952bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvmul"}bvmul64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot32(bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvor"}bvor32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvsdiv"}bvsdiv33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvxor"}bvxor32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1952bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvmul"} bvmul64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot32(bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvor"} bvor32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvsdiv"} bvsdiv33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvxor"} bvxor32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -99,7 +99,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -108,9 +108,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -219,38 +219,38 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; R8, Gamma_R8 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000338"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000340"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000348"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%00000355"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000362"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := zero_extend32_32(bvxor32(R8[32:0], R9[32:0])), (Gamma_R9 && Gamma_R8); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%0000037f"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); R8, Gamma_R8 := zero_extend32_32(bvor32(R8[32:0], R9[32:0])), (Gamma_R9 && Gamma_R8); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%0000039c"} true; R8, Gamma_R8 := 30bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000003a9"} true; R8, Gamma_R8 := 17bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%000003b6"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); assert Gamma_R10; @@ -274,7 +274,7 @@ procedure main() NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; R8, Gamma_R8 := zero_extend32_32(bvadd32(#5, 1bv32)), Gamma_#5; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000407"} true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation.expected index 863d7bd46..dfc8a4e7d 100644 --- a/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/clang_O2/basic_operation_evaluation.expected @@ -1,14 +1,14 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1840bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1840bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -49,7 +49,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -58,9 +58,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -155,7 +155,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation.expected index 68868d22c..73df7b339 100644 --- a/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/clang_no_plt_no_pic/basic_operation_evaluation.expected @@ -1,64 +1,64 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1952bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvmul"}bvmul64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot32(bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvor"}bvor32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvsdiv"}bvsdiv33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvxor"}bvxor32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1952bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvmul"} bvmul64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot32(bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvor"} bvor32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvsdiv"} bvsdiv33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvxor"} bvxor32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -99,7 +99,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -108,9 +108,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -219,38 +219,38 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; R8, Gamma_R8 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000a1b"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000a23"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000a2b"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%00000a38"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000a45"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := zero_extend32_32(bvxor32(R8[32:0], R9[32:0])), (Gamma_R9 && Gamma_R8); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000a62"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); R8, Gamma_R8 := zero_extend32_32(bvor32(R8[32:0], R9[32:0])), (Gamma_R9 && Gamma_R8); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000a7f"} true; R8, Gamma_R8 := 30bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000a8c"} true; R8, Gamma_R8 := 17bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000a99"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); assert Gamma_R10; @@ -274,7 +274,7 @@ procedure main() NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; R8, Gamma_R8 := zero_extend32_32(bvadd32(#5, 1bv32)), Gamma_#5; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000aea"} true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation.expected index 68868d22c..73df7b339 100644 --- a/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/clang_pic/basic_operation_evaluation.expected @@ -1,64 +1,64 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1952bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvmul"}bvmul64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot32(bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvor"}bvor32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvsdiv"}bvsdiv33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvxor"}bvxor32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1952bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvmul"} bvmul64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot32(bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvor"} bvor32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvsdiv"} bvsdiv33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvxor"} bvxor32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -99,7 +99,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -108,9 +108,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -219,38 +219,38 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; R8, Gamma_R8 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000a1b"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000a23"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000a2b"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%00000a38"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000a45"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := zero_extend32_32(bvxor32(R8[32:0], R9[32:0])), (Gamma_R9 && Gamma_R8); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000a62"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); R8, Gamma_R8 := zero_extend32_32(bvor32(R8[32:0], R9[32:0])), (Gamma_R9 && Gamma_R8); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000a7f"} true; R8, Gamma_R8 := 30bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000a8c"} true; R8, Gamma_R8 := 17bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000a99"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); assert Gamma_R10; @@ -274,7 +274,7 @@ procedure main() NF, Gamma_NF := bvadd32(#5, 1bv32)[32:31], Gamma_#5; R8, Gamma_R8 := zero_extend32_32(bvadd32(#5, 1bv32)), Gamma_#5; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000aea"} true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation.expected index 527e11509..14d6921a1 100644 --- a/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/gcc/basic_operation_evaluation.expected @@ -1,56 +1,56 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1948bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvmul"}bvmul64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvnot"}bvnot32(bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvor"}bvor32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvsdiv"}bvsdiv33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvxor"}bvxor32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1948bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvmul"} bvmul64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvnot"} bvnot32(bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvor"} bvor32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvsdiv"} bvsdiv33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvxor"} bvxor32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -91,7 +91,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -100,9 +100,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,34 +199,34 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%0000032a"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R1), gamma_store64(Gamma_stack, R31, Gamma_R1); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000332"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000033f"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%0000034c"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); R0, Gamma_R0 := zero_extend32_32(bvxor32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000369"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := zero_extend32_32(bvor32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%00000386"} true; R0, Gamma_R0 := 30bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R0); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%00000393"} true; R0, Gamma_R0 := 17bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%000003a0"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); assert Gamma_R1; @@ -245,7 +245,7 @@ procedure main() R1, Gamma_R1 := zero_extend32_32(bvmul64(zero_extend32_32(R2[32:0]), zero_extend32_32(R1[32:0]))[32:0]), (Gamma_R1 && Gamma_R2); R0, Gamma_R0 := zero_extend32_32(bvadd32(bvadd32(R0[32:0], bvnot32(R1[32:0])), 1bv32)), (Gamma_R1 && Gamma_R0); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%000003dc"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation.expected index 418f9a5da..db578d839 100644 --- a/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/gcc_O2/basic_operation_evaluation.expected @@ -1,14 +1,14 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1896bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1896bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -49,7 +49,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -58,9 +58,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -155,7 +155,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation.expected index 0bfd7448d..c13871a69 100644 --- a/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/gcc_no_plt_no_pic/basic_operation_evaluation.expected @@ -1,56 +1,56 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1948bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvmul"}bvmul64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvnot"}bvnot32(bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvor"}bvor32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvsdiv"}bvsdiv33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvxor"}bvxor32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1948bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvmul"} bvmul64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvnot"} bvnot32(bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvor"} bvor32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvsdiv"} bvsdiv33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvxor"} bvxor32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -91,7 +91,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -100,9 +100,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,34 +199,34 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000009e5"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R1), gamma_store64(Gamma_stack, R31, Gamma_R1); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000009ed"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000009fa"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%00000a07"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); R0, Gamma_R0 := zero_extend32_32(bvxor32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000a24"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := zero_extend32_32(bvor32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%00000a41"} true; R0, Gamma_R0 := 30bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R0); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%00000a4e"} true; R0, Gamma_R0 := 17bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%00000a5b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); assert Gamma_R1; @@ -245,7 +245,7 @@ procedure main() R1, Gamma_R1 := zero_extend32_32(bvmul64(zero_extend32_32(R2[32:0]), zero_extend32_32(R1[32:0]))[32:0]), (Gamma_R1 && Gamma_R2); R0, Gamma_R0 := zero_extend32_32(bvadd32(bvadd32(R0[32:0], bvnot32(R1[32:0])), 1bv32)), (Gamma_R1 && Gamma_R0); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%00000a97"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation.expected b/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation.expected index 0bfd7448d..c13871a69 100644 --- a/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation.expected +++ b/src/test/correct/basic_operation_evaluation/gcc_pic/basic_operation_evaluation.expected @@ -1,56 +1,56 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1948bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvmul"}bvmul64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvnot"}bvnot32(bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvor"}bvor32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvsdiv"}bvsdiv33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvxor"}bvxor32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1948bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvmul"} bvmul64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvnot"} bvnot32(bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvor"} bvor32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvsdiv"} bvsdiv33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvxor"} bvxor32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -91,7 +91,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -100,9 +100,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,34 +199,34 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000009e5"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R1), gamma_store64(Gamma_stack, R31, Gamma_R1); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000009ed"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000009fa"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%00000a07"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); R0, Gamma_R0 := zero_extend32_32(bvxor32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000a24"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := zero_extend32_32(bvor32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%00000a41"} true; R0, Gamma_R0 := 30bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R0); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%00000a4e"} true; R0, Gamma_R0 := 17bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%00000a5b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); assert Gamma_R1; @@ -245,7 +245,7 @@ procedure main() R1, Gamma_R1 := zero_extend32_32(bvmul64(zero_extend32_32(R2[32:0]), zero_extend32_32(R1[32:0]))[32:0]), (Gamma_R1 && Gamma_R2); R0, Gamma_R0 := zero_extend32_32(bvadd32(bvadd32(R0[32:0], bvnot32(R1[32:0])), 1bv32)), (Gamma_R1 && Gamma_R0); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%00000a97"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read.expected index 5ccdb0df0..4cfc49619 100644 --- a/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/clang/basic_sec_policy_read.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); { @@ -95,12 +95,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -210,15 +210,15 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002f5"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000309"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); @@ -246,15 +246,15 @@ procedure main() } goto l0000035b; l0000035b: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l0000035b"} true; goto l0000035c; l0000035c: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:l0000035c"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000364"} true; goto l00000344; l00000344: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000344"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read.expected index 9254d1cf3..a3b6da627 100644 --- a/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/clang_O2/basic_sec_policy_read.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -198,7 +198,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; call rely(); diff --git a/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read.expected index dd69ae193..0177f85d1 100644 --- a/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/clang_no_plt_no_pic/basic_sec_policy_read.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); { @@ -95,12 +95,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -210,15 +210,15 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000913"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000927"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); @@ -246,15 +246,15 @@ procedure main() } goto l00000979; l00000979: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000979"} true; goto l0000097a; l0000097a: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:l0000097a"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000982"} true; goto l00000962; l00000962: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000962"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read.expected index 89f602f16..5b56d78b1 100644 --- a/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/clang_pic/basic_sec_policy_read.expected @@ -1,60 +1,60 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -111,7 +111,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); { @@ -119,12 +119,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -266,17 +266,17 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002fd"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4040bv64)) || L(mem, bvadd64(R8, 4040bv64))); call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000318"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4032bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4032bv64)) || L(mem, bvadd64(R8, 4032bv64))); @@ -306,15 +306,15 @@ procedure main() } goto l00000371; l00000371: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:l00000371"} true; goto l00000372; l00000372: - assume {:captureState "addr:0x788"}true; + assume {:captureState "addr:l00000372"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%0000037a"} true; goto l0000035a; l0000035a: - assume {:captureState "addr:0x790"}true; + assume {:captureState "addr:l0000035a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read.expected index 8aaa1213b..9834a0a98 100644 --- a/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/gcc/basic_sec_policy_read.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -85,7 +85,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); { @@ -93,12 +93,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -208,14 +208,14 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000300"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -231,12 +231,12 @@ procedure main() } goto l00000345; l00000345: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000345"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%0000034a"} true; goto l0000032e; l0000032e: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:l0000032e"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read.expected index 3ef4dd28b..e6a2012ed 100644 --- a/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/gcc_O2/basic_sec_policy_read.expected @@ -1,36 +1,36 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69656bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69656bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -71,7 +71,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); { @@ -79,12 +79,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -182,7 +182,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := bvadd64(R1, 20bv64), Gamma_R1; R0, Gamma_R0 := 0bv64, true; @@ -194,11 +194,11 @@ procedure main() } goto l0000039c; l0000039c: - assume {:captureState "addr:0x614"}true; + assume {:captureState "addr:l0000039c"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R2, 4bv64))), (gamma_load32(Gamma_mem, bvadd64(R2, 4bv64)) || L(mem, bvadd64(R2, 4bv64))); goto l000001c2; l000001c2: - assume {:captureState "addr:0x618"}true; + assume {:captureState "addr:l000001c2"} true; return; } diff --git a/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read.expected index 1e3b29dbd..c56bd1044 100644 --- a/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/gcc_no_plt_no_pic/basic_sec_policy_read.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -85,7 +85,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); { @@ -93,12 +93,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -208,14 +208,14 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000008fd"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -231,12 +231,12 @@ procedure main() } goto l00000942; l00000942: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000942"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000947"} true; goto l0000092b; l0000092b: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:l0000092b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read.expected b/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read.expected index e31b86ffc..45001e96f 100644 --- a/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read.expected +++ b/src/test/correct/basic_sec_policy_read/gcc_pic/basic_sec_policy_read.expected @@ -1,58 +1,58 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -109,7 +109,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $z_addr)) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); { @@ -117,12 +117,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); @@ -264,7 +264,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 65536bv64, true; call rely(); @@ -272,7 +272,7 @@ procedure main() call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%00000301"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -289,12 +289,12 @@ procedure main() } goto l00000347; l00000347: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l00000347"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x77c"}true; + assume {:captureState "%0000034c"} true; goto l00000330; l00000330: - assume {:captureState "addr:0x780"}true; + assume {:captureState "addr:l00000330"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write.expected index 22367a2d9..2dc7e76a3 100644 --- a/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/clang/basic_sec_policy_write.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); { @@ -91,12 +91,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -199,10 +199,10 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002ee"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 1bv64, true; call rely(); @@ -212,7 +212,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000300"} true; R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R8, Gamma_R8 := 69632bv64, true; call rely(); @@ -222,7 +222,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), Gamma_R10); assert ((bvadd64(R8, 56bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%00000314"} true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> true); @@ -231,7 +231,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); assert ((bvadd64(R8, 56bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000320"} true; R8, Gamma_R8 := 2bv64, true; call rely(); assert (L(mem, bvadd64(R9, 52bv64)) ==> Gamma_R8); @@ -240,7 +240,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%0000032d"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write.expected index f68544c6f..1d4c8067f 100644 --- a/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/clang_O2/basic_sec_policy_write.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); @@ -78,7 +78,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); { @@ -86,12 +86,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -192,7 +192,7 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; @@ -204,7 +204,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); assert ((bvadd64(R8, 56bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000002df"} true; call rely(); assert (L(mem, bvadd64(R9, 52bv64)) ==> Gamma_R10); z_old := memory_load32_le(mem, $z_addr); @@ -212,6 +212,6 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R10); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000002e7"} true; return; } diff --git a/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write.expected index 22367a2d9..ee74210ac 100644 --- a/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/clang_no_plt_no_pic/basic_sec_policy_write.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); { @@ -91,12 +91,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -199,10 +199,10 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000008d7"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 1bv64, true; call rely(); @@ -212,7 +212,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000008e9"} true; R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R8, Gamma_R8 := 69632bv64, true; call rely(); @@ -222,7 +222,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), Gamma_R10); assert ((bvadd64(R8, 56bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%000008fd"} true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> true); @@ -231,7 +231,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); assert ((bvadd64(R8, 56bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000909"} true; R8, Gamma_R8 := 2bv64, true; call rely(); assert (L(mem, bvadd64(R9, 52bv64)) ==> Gamma_R8); @@ -240,7 +240,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000916"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write.expected index 38704ec35..c0e78cc8c 100644 --- a/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/clang_pic/basic_sec_policy_write.expected @@ -1,56 +1,56 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); @@ -107,7 +107,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); { @@ -115,12 +115,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -255,10 +255,10 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002f6"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4032bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4032bv64)) || L(mem, bvadd64(R9, 4032bv64))); @@ -270,7 +270,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assert ((R9 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%0000030f"} true; R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R8, Gamma_R8 := 65536bv64, true; call rely(); @@ -282,7 +282,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R8, R10[32:0]), gamma_store32(Gamma_mem, R8, Gamma_R10); assert ((R8 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%0000032a"} true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, R8) ==> true); @@ -291,7 +291,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R8, 0bv32), gamma_store32(Gamma_mem, R8, true); assert ((R8 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000336"} true; R8, Gamma_R8 := 2bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); @@ -300,7 +300,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assert ((R9 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%00000343"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write.expected index f14dd2176..9a5e68d88 100644 --- a/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/gcc/basic_sec_policy_write.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); { @@ -87,12 +87,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -195,10 +195,10 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000306"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -209,7 +209,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000031e"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); @@ -220,7 +220,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000338"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -230,7 +230,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%0000034a"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 2bv64, true; @@ -241,7 +241,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%00000362"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write.expected index fabce9632..c435de35d 100644 --- a/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/gcc_O2/basic_sec_policy_write.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R3: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }R3: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R3: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } R3: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); @@ -78,7 +78,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); { @@ -86,12 +86,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -192,7 +192,7 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := bvadd64(R1, 20bv64), Gamma_R1; R3, Gamma_R3 := 2bv64, true; @@ -204,7 +204,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), true); assert ((bvadd64(R1, 20bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001c2"} true; call rely(); assert (L(mem, bvadd64(R2, 4bv64)) ==> Gamma_R3); z_old := memory_load32_le(mem, $z_addr); @@ -212,6 +212,6 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R2, 4bv64), R3[32:0]), gamma_store32(Gamma_mem, bvadd64(R2, 4bv64), Gamma_R3); assert ((bvadd64(R2, 4bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x614"}true; + assume {:captureState "%000001ca"} true; return; } diff --git a/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write.expected index f14dd2176..c83866d0f 100644 --- a/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/gcc_no_plt_no_pic/basic_sec_policy_write.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); { @@ -87,12 +87,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -195,10 +195,10 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000935"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -209,7 +209,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000094d"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); @@ -220,7 +220,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000967"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -230,7 +230,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%00000979"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 2bv64, true; @@ -241,7 +241,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%00000991"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write.expected b/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write.expected index c9e53cb63..3ba5940fc 100644 --- a/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write.expected +++ b/src/test/correct/basic_sec_policy_write/gcc_pic/basic_sec_policy_write.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); @@ -103,7 +103,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr)); { @@ -111,12 +111,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $z_addr) != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); @@ -251,10 +251,10 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000306"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -266,7 +266,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%0000031f"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -278,7 +278,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%0000033a"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -289,7 +289,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%0000034d"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -301,7 +301,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert ((z_old != 0bv32) ==> (memory_load32_le(mem, $z_addr) != 0bv32)); - assume {:captureState "addr:0x794"}true; + assume {:captureState "%00000366"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0.expected index 4a6b81ff1..592173b60 100644 --- a/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/clang/basicassign_gamma0.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69684bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69684bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $secret_addr) == memory_load32_le(mem, $secret_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -186,7 +186,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -194,7 +194,7 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0.expected index a3d5ee86d..3d9ca451f 100644 --- a/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/clang_O2/basicassign_gamma0.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69684bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69684bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $secret_addr) == memory_load32_le(mem, $secret_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -186,7 +186,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -195,6 +195,6 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000002de"} true; return; } diff --git a/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0.expected index 4a6b81ff1..06a2746a5 100644 --- a/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/clang_no_plt_no_pic/basicassign_gamma0.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69684bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69684bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $secret_addr) == memory_load32_le(mem, $secret_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -186,7 +186,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -194,7 +194,7 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000085d"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0.expected index 8d3b6f254..2677baa88 100644 --- a/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/clang_pic/basicassign_gamma0.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69684bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69684bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); @@ -101,7 +101,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); { @@ -109,12 +109,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $secret_addr) == memory_load32_le(mem, $secret_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -242,7 +242,7 @@ procedure main() free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4048bv64)) || L(mem, bvadd64(R8, 4048bv64))); @@ -254,7 +254,7 @@ procedure main() call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%000002ef"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0.expected index eb4fdf55d..26c44406d 100644 --- a/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/gcc/basicassign_gamma0.expected @@ -1,40 +1,40 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69656bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69656bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); @@ -75,7 +75,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); { @@ -83,12 +83,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $secret_addr) == memory_load32_le(mem, $secret_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -184,7 +184,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -194,7 +194,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000002ed"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0.expected index d1e5aa131..c4568c2b3 100644 --- a/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/gcc_O2/basicassign_gamma0.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69656bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69656bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $secret_addr) == memory_load32_le(mem, $secret_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -186,7 +186,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := bvadd64(R1, 20bv64), Gamma_R1; R0, Gamma_R0 := 0bv64, true; @@ -195,6 +195,6 @@ procedure main() call rely(); assert (L(mem, bvadd64(R1, 20bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001c5"} true; return; } diff --git a/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0.expected index eb4fdf55d..a637efeb7 100644 --- a/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/gcc_no_plt_no_pic/basicassign_gamma0.expected @@ -1,40 +1,40 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69656bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69656bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); @@ -75,7 +75,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); { @@ -83,12 +83,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $secret_addr) == memory_load32_le(mem, $secret_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -184,7 +184,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -194,7 +194,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000889"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0.expected b/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0.expected index d09ef1c76..d5b33266a 100644 --- a/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0.expected +++ b/src/test/correct/basicassign_gamma0/gcc_pic/basicassign_gamma0.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69656bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69656bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); @@ -99,7 +99,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $secret_addr) == old(memory_load32_le(mem, $secret_addr))); { @@ -107,12 +107,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $secret_addr) == memory_load32_le(mem, $secret_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -240,7 +240,7 @@ procedure main() free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); @@ -252,7 +252,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%000002ef"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/basicfree/clang/basicfree.expected b/src/test/correct/basicfree/clang/basicfree.expected index 1de1ece3a..aefe5e23c 100644 --- a/src/test/correct/basicfree/clang/basicfree.expected +++ b/src/test/correct/basicfree/clang/basicfree.expected @@ -1,59 +1,59 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2080bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2080bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -94,7 +94,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69694bv64) == 0bv8); free ensures (memory_load8_le(mem, 69695bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -103,9 +103,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -283,34 +283,34 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x7d8"}true; + assume {:captureState "%000002f2"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x7d8"}true; + assume {:captureState "%000002f8"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2024bv64, true; call malloc(); goto l0000030d; l0000030d: - assume {:captureState "addr:0x7e8"}true; + assume {:captureState "addr:l0000030d"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x7e8"}true; + assume {:captureState "%00000313"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := 1bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x7f4"}true; + assume {:captureState "%00000327"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R30, Gamma_R30 := 2048bv64, true; call #free(); goto l00000338; l00000338: - assume {:captureState "addr:0x800"}true; + assume {:captureState "addr:l00000338"} true; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); diff --git a/src/test/correct/basicfree/clang_O2/basicfree.expected b/src/test/correct/basicfree/clang_O2/basicfree.expected index 6ca38a2b2..a691307d3 100644 --- a/src/test/correct/basicfree/clang_O2/basicfree.expected +++ b/src/test/correct/basicfree/clang_O2/basicfree.expected @@ -1,12 +1,12 @@ -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1836bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1836bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -47,7 +47,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -56,9 +56,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -152,6 +152,6 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; return; } diff --git a/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree.expected b/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree.expected index 4e90916c5..0cbefca5a 100644 --- a/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree.expected +++ b/src/test/correct/basicfree/clang_no_plt_no_pic/basicfree.expected @@ -1,59 +1,59 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2080bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2080bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -94,7 +94,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69694bv64) == 0bv8); free ensures (memory_load8_le(mem, 69695bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -103,9 +103,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -283,34 +283,34 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x7d8"}true; + assume {:captureState "%000008d2"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x7d8"}true; + assume {:captureState "%000008d8"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2024bv64, true; call malloc(); goto l000008ed; l000008ed: - assume {:captureState "addr:0x7e8"}true; + assume {:captureState "addr:l000008ed"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x7e8"}true; + assume {:captureState "%000008f3"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := 1bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x7f4"}true; + assume {:captureState "%00000907"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R30, Gamma_R30 := 2048bv64, true; call #free(); goto l00000918; l00000918: - assume {:captureState "addr:0x800"}true; + assume {:captureState "addr:l00000918"} true; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); diff --git a/src/test/correct/basicfree/clang_pic/basicfree.expected b/src/test/correct/basicfree/clang_pic/basicfree.expected index 4e90916c5..0cbefca5a 100644 --- a/src/test/correct/basicfree/clang_pic/basicfree.expected +++ b/src/test/correct/basicfree/clang_pic/basicfree.expected @@ -1,59 +1,59 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2080bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2080bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -94,7 +94,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69694bv64) == 0bv8); free ensures (memory_load8_le(mem, 69695bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -103,9 +103,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -283,34 +283,34 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x7d8"}true; + assume {:captureState "%000008d2"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x7d8"}true; + assume {:captureState "%000008d8"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2024bv64, true; call malloc(); goto l000008ed; l000008ed: - assume {:captureState "addr:0x7e8"}true; + assume {:captureState "addr:l000008ed"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x7e8"}true; + assume {:captureState "%000008f3"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := 1bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x7f4"}true; + assume {:captureState "%00000907"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R30, Gamma_R30 := 2048bv64, true; call #free(); goto l00000918; l00000918: - assume {:captureState "addr:0x800"}true; + assume {:captureState "addr:l00000918"} true; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#5, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#5, 8bv64)); diff --git a/src/test/correct/basicfree/gcc/basicfree.expected b/src/test/correct/basicfree/gcc/basicfree.expected index 1ed12b672..dfa99df58 100644 --- a/src/test/correct/basicfree/gcc/basicfree.expected +++ b/src/test/correct/basicfree/gcc/basicfree.expected @@ -1,57 +1,57 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2076bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2076bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -92,7 +92,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -101,9 +101,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -279,12 +279,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "%000002e8"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "%000002ee"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 4bv64, true; @@ -292,21 +292,21 @@ procedure main() call malloc(); goto l00000307; l00000307: - assume {:captureState "addr:0x7e4"}true; + assume {:captureState "addr:l00000307"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 24bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x7e4"}true; + assume {:captureState "%0000030d"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R1, Gamma_R1 := 1bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x7f0"}true; + assume {:captureState "%00000321"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R30, Gamma_R30 := 2044bv64, true; call #free(); goto l00000332; l00000332: - assume {:captureState "addr:0x7fc"}true; + assume {:captureState "addr:l00000332"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; diff --git a/src/test/correct/basicfree/gcc_O2/basicfree.expected b/src/test/correct/basicfree/gcc_O2/basicfree.expected index cf806e8fd..9c7036705 100644 --- a/src/test/correct/basicfree/gcc_O2/basicfree.expected +++ b/src/test/correct/basicfree/gcc_O2/basicfree.expected @@ -1,12 +1,12 @@ -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1896bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1896bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -47,7 +47,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -56,9 +56,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -152,6 +152,6 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; return; } diff --git a/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree.expected b/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree.expected index 220da675a..10bf388a9 100644 --- a/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree.expected +++ b/src/test/correct/basicfree/gcc_no_plt_no_pic/basicfree.expected @@ -1,57 +1,57 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2076bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2076bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -92,7 +92,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -101,9 +101,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -279,12 +279,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "%000008bd"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "%000008c3"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 4bv64, true; @@ -292,21 +292,21 @@ procedure main() call malloc(); goto l000008dc; l000008dc: - assume {:captureState "addr:0x7e4"}true; + assume {:captureState "addr:l000008dc"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 24bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x7e4"}true; + assume {:captureState "%000008e2"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R1, Gamma_R1 := 1bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x7f0"}true; + assume {:captureState "%000008f6"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R30, Gamma_R30 := 2044bv64, true; call #free(); goto l00000907; l00000907: - assume {:captureState "addr:0x7fc"}true; + assume {:captureState "addr:l00000907"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; diff --git a/src/test/correct/basicfree/gcc_pic/basicfree.expected b/src/test/correct/basicfree/gcc_pic/basicfree.expected index 220da675a..10bf388a9 100644 --- a/src/test/correct/basicfree/gcc_pic/basicfree.expected +++ b/src/test/correct/basicfree/gcc_pic/basicfree.expected @@ -1,57 +1,57 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2076bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2076bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -92,7 +92,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -101,9 +101,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -279,12 +279,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "%000008bd"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x7d4"}true; + assume {:captureState "%000008c3"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 4bv64, true; @@ -292,21 +292,21 @@ procedure main() call malloc(); goto l000008dc; l000008dc: - assume {:captureState "addr:0x7e4"}true; + assume {:captureState "addr:l000008dc"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 24bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x7e4"}true; + assume {:captureState "%000008e2"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R1, Gamma_R1 := 1bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x7f0"}true; + assume {:captureState "%000008f6"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R30, Gamma_R30 := 2044bv64, true; call #free(); goto l00000907; l00000907: - assume {:captureState "addr:0x7fc"}true; + assume {:captureState "addr:l00000907"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; diff --git a/src/test/correct/cjump/clang/cjump.expected b/src/test/correct/cjump/clang/cjump.expected index 03f893ccf..8e118cae7 100644 --- a/src/test/correct/cjump/clang/cjump.expected +++ b/src/test/correct/cjump/clang/cjump.expected @@ -1,54 +1,54 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -89,7 +89,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -98,9 +98,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -209,16 +209,16 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000309"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 1bv64, true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000031b"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; @@ -245,28 +245,28 @@ procedure main() } goto l0000037e; l00000351: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l00000351"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 2bv64, true; call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%00000366"} true; goto l00000369; l0000037e: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l0000037e"} true; goto l0000037f; l0000037f: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l0000037f"} true; R8, Gamma_R8 := 3bv64, true; R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%00000392"} true; goto l00000369; l00000369: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l00000369"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/cjump/clang_O2/cjump.expected b/src/test/correct/cjump/clang_O2/cjump.expected index b975a33e5..34ba4ea5d 100644 --- a/src/test/correct/cjump/clang_O2/cjump.expected +++ b/src/test/correct/cjump/clang_O2/cjump.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R11: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R11: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R11: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R11: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -85,9 +85,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -184,7 +184,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 1bv64, true; @@ -193,10 +193,10 @@ procedure main() call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000002e9"} true; call rely(); assert (L(mem, bvadd64(R10, 56bv64)) ==> Gamma_R11); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R10, 56bv64), R11[32:0]), gamma_store32(Gamma_mem, bvadd64(R10, 56bv64), Gamma_R11); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000002f1"} true; return; } diff --git a/src/test/correct/cjump/clang_no_plt_no_pic/cjump.expected b/src/test/correct/cjump/clang_no_plt_no_pic/cjump.expected index 0ab319383..facdc706e 100644 --- a/src/test/correct/cjump/clang_no_plt_no_pic/cjump.expected +++ b/src/test/correct/cjump/clang_no_plt_no_pic/cjump.expected @@ -1,54 +1,54 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -89,7 +89,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -98,9 +98,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -209,16 +209,16 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%0000095f"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 1bv64, true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000971"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; @@ -245,28 +245,28 @@ procedure main() } goto l000009d4; l000009a7: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l000009a7"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 2bv64, true; call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000009bc"} true; goto l000009bf; l000009d4: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l000009d4"} true; goto l000009d5; l000009d5: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l000009d5"} true; R8, Gamma_R8 := 3bv64, true; R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%000009e8"} true; goto l000009bf; l000009bf: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l000009bf"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/cjump/clang_pic/cjump.expected b/src/test/correct/cjump/clang_pic/cjump.expected index 37fb79cb2..e166fd0e8 100644 --- a/src/test/correct/cjump/clang_pic/cjump.expected +++ b/src/test/correct/cjump/clang_pic/cjump.expected @@ -1,62 +1,62 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -113,7 +113,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -122,9 +122,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -265,10 +265,10 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000315"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4032bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4032bv64)) || L(mem, bvadd64(R8, 4032bv64))); @@ -276,7 +276,7 @@ procedure main() call rely(); assert (L(mem, R8) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, R8, R9[32:0]), gamma_store32(Gamma_mem, R8, Gamma_R9); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%0000032e"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; @@ -303,7 +303,7 @@ procedure main() } goto l00000398; l00000364: - assume {:captureState "addr:0x794"}true; + assume {:captureState "addr:l00000364"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4048bv64)) || L(mem, bvadd64(R9, 4048bv64))); @@ -311,13 +311,13 @@ procedure main() call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x7a0"}true; + assume {:captureState "%00000380"} true; goto l00000383; l00000398: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l00000398"} true; goto l00000399; l00000399: - assume {:captureState "addr:0x780"}true; + assume {:captureState "addr:l00000399"} true; R8, Gamma_R8 := 3bv64, true; R9, Gamma_R9 := 65536bv64, true; call rely(); @@ -325,10 +325,10 @@ procedure main() call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x78c"}true; + assume {:captureState "%000003b3"} true; goto l00000383; l00000383: - assume {:captureState "addr:0x7a8"}true; + assume {:captureState "addr:l00000383"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/cjump/gcc/cjump.expected b/src/test/correct/cjump/gcc/cjump.expected index 8944ce29e..285553345 100644 --- a/src/test/correct/cjump/gcc/cjump.expected +++ b/src/test/correct/cjump/gcc/cjump.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -92,9 +92,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -201,14 +201,14 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000310"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -224,27 +224,27 @@ procedure main() } goto l00000365; l0000033e: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l0000033e"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 2bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000359"} true; goto l0000035b; l00000365: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000365"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 3bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%0000037b"} true; goto l0000035b; l0000035b: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l0000035b"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/cjump/gcc_O2/cjump.expected b/src/test/correct/cjump/gcc_O2/cjump.expected index d28e04d56..50db70672 100644 --- a/src/test/correct/cjump/gcc_O2/cjump.expected +++ b/src/test/correct/cjump/gcc_O2/cjump.expected @@ -1,39 +1,39 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R3: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }R3: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R3: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } R3: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -74,7 +74,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -83,9 +83,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -182,7 +182,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R1, Gamma_R1 := bvadd64(R0, 20bv64), Gamma_R0; R3, Gamma_R3 := 1bv64, true; @@ -190,11 +190,11 @@ procedure main() call rely(); assert (L(mem, bvadd64(R0, 20bv64)) ==> Gamma_R3); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R0, 20bv64), R3[32:0]), gamma_store32(Gamma_mem, bvadd64(R0, 20bv64), Gamma_R3); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001c3"} true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, bvadd64(R1, 4bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 4bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 4bv64), Gamma_R2); - assume {:captureState "addr:0x618"}true; + assume {:captureState "%000001d0"} true; return; } diff --git a/src/test/correct/cjump/gcc_no_plt_no_pic/cjump.expected b/src/test/correct/cjump/gcc_no_plt_no_pic/cjump.expected index 34a1bd1d7..8cd715879 100644 --- a/src/test/correct/cjump/gcc_no_plt_no_pic/cjump.expected +++ b/src/test/correct/cjump/gcc_no_plt_no_pic/cjump.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -92,9 +92,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -201,14 +201,14 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000094e"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -224,27 +224,27 @@ procedure main() } goto l000009a3; l0000097c: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l0000097c"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 2bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000997"} true; goto l00000999; l000009a3: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l000009a3"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 3bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%000009b9"} true; goto l00000999; l00000999: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l00000999"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/cjump/gcc_pic/cjump.expected b/src/test/correct/cjump/gcc_pic/cjump.expected index 63ccf118d..b18dd05e0 100644 --- a/src/test/correct/cjump/gcc_pic/cjump.expected +++ b/src/test/correct/cjump/gcc_pic/cjump.expected @@ -1,56 +1,56 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -107,7 +107,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -116,9 +116,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -257,7 +257,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -265,7 +265,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000311"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -282,7 +282,7 @@ procedure main() } goto l00000368; l00000340: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l00000340"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); @@ -290,10 +290,10 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x798"}true; + assume {:captureState "%0000035c"} true; goto l0000035e; l00000368: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l00000368"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); @@ -301,10 +301,10 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%0000037f"} true; goto l0000035e; l0000035e: - assume {:captureState "addr:0x79c"}true; + assume {:captureState "addr:l0000035e"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/function/clang/function.expected b/src/test/correct/function/clang/function.expected index afdf8432e..398b77936 100644 --- a/src/test/correct/function/clang/function.expected +++ b/src/test/correct/function/clang/function.expected @@ -1,61 +1,61 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -96,7 +96,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -105,9 +105,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -187,7 +187,7 @@ procedure get_two() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:lget_two"} true; R0, Gamma_R0 := 2bv64, true; return; } @@ -292,12 +292,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%000008db"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%000008e1"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R9, Gamma_R9 := 69632bv64, true; @@ -305,17 +305,17 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 52bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000008fd"} true; R30, Gamma_R30 := 1836bv64, true; call get_two(); goto l00000910; l00000910: - assume {:captureState "addr:0x72c"}true; + assume {:captureState "addr:l00000910"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), Gamma_R0); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%0000091b"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function/clang_O2/function.expected b/src/test/correct/function/clang_O2/function.expected index 139696a65..352903a5b 100644 --- a/src/test/correct/function/clang_O2/function.expected +++ b/src/test/correct/function/clang_O2/function.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R11: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R11: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R11: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R11: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -85,9 +85,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -184,7 +184,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 1bv64, true; @@ -193,10 +193,10 @@ procedure main() call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000002f1"} true; call rely(); assert (L(mem, bvadd64(R10, 56bv64)) ==> Gamma_R11); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R10, 56bv64), R11[32:0]), gamma_store32(Gamma_mem, bvadd64(R10, 56bv64), Gamma_R11); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000002f9"} true; return; } diff --git a/src/test/correct/function/clang_no_plt_no_pic/function.expected b/src/test/correct/function/clang_no_plt_no_pic/function.expected index afdf8432e..398b77936 100644 --- a/src/test/correct/function/clang_no_plt_no_pic/function.expected +++ b/src/test/correct/function/clang_no_plt_no_pic/function.expected @@ -1,61 +1,61 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -96,7 +96,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -105,9 +105,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -187,7 +187,7 @@ procedure get_two() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:lget_two"} true; R0, Gamma_R0 := 2bv64, true; return; } @@ -292,12 +292,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%000008db"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%000008e1"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R9, Gamma_R9 := 69632bv64, true; @@ -305,17 +305,17 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 52bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000008fd"} true; R30, Gamma_R30 := 1836bv64, true; call get_two(); goto l00000910; l00000910: - assume {:captureState "addr:0x72c"}true; + assume {:captureState "addr:l00000910"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), Gamma_R0); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%0000091b"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function/clang_pic/function.expected b/src/test/correct/function/clang_pic/function.expected index 15b648d0a..ba84e8c55 100644 --- a/src/test/correct/function/clang_pic/function.expected +++ b/src/test/correct/function/clang_pic/function.expected @@ -1,61 +1,61 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -112,7 +112,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -121,9 +121,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -235,7 +235,7 @@ procedure get_two() free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x788"}true; + assume {:captureState "addr:lget_two"} true; R0, Gamma_R0 := 2bv64, true; return; } @@ -372,12 +372,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002f0"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002f6"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R9, Gamma_R9 := 65536bv64, true; @@ -387,19 +387,19 @@ procedure main() call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000319"} true; R30, Gamma_R30 := 1904bv64, true; call get_two(); goto l0000032c; l0000032c: - assume {:captureState "addr:0x770"}true; + assume {:captureState "addr:l0000032c"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4048bv64)) || L(mem, bvadd64(R8, 4048bv64))); call rely(); assert (L(mem, R8) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, R8, R0[32:0]), gamma_store32(Gamma_mem, R8, Gamma_R0); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%0000033e"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function/gcc/function.expected b/src/test/correct/function/gcc/function.expected index 951db16a2..7d4e83549 100644 --- a/src/test/correct/function/gcc/function.expected +++ b/src/test/correct/function/gcc/function.expected @@ -1,60 +1,60 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -95,7 +95,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -104,9 +104,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -186,7 +186,7 @@ procedure get_two() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:lget_two"} true; R0, Gamma_R0 := 2bv64, true; return; } @@ -291,12 +291,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%0000090b"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%00000911"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 69632bv64, true; @@ -305,19 +305,19 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000933"} true; R30, Gamma_R30 := 1840bv64, true; call get_two(); goto l00000946; l00000946: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000946"} true; R1, Gamma_R1 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%0000095d"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function/gcc_O2/function.expected b/src/test/correct/function/gcc_O2/function.expected index e26bc9c95..d08cc3d3b 100644 --- a/src/test/correct/function/gcc_O2/function.expected +++ b/src/test/correct/function/gcc_O2/function.expected @@ -1,39 +1,39 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R3: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }R3: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R3: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } R3: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -74,7 +74,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -83,9 +83,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -182,7 +182,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R1, Gamma_R1 := bvadd64(R0, 20bv64), Gamma_R0; R3, Gamma_R3 := 1bv64, true; @@ -190,11 +190,11 @@ procedure main() call rely(); assert (L(mem, bvadd64(R0, 20bv64)) ==> Gamma_R3); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R0, 20bv64), R3[32:0]), gamma_store32(Gamma_mem, bvadd64(R0, 20bv64), Gamma_R3); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001d7"} true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, bvadd64(R1, 4bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 4bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 4bv64), Gamma_R2); - assume {:captureState "addr:0x618"}true; + assume {:captureState "%000001e4"} true; return; } diff --git a/src/test/correct/function/gcc_no_plt_no_pic/function.expected b/src/test/correct/function/gcc_no_plt_no_pic/function.expected index 951db16a2..7d4e83549 100644 --- a/src/test/correct/function/gcc_no_plt_no_pic/function.expected +++ b/src/test/correct/function/gcc_no_plt_no_pic/function.expected @@ -1,60 +1,60 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -95,7 +95,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -104,9 +104,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -186,7 +186,7 @@ procedure get_two() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:lget_two"} true; R0, Gamma_R0 := 2bv64, true; return; } @@ -291,12 +291,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%0000090b"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%00000911"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 69632bv64, true; @@ -305,19 +305,19 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000933"} true; R30, Gamma_R30 := 1840bv64, true; call get_two(); goto l00000946; l00000946: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000946"} true; R1, Gamma_R1 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%0000095d"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function/gcc_pic/function.expected b/src/test/correct/function/gcc_pic/function.expected index b3b5058bf..e53787b44 100644 --- a/src/test/correct/function/gcc_pic/function.expected +++ b/src/test/correct/function/gcc_pic/function.expected @@ -1,60 +1,60 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -111,7 +111,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -120,9 +120,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -234,7 +234,7 @@ procedure get_two() free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:lget_two"} true; R0, Gamma_R0 := 2bv64, true; return; } @@ -371,12 +371,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002f4"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002fa"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 65536bv64, true; @@ -386,12 +386,12 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%0000031d"} true; R30, Gamma_R30 := 1904bv64, true; call get_two(); goto l00000330; l00000330: - assume {:captureState "addr:0x770"}true; + assume {:captureState "addr:l00000330"} true; R1, Gamma_R1 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 65536bv64, true; call rely(); @@ -399,7 +399,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x77c"}true; + assume {:captureState "%00000348"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function1/clang/function1.expected b/src/test/correct/function1/clang/function1.expected index 0c2443f8d..0add677c0 100644 --- a/src/test/correct/function1/clang/function1.expected +++ b/src/test/correct/function1/clang/function1.expected @@ -1,91 +1,91 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R2: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2024bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69692bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69696bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R2: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2024bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69692bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69696bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "sign_extend 32"}sign_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 32"} sign_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -130,7 +130,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69686bv64) == 0bv8); free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -139,9 +139,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -230,14 +230,14 @@ procedure get_two() free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lget_two"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000336"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R1[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R1); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%0000033e"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R2), gamma_store64(Gamma_stack, R31, Gamma_R2); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000346"} true; R8, Gamma_R8 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R9, Gamma_R9 := zero_extend32_32(bvadd32(R8[32:0], R9[32:0])), (Gamma_R9 && Gamma_R8); @@ -354,12 +354,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%00000386"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%0000038c"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R9, Gamma_R9 := 69632bv64, true; @@ -367,7 +367,7 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 60bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 60bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 60bv64), Gamma_R8); - assume {:captureState "addr:0x794"}true; + assume {:captureState "%000003a8"} true; R0, Gamma_R0 := 97bv64, true; R1, Gamma_R1 := 10bv64, true; R2, Gamma_R2 := 58368bv64, true; @@ -377,12 +377,12 @@ procedure main() call get_two(); goto l000003ce; l000003ce: - assume {:captureState "addr:0x7b0"}true; + assume {:captureState "addr:l000003ce"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 64bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 64bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 64bv64), Gamma_R0); - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "%000003d9"} true; call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 64bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 64bv64)) || L(mem, bvadd64(R8, 64bv64))); R0, Gamma_R0 := 0bv64, true; @@ -391,7 +391,7 @@ procedure main() call printf(); goto l000003f5; l000003f5: - assume {:captureState "addr:0x7c8"}true; + assume {:captureState "addr:l000003f5"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function1/clang_O2/function1.expected b/src/test/correct/function1/clang_O2/function1.expected index 4bc9567ef..74f09f520 100644 --- a/src/test/correct/function1/clang_O2/function1.expected +++ b/src/test/correct/function1/clang_O2/function1.expected @@ -1,70 +1,70 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R11: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R10: bv64; -var {:extern }R11: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1976bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69692bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69696bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R11: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R10: bv64; +var {:extern } R11: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1976bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69692bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69696bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -109,7 +109,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69686bv64) == 0bv8); free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -118,9 +118,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -229,12 +229,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x760"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000317"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%0000031d"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R11, Gamma_R11 := 58475bv64, true; @@ -249,16 +249,16 @@ procedure main() call rely(); assert (L(mem, bvadd64(R8, 60bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 60bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 60bv64), Gamma_R9); - assume {:captureState "addr:0x78c"}true; + assume {:captureState "%0000035f"} true; call rely(); assert (L(mem, bvadd64(R10, 64bv64)) ==> Gamma_R11); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R10, 64bv64), R11[32:0]), gamma_store32(Gamma_mem, bvadd64(R10, 64bv64), Gamma_R11); - assume {:captureState "addr:0x790"}true; + assume {:captureState "%00000367"} true; R30, Gamma_R30 := 1944bv64, true; call printf(); goto l00000371; l00000371: - assume {:captureState "addr:0x798"}true; + assume {:captureState "addr:l00000371"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function1/clang_no_plt_no_pic/function1.expected b/src/test/correct/function1/clang_no_plt_no_pic/function1.expected index c3e2bcfc6..5b4c159e3 100644 --- a/src/test/correct/function1/clang_no_plt_no_pic/function1.expected +++ b/src/test/correct/function1/clang_no_plt_no_pic/function1.expected @@ -1,91 +1,91 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R2: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2024bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69692bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69696bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R2: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2024bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69692bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69696bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "sign_extend 32"}sign_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 32"} sign_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -130,7 +130,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69686bv64) == 0bv8); free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -139,9 +139,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -230,14 +230,14 @@ procedure get_two() free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lget_two"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000a47"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R1[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R1); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%00000a4f"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R2), gamma_store64(Gamma_stack, R31, Gamma_R2); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000a57"} true; R8, Gamma_R8 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R9, Gamma_R9 := zero_extend32_32(bvadd32(R8[32:0], R9[32:0])), (Gamma_R9 && Gamma_R8); @@ -354,12 +354,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%00000a97"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%00000a9d"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R9, Gamma_R9 := 69632bv64, true; @@ -367,7 +367,7 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 60bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 60bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 60bv64), Gamma_R8); - assume {:captureState "addr:0x794"}true; + assume {:captureState "%00000ab9"} true; R0, Gamma_R0 := 97bv64, true; R1, Gamma_R1 := 10bv64, true; R2, Gamma_R2 := 58368bv64, true; @@ -377,12 +377,12 @@ procedure main() call get_two(); goto l00000adf; l00000adf: - assume {:captureState "addr:0x7b0"}true; + assume {:captureState "addr:l00000adf"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 64bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 64bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 64bv64), Gamma_R0); - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "%00000aea"} true; call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 64bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 64bv64)) || L(mem, bvadd64(R8, 64bv64))); R0, Gamma_R0 := 0bv64, true; @@ -391,7 +391,7 @@ procedure main() call printf(); goto l00000b06; l00000b06: - assume {:captureState "addr:0x7c8"}true; + assume {:captureState "addr:l00000b06"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function1/clang_pic/function1.expected b/src/test/correct/function1/clang_pic/function1.expected index 2b0501aad..b44421cc6 100644 --- a/src/test/correct/function1/clang_pic/function1.expected +++ b/src/test/correct/function1/clang_pic/function1.expected @@ -1,91 +1,91 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R2: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2096bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69692bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69696bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R2: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2096bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69692bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69696bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "sign_extend 32"}sign_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 32"} sign_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -146,7 +146,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69590bv64) == 0bv8); free ensures (memory_load8_le(mem, 69591bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -155,9 +155,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -278,14 +278,14 @@ procedure get_two() free ensures (memory_load8_le(mem, 69591bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x794"}true; + assume {:captureState "addr:lget_two"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x798"}true; + assume {:captureState "%0000033e"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R1[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R1); - assume {:captureState "addr:0x79c"}true; + assume {:captureState "%00000346"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R2), gamma_store64(Gamma_stack, R31, Gamma_R2); - assume {:captureState "addr:0x7a0"}true; + assume {:captureState "%0000034e"} true; R8, Gamma_R8 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R9, Gamma_R9 := zero_extend32_32(bvadd32(R8[32:0], R9[32:0])), (Gamma_R9 && Gamma_R8); @@ -434,12 +434,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x7c4"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x7c4"}true; + assume {:captureState "%0000038e"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x7c4"}true; + assume {:captureState "%00000394"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R9, Gamma_R9 := 65536bv64, true; @@ -449,7 +449,7 @@ procedure main() call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x7d8"}true; + assume {:captureState "%000003b7"} true; R0, Gamma_R0 := 97bv64, true; R1, Gamma_R1 := 10bv64, true; R2, Gamma_R2 := 58368bv64, true; @@ -459,14 +459,14 @@ procedure main() call get_two(); goto l000003dd; l000003dd: - assume {:captureState "addr:0x7f4"}true; + assume {:captureState "addr:l000003dd"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4048bv64)) || L(mem, bvadd64(R8, 4048bv64))); call rely(); assert (L(mem, R8) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, R8, R0[32:0]), gamma_store32(Gamma_mem, R8, Gamma_R0); - assume {:captureState "addr:0x7fc"}true; + assume {:captureState "%000003ef"} true; call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); R0, Gamma_R0 := 0bv64, true; @@ -475,7 +475,7 @@ procedure main() call printf(); goto l0000040b; l0000040b: - assume {:captureState "addr:0x810"}true; + assume {:captureState "addr:l0000040b"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function1/gcc/function1.expected b/src/test/correct/function1/gcc/function1.expected index 4d0681d0c..4f9f2bc7c 100644 --- a/src/test/correct/function1/gcc/function1.expected +++ b/src/test/correct/function1/gcc/function1.expected @@ -1,86 +1,86 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R2: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2048bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R2: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2048bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -129,7 +129,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -138,9 +138,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -237,14 +237,14 @@ procedure get_two() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lget_two"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%0000034e"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R1[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R1); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%00000356"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R2), gamma_store64(Gamma_stack, R31, Gamma_R2); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%0000035e"} true; R1, Gamma_R1 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); @@ -369,12 +369,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%0000039e"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%000003a4"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 69632bv64, true; @@ -383,7 +383,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x798"}true; + assume {:captureState "%000003c6"} true; R2, Gamma_R2 := 58368bv64, true; R2, Gamma_R2 := (R2[64:32] ++ (21515bv16 ++ R2[16:0])), Gamma_R2; R2, Gamma_R2 := (R2[64:48] ++ (2bv16 ++ R2[32:0])), Gamma_R2; @@ -393,14 +393,14 @@ procedure main() call get_two(); goto l000003ec; l000003ec: - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "addr:l000003ec"} true; R1, Gamma_R1 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "%00000403"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -412,7 +412,7 @@ procedure main() call printf(); goto l00000430; l00000430: - assume {:captureState "addr:0x7e0"}true; + assume {:captureState "addr:l00000430"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function1/gcc_O2/function1.expected b/src/test/correct/function1/gcc_O2/function1.expected index 64d3bc49f..2e492384e 100644 --- a/src/test/correct/function1/gcc_O2/function1.expected +++ b/src/test/correct/function1/gcc_O2/function1.expected @@ -1,66 +1,66 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R3: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R2: bv64; -var {:extern }R29: bv64; -var {:extern }R3: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2048bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R3: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R2: bv64; +var {:extern } R29: bv64; +var {:extern } R3: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2048bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -109,7 +109,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -118,9 +118,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure __printf_chk(); @@ -328,12 +328,12 @@ procedure main() var #1: bv64; var Gamma_#1: bool; lmain: - assume {:captureState "addr:0x680"}true; + assume {:captureState "addr:lmain"} true; #1, Gamma_#1 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #1, R29), gamma_store64(Gamma_stack, #1, Gamma_R29); - assume {:captureState "addr:0x680"}true; + assume {:captureState "%000001ca"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#1, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#1, 8bv64), Gamma_R30); - assume {:captureState "addr:0x680"}true; + assume {:captureState "%000001d0"} true; R31, Gamma_R31 := #1, Gamma_#1; R1, Gamma_R1 := 69632bv64, true; R3, Gamma_R3 := bvadd64(R1, 20bv64), Gamma_R1; @@ -344,18 +344,18 @@ procedure main() call rely(); assert (L(mem, bvadd64(R1, 20bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R0); - assume {:captureState "addr:0x69c"}true; + assume {:captureState "%000001fd"} true; R1, Gamma_R1 := 0bv64, true; R1, Gamma_R1 := bvadd64(R1, 2056bv64), Gamma_R1; call rely(); assert (L(mem, bvadd64(R3, 4bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R3, 4bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R3, 4bv64), Gamma_R2); - assume {:captureState "addr:0x6a8"}true; + assume {:captureState "%00000210"} true; R30, Gamma_R30 := 1712bv64, true; call __printf_chk(); goto l0000021a; l0000021a: - assume {:captureState "addr:0x6b0"}true; + assume {:captureState "addr:l0000021a"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function1/gcc_no_plt_no_pic/function1.expected b/src/test/correct/function1/gcc_no_plt_no_pic/function1.expected index 8ae339712..1a5d7358f 100644 --- a/src/test/correct/function1/gcc_no_plt_no_pic/function1.expected +++ b/src/test/correct/function1/gcc_no_plt_no_pic/function1.expected @@ -1,86 +1,86 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R2: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2048bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R2: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2048bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -129,7 +129,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -138,9 +138,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -237,14 +237,14 @@ procedure get_two() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lget_two"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000aa6"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R1[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R1); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%00000aae"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R2), gamma_store64(Gamma_stack, R31, Gamma_R2); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000ab6"} true; R1, Gamma_R1 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); @@ -369,12 +369,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%00000af6"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%00000afc"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 69632bv64, true; @@ -383,7 +383,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x798"}true; + assume {:captureState "%00000b1e"} true; R2, Gamma_R2 := 58368bv64, true; R2, Gamma_R2 := (R2[64:32] ++ (21515bv16 ++ R2[16:0])), Gamma_R2; R2, Gamma_R2 := (R2[64:48] ++ (2bv16 ++ R2[32:0])), Gamma_R2; @@ -393,14 +393,14 @@ procedure main() call get_two(); goto l00000b44; l00000b44: - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "addr:l00000b44"} true; R1, Gamma_R1 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "%00000b5b"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -412,7 +412,7 @@ procedure main() call printf(); goto l00000b88; l00000b88: - assume {:captureState "addr:0x7e0"}true; + assume {:captureState "addr:l00000b88"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/function1/gcc_pic/function1.expected b/src/test/correct/function1/gcc_pic/function1.expected index 07a8d8148..25885ad0b 100644 --- a/src/test/correct/function1/gcc_pic/function1.expected +++ b/src/test/correct/function1/gcc_pic/function1.expected @@ -1,86 +1,86 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R2: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2112bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R2: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2112bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -145,7 +145,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 68998bv64) == 0bv8); free ensures (memory_load8_le(mem, 68999bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -154,9 +154,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure get_two() @@ -285,14 +285,14 @@ procedure get_two() free ensures (memory_load8_le(mem, 68999bv64) == 0bv8); { lget_two: - assume {:captureState "addr:0x794"}true; + assume {:captureState "addr:lget_two"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x798"}true; + assume {:captureState "%0000034e"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R1[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R1); - assume {:captureState "addr:0x79c"}true; + assume {:captureState "%00000356"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R2), gamma_store64(Gamma_stack, R31, Gamma_R2); - assume {:captureState "addr:0x7a0"}true; + assume {:captureState "%0000035e"} true; R1, Gamma_R1 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R1[32:0], R0[32:0])), (Gamma_R0 && Gamma_R1); @@ -449,12 +449,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x7c4"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x7c4"}true; + assume {:captureState "%0000039e"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x7c4"}true; + assume {:captureState "%000003a4"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 65536bv64, true; @@ -464,7 +464,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x7d8"}true; + assume {:captureState "%000003c7"} true; R2, Gamma_R2 := 58368bv64, true; R2, Gamma_R2 := (R2[64:32] ++ (21515bv16 ++ R2[16:0])), Gamma_R2; R2, Gamma_R2 := (R2[64:48] ++ (2bv16 ++ R2[32:0])), Gamma_R2; @@ -474,7 +474,7 @@ procedure main() call get_two(); goto l000003ed; l000003ed: - assume {:captureState "addr:0x7f4"}true; + assume {:captureState "addr:l000003ed"} true; R1, Gamma_R1 := zero_extend32_32(R0[32:0]), Gamma_R0; R0, Gamma_R0 := 65536bv64, true; call rely(); @@ -482,7 +482,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x800"}true; + assume {:captureState "%00000405"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); @@ -495,7 +495,7 @@ procedure main() call printf(); goto l00000433; l00000433: - assume {:captureState "addr:0x820"}true; + assume {:captureState "addr:l00000433"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/functions_with_params/clang/functions_with_params.expected b/src/test/correct/functions_with_params/clang/functions_with_params.expected index a1321a395..dc31bec22 100644 --- a/src/test/correct/functions_with_params/clang/functions_with_params.expected +++ b/src/test/correct/functions_with_params/clang/functions_with_params.expected @@ -1,59 +1,59 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1912bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1912bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -94,7 +94,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -103,9 +103,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -208,28 +208,28 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%0000030a"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000310"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000323"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%00000330"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R29, 18446744073709551612bv64))), gamma_load32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64)); R30, Gamma_R30 := 1848bv64, true; call plus_one(); goto l00000366; l00000366: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000366"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), Gamma_R0); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000036c"} true; R0, Gamma_R0 := 0bv64, true; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); @@ -316,10 +316,10 @@ procedure plus_one() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lplus_one: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:lplus_one"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x750"}true; + assume {:captureState "%0000034c"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; diff --git a/src/test/correct/functions_with_params/clang_O2/functions_with_params.expected b/src/test/correct/functions_with_params/clang_O2/functions_with_params.expected index bbebaae99..0c551beb5 100644 --- a/src/test/correct/functions_with_params/clang_O2/functions_with_params.expected +++ b/src/test/correct/functions_with_params/clang_O2/functions_with_params.expected @@ -1,14 +1,14 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1848bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1848bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -49,7 +49,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -58,9 +58,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -155,7 +155,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params.expected b/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params.expected index df53564d3..cc5c96c31 100644 --- a/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params.expected +++ b/src/test/correct/functions_with_params/clang_no_plt_no_pic/functions_with_params.expected @@ -1,59 +1,59 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1912bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1912bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -94,7 +94,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -103,9 +103,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -208,28 +208,28 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000955"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%0000095b"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000096e"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%0000097b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R29, 18446744073709551612bv64))), gamma_load32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64)); R30, Gamma_R30 := 1848bv64, true; call plus_one(); goto l000009b1; l000009b1: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l000009b1"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), Gamma_R0); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%000009b7"} true; R0, Gamma_R0 := 0bv64, true; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); @@ -316,10 +316,10 @@ procedure plus_one() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lplus_one: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:lplus_one"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x750"}true; + assume {:captureState "%00000997"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; diff --git a/src/test/correct/functions_with_params/clang_pic/functions_with_params.expected b/src/test/correct/functions_with_params/clang_pic/functions_with_params.expected index df53564d3..cc5c96c31 100644 --- a/src/test/correct/functions_with_params/clang_pic/functions_with_params.expected +++ b/src/test/correct/functions_with_params/clang_pic/functions_with_params.expected @@ -1,59 +1,59 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1912bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1912bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -94,7 +94,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -103,9 +103,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -208,28 +208,28 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000955"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%0000095b"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000096e"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%0000097b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R29, 18446744073709551612bv64))), gamma_load32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64)); R30, Gamma_R30 := 1848bv64, true; call plus_one(); goto l000009b1; l000009b1: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l000009b1"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), Gamma_R0); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%000009b7"} true; R0, Gamma_R0 := 0bv64, true; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); @@ -316,10 +316,10 @@ procedure plus_one() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lplus_one: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:lplus_one"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x750"}true; + assume {:captureState "%00000997"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; diff --git a/src/test/correct/functions_with_params/gcc/functions_with_params.expected b/src/test/correct/functions_with_params/gcc/functions_with_params.expected index 22c8d80c9..e727d786d 100644 --- a/src/test/correct/functions_with_params/gcc/functions_with_params.expected +++ b/src/test/correct/functions_with_params/gcc/functions_with_params.expected @@ -1,57 +1,57 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1904bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1904bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -92,7 +92,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -101,9 +101,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -204,28 +204,28 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%000002fc"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%00000302"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000319"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000326"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); R30, Gamma_R30 := 1844bv64, true; call plus_one(); goto l0000035c; l0000035c: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l0000035c"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000362"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); @@ -311,10 +311,10 @@ procedure plus_one() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lplus_one: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:lplus_one"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000342"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 1bv32)), Gamma_R0; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; diff --git a/src/test/correct/functions_with_params/gcc_O2/functions_with_params.expected b/src/test/correct/functions_with_params/gcc_O2/functions_with_params.expected index 4fa6efe6f..b838106e7 100644 --- a/src/test/correct/functions_with_params/gcc_O2/functions_with_params.expected +++ b/src/test/correct/functions_with_params/gcc_O2/functions_with_params.expected @@ -1,14 +1,14 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1916bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1916bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -49,7 +49,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -58,9 +58,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -155,7 +155,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params.expected b/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params.expected index aadc1fe40..b149ec3d5 100644 --- a/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params.expected +++ b/src/test/correct/functions_with_params/gcc_no_plt_no_pic/functions_with_params.expected @@ -1,57 +1,57 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1904bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1904bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -92,7 +92,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -101,9 +101,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -204,28 +204,28 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%00000933"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%00000939"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000950"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000095d"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); R30, Gamma_R30 := 1844bv64, true; call plus_one(); goto l00000993; l00000993: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l00000993"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000999"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); @@ -311,10 +311,10 @@ procedure plus_one() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lplus_one: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:lplus_one"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000979"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 1bv32)), Gamma_R0; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; diff --git a/src/test/correct/functions_with_params/gcc_pic/functions_with_params.expected b/src/test/correct/functions_with_params/gcc_pic/functions_with_params.expected index aadc1fe40..b149ec3d5 100644 --- a/src/test/correct/functions_with_params/gcc_pic/functions_with_params.expected +++ b/src/test/correct/functions_with_params/gcc_pic/functions_with_params.expected @@ -1,57 +1,57 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1904bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1904bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -92,7 +92,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -101,9 +101,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -204,28 +204,28 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%00000933"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x714"}true; + assume {:captureState "%00000939"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000950"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000095d"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); R30, Gamma_R30 := 1844bv64, true; call plus_one(); goto l00000993; l00000993: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l00000993"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000999"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); @@ -311,10 +311,10 @@ procedure plus_one() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lplus_one: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:lplus_one"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000979"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 1bv32)), Gamma_R0; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; diff --git a/src/test/correct/ifbranches/clang/ifbranches.expected b/src/test/correct/ifbranches/clang/ifbranches.expected index dfe63d190..2c08802aa 100644 --- a/src/test/correct/ifbranches/clang/ifbranches.expected +++ b/src/test/correct/ifbranches/clang/ifbranches.expected @@ -1,54 +1,54 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -89,7 +89,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -98,9 +98,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -208,16 +208,16 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%0000030d"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000315"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000031d"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000324"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 0bv33))), (Gamma_R8 && Gamma_#4); @@ -243,26 +243,26 @@ procedure main() } goto l00000397; l0000035a: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l0000035a"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%0000036a"} true; goto l0000036d; l00000397: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000397"} true; goto l00000398; l00000398: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000398"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%000003a6"} true; goto l0000036d; l0000036d: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l0000036d"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%00000383"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/ifbranches/clang_O2/ifbranches.expected b/src/test/correct/ifbranches/clang_O2/ifbranches.expected index 9137eaa77..48ee466e2 100644 --- a/src/test/correct/ifbranches/clang_O2/ifbranches.expected +++ b/src/test/correct/ifbranches/clang_O2/ifbranches.expected @@ -1,23 +1,23 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -58,7 +58,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -67,9 +67,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -175,7 +175,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 2bv64, true; #4, Gamma_#4 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#4); diff --git a/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches.expected b/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches.expected index be2b089f5..e07f6572f 100644 --- a/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches.expected +++ b/src/test/correct/ifbranches/clang_no_plt_no_pic/ifbranches.expected @@ -1,54 +1,54 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -89,7 +89,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -98,9 +98,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -208,16 +208,16 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000979"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000981"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000989"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000990"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 0bv33))), (Gamma_R8 && Gamma_#4); @@ -243,26 +243,26 @@ procedure main() } goto l00000a03; l000009c6: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l000009c6"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%000009d6"} true; goto l000009d9; l00000a03: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000a03"} true; goto l00000a04; l00000a04: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000a04"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000a12"} true; goto l000009d9; l000009d9: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l000009d9"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%000009ef"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/ifbranches/clang_pic/ifbranches.expected b/src/test/correct/ifbranches/clang_pic/ifbranches.expected index be2b089f5..e07f6572f 100644 --- a/src/test/correct/ifbranches/clang_pic/ifbranches.expected +++ b/src/test/correct/ifbranches/clang_pic/ifbranches.expected @@ -1,54 +1,54 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -89,7 +89,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -98,9 +98,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -208,16 +208,16 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000979"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000981"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000989"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000990"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 0bv33))), (Gamma_R8 && Gamma_#4); @@ -243,26 +243,26 @@ procedure main() } goto l00000a03; l000009c6: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l000009c6"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%000009d6"} true; goto l000009d9; l00000a03: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000a03"} true; goto l00000a04; l00000a04: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000a04"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000a12"} true; goto l000009d9; l000009d9: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l000009d9"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%000009ef"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/ifbranches/gcc/ifbranches.expected b/src/test/correct/ifbranches/gcc/ifbranches.expected index 9db490ac8..a81f98949 100644 --- a/src/test/correct/ifbranches/gcc/ifbranches.expected +++ b/src/test/correct/ifbranches/gcc/ifbranches.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -96,9 +96,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -206,14 +206,14 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002fe"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R1), gamma_store64(Gamma_stack, R31, Gamma_R1); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000306"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000030d"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#4); @@ -226,23 +226,23 @@ procedure main() } goto l00000369; l00000330: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000330"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000340"} true; goto l00000342; l00000369: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000369"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000374"} true; goto l00000342; l00000342: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000342"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 1bv32)), Gamma_R0; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%00000355"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/ifbranches/gcc_O2/ifbranches.expected b/src/test/correct/ifbranches/gcc_O2/ifbranches.expected index fb26beabb..abe702918 100644 --- a/src/test/correct/ifbranches/gcc_O2/ifbranches.expected +++ b/src/test/correct/ifbranches/gcc_O2/ifbranches.expected @@ -1,21 +1,21 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -56,7 +56,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -65,9 +65,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -173,7 +173,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; #1, Gamma_#1 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#1, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#1); CF, Gamma_CF := bvnot1(bvcomp33(zero_extend1_32(bvadd32(#1, 1bv32)), bvadd33(zero_extend1_32(R0[32:0]), 4294967296bv33))), (Gamma_R0 && Gamma_#1); diff --git a/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches.expected b/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches.expected index a94ff72dd..370e57676 100644 --- a/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches.expected +++ b/src/test/correct/ifbranches/gcc_no_plt_no_pic/ifbranches.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -96,9 +96,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -206,14 +206,14 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000931"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R1), gamma_store64(Gamma_stack, R31, Gamma_R1); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000939"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000940"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#4); @@ -226,23 +226,23 @@ procedure main() } goto l0000099c; l00000963: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000963"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000973"} true; goto l00000975; l0000099c: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l0000099c"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%000009a7"} true; goto l00000975; l00000975: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000975"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 1bv32)), Gamma_R0; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%00000988"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/ifbranches/gcc_pic/ifbranches.expected b/src/test/correct/ifbranches/gcc_pic/ifbranches.expected index a94ff72dd..370e57676 100644 --- a/src/test/correct/ifbranches/gcc_pic/ifbranches.expected +++ b/src/test/correct/ifbranches/gcc_pic/ifbranches.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -96,9 +96,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -206,14 +206,14 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000931"} true; stack, Gamma_stack := memory_store64_le(stack, R31, R1), gamma_store64(Gamma_stack, R31, Gamma_R1); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000939"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000940"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#4); @@ -226,23 +226,23 @@ procedure main() } goto l0000099c; l00000963: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000963"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000973"} true; goto l00000975; l0000099c: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l0000099c"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%000009a7"} true; goto l00000975; l00000975: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000975"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 1bv32)), Gamma_R0; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%00000988"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/correct/ifglobal/clang/ifglobal.expected b/src/test/correct/ifglobal/clang/ifglobal.expected index 32a6b4719..c194aad54 100644 --- a/src/test/correct/ifglobal/clang/ifglobal.expected +++ b/src/test/correct/ifglobal/clang/ifglobal.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -96,9 +96,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -205,10 +205,10 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002f1"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -236,19 +236,19 @@ procedure main() } goto l00000343; l00000343: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000343"} true; goto l00000344; l00000344: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l00000344"} true; R8, Gamma_R8 := 1bv64, true; R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 52bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000357"} true; goto l0000032c; l0000032c: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l0000032c"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/ifglobal/clang_O2/ifglobal.expected b/src/test/correct/ifglobal/clang_O2/ifglobal.expected index b235ef11d..73ffd077a 100644 --- a/src/test/correct/ifglobal/clang_O2/ifglobal.expected +++ b/src/test/correct/ifglobal/clang_O2/ifglobal.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -85,9 +85,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -182,7 +182,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -192,16 +192,16 @@ procedure main() } goto l000002f8; l000002dc: - assume {:captureState "addr:0x728"}true; + assume {:captureState "addr:l000002dc"} true; R9, Gamma_R9 := 1bv64, true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000002ec"} true; R0, Gamma_R0 := 0bv64, true; return; l000002f8: - assume {:captureState "addr:0x720"}true; + assume {:captureState "addr:l000002f8"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal.expected b/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal.expected index bd525c686..e2441dabc 100644 --- a/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal.expected +++ b/src/test/correct/ifglobal/clang_no_plt_no_pic/ifglobal.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -96,9 +96,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -205,10 +205,10 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000900"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -236,19 +236,19 @@ procedure main() } goto l00000952; l00000952: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000952"} true; goto l00000953; l00000953: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l00000953"} true; R8, Gamma_R8 := 1bv64, true; R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 52bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000966"} true; goto l0000093b; l0000093b: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l0000093b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/ifglobal/clang_pic/ifglobal.expected b/src/test/correct/ifglobal/clang_pic/ifglobal.expected index 051cfdaf2..f939c757e 100644 --- a/src/test/correct/ifglobal/clang_pic/ifglobal.expected +++ b/src/test/correct/ifglobal/clang_pic/ifglobal.expected @@ -1,60 +1,60 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -103,7 +103,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69598bv64) == 0bv8); free ensures (memory_load8_le(mem, 69599bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -112,9 +112,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -237,10 +237,10 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002f9"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4040bv64)) || L(mem, bvadd64(R8, 4040bv64))); @@ -270,10 +270,10 @@ procedure main() } goto l00000352; l00000352: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:l00000352"} true; goto l00000353; l00000353: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l00000353"} true; R8, Gamma_R8 := 1bv64, true; R9, Gamma_R9 := 65536bv64, true; call rely(); @@ -281,10 +281,10 @@ procedure main() call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%0000036d"} true; goto l0000033b; l0000033b: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l0000033b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/ifglobal/gcc/ifglobal.expected b/src/test/correct/ifglobal/gcc/ifglobal.expected index dcf9e5bd9..3cc4ec57f 100644 --- a/src/test/correct/ifglobal/gcc/ifglobal.expected +++ b/src/test/correct/ifglobal/gcc/ifglobal.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -90,9 +90,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -197,7 +197,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -213,17 +213,17 @@ procedure main() } goto l00000311; l00000311: - assume {:captureState "addr:0x728"}true; + assume {:captureState "addr:l00000311"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000327"} true; goto l00000302; l00000302: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000302"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/ifglobal/gcc_O2/ifglobal.expected b/src/test/correct/ifglobal/gcc_O2/ifglobal.expected index 80272f3dc..7fc29b6d1 100644 --- a/src/test/correct/ifglobal/gcc_O2/ifglobal.expected +++ b/src/test/correct/ifglobal/gcc_O2/ifglobal.expected @@ -1,40 +1,40 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -75,7 +75,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -84,9 +84,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -181,7 +181,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, bvadd64(R0, 20bv64))), (gamma_load32(Gamma_mem, bvadd64(R0, 20bv64)) || L(mem, bvadd64(R0, 20bv64))); @@ -191,15 +191,15 @@ procedure main() } goto l00000396; l00000396: - assume {:captureState "addr:0x60c"}true; + assume {:captureState "addr:l00000396"} true; R1, Gamma_R1 := 1bv64, true; call rely(); assert (L(mem, bvadd64(R0, 20bv64)) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R0, 20bv64), R1[32:0]), gamma_store32(Gamma_mem, bvadd64(R0, 20bv64), Gamma_R1); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000003a1"} true; goto l000001b7; l000001b7: - assume {:captureState "addr:0x614"}true; + assume {:captureState "addr:l000001b7"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal.expected b/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal.expected index 2f04514e3..a594b4954 100644 --- a/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal.expected +++ b/src/test/correct/ifglobal/gcc_no_plt_no_pic/ifglobal.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -90,9 +90,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -197,7 +197,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -213,17 +213,17 @@ procedure main() } goto l000008e5; l000008e5: - assume {:captureState "addr:0x728"}true; + assume {:captureState "addr:l000008e5"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%000008fb"} true; goto l000008d6; l000008d6: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l000008d6"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/ifglobal/gcc_pic/ifglobal.expected b/src/test/correct/ifglobal/gcc_pic/ifglobal.expected index 7b18bc7da..e39101a09 100644 --- a/src/test/correct/ifglobal/gcc_pic/ifglobal.expected +++ b/src/test/correct/ifglobal/gcc_pic/ifglobal.expected @@ -1,54 +1,54 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $x_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -97,7 +97,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69014bv64) == 0bv8); free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -106,9 +106,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -229,7 +229,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -246,7 +246,7 @@ procedure main() } goto l00000312; l00000312: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000312"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -254,10 +254,10 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x774"}true; + assume {:captureState "%00000329"} true; goto l00000303; l00000303: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l00000303"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/indirect_call/clang_O2/indirect_call.expected b/src/test/correct/indirect_call/clang_O2/indirect_call.expected index 365ea1180..101f70559 100644 --- a/src/test/correct/indirect_call/clang_O2/indirect_call.expected +++ b/src/test/correct/indirect_call/clang_O2/indirect_call.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1952bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1952bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -120,7 +120,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69686bv64) == 0bv8); free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -129,9 +129,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -316,12 +316,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x760"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002fc"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000302"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 0bv64, true; @@ -330,14 +330,14 @@ procedure main() call puts(); goto l00000320; l00000320: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:l00000320"} true; R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 1956bv64), Gamma_R0; R30, Gamma_R30 := 1920bv64, true; call puts(); goto l00000332; l00000332: - assume {:captureState "addr:0x780"}true; + assume {:captureState "addr:l00000332"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/indirect_call/gcc_O2/indirect_call.expected b/src/test/correct/indirect_call/gcc_O2/indirect_call.expected index 533297bf6..4439316c5 100644 --- a/src/test/correct/indirect_call/gcc_O2/indirect_call.expected +++ b/src/test/correct/indirect_call/gcc_O2/indirect_call.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1984bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1984bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -126,7 +126,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -135,9 +135,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure greet() @@ -312,7 +312,7 @@ procedure greet() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lgreet: - assume {:captureState "addr:0x7a0"}true; + assume {:captureState "addr:lgreet"} true; R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 1992bv64), Gamma_R0; call puts(); @@ -514,12 +514,12 @@ procedure main() var #1: bv64; var Gamma_#1: bool; lmain: - assume {:captureState "addr:0x640"}true; + assume {:captureState "addr:lmain"} true; #1, Gamma_#1 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #1, R29), gamma_store64(Gamma_stack, #1, Gamma_R29); - assume {:captureState "addr:0x640"}true; + assume {:captureState "%000001ca"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#1, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#1, 8bv64), Gamma_R30); - assume {:captureState "addr:0x640"}true; + assume {:captureState "%000001d0"} true; R31, Gamma_R31 := #1, Gamma_#1; R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2008bv64), Gamma_R0; @@ -528,12 +528,12 @@ procedure main() call puts(); goto l000001ef; l000001ef: - assume {:captureState "addr:0x654"}true; + assume {:captureState "addr:l000001ef"} true; R30, Gamma_R30 := 1624bv64, true; call greet(); goto l00000205; l00000205: - assume {:captureState "addr:0x658"}true; + assume {:captureState "addr:l00000205"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/initialisation/clang/initialisation.expected b/src/test/correct/initialisation/clang/initialisation.expected index 78613bbad..4865cfdd4 100644 --- a/src/test/correct/initialisation/clang/initialisation.expected +++ b/src/test/correct/initialisation/clang/initialisation.expected @@ -1,86 +1,86 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R11: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R11: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$a_addr: bv64; -axiom {:extern }($a_addr == 69696bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69680bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R11: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R11: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $a_addr: bv64; +axiom ($a_addr == 69696bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69680bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd65(bv65, bv65) returns (bv65); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp64(bv64, bv64) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp65(bv65, bv65) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd65(bv65, bv65) returns (bv65); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp64(bv64, bv64) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp65(bv65, bv65) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_64(bv64) returns (bv65); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_64(bv64) returns (bv65); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_64(bv64) returns (bv65); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_64(bv64) returns (bv65); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -121,7 +121,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -130,9 +130,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -264,7 +264,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; R9, Gamma_R9 := bvadd64(R9, 64bv64), Gamma_R9; @@ -275,7 +275,7 @@ procedure main() call rely(); assert (L(mem, bvadd64(R11, 48bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R11, 48bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R11, 48bv64), Gamma_R10); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%00000322"} true; R11, Gamma_R11 := 69632bv64, true; call rely(); R10, Gamma_R10 := memory_load64_le(mem, bvadd64(R11, 56bv64)), (gamma_load64(Gamma_mem, bvadd64(R11, 56bv64)) || L(mem, bvadd64(R11, 56bv64))); @@ -288,14 +288,14 @@ procedure main() call rely(); assert (L(mem, bvadd64(R11, 56bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R11, 56bv64), R10), gamma_store64(Gamma_mem, bvadd64(R11, 56bv64), Gamma_R10); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000352"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 64bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 64bv64)) || L(mem, bvadd64(R8, 64bv64))); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 3bv32)), Gamma_R8; call rely(); assert (L(mem, bvadd64(R9, 4bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 4bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 4bv64), Gamma_R8); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000367"} true; R9, Gamma_R9 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend56_8(memory_load8_le(mem, bvadd64(R9, 52bv64))), (gamma_load8(Gamma_mem, bvadd64(R9, 52bv64)) || L(mem, bvadd64(R9, 52bv64))); @@ -303,7 +303,7 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 52bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R9, 52bv64), R8[8:0]), gamma_store8(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000381"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/initialisation/clang_O2/initialisation.expected b/src/test/correct/initialisation/clang_O2/initialisation.expected index d9f717d10..d85e30aaf 100644 --- a/src/test/correct/initialisation/clang_O2/initialisation.expected +++ b/src/test/correct/initialisation/clang_O2/initialisation.expected @@ -1,88 +1,88 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R11: bool; -var {:extern }Gamma_R12: bool; -var {:extern }Gamma_R13: bool; -var {:extern }Gamma_R14: bool; -var {:extern }Gamma_R15: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R11: bv64; -var {:extern }R12: bv64; -var {:extern }R13: bv64; -var {:extern }R14: bv64; -var {:extern }R15: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$a_addr: bv64; -axiom {:extern }($a_addr == 69696bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69680bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R11: bool; +var {:extern } Gamma_R12: bool; +var {:extern } Gamma_R13: bool; +var {:extern } Gamma_R14: bool; +var {:extern } Gamma_R15: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R11: bv64; +var {:extern } R12: bv64; +var {:extern } R13: bv64; +var {:extern } R14: bv64; +var {:extern } R15: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $a_addr: bv64; +axiom ($a_addr == 69696bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69680bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -123,7 +123,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -132,9 +132,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -256,7 +256,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R10, Gamma_R10 := 69632bv64, true; R10, Gamma_R10 := bvadd64(R10, 64bv64), Gamma_R10; R8, Gamma_R8 := 69632bv64, true; @@ -277,19 +277,19 @@ procedure main() call rely(); assert (L(mem, bvadd64(R10, 4bv64)) ==> Gamma_R11); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R10, 4bv64), R11[32:0]), gamma_store32(Gamma_mem, bvadd64(R10, 4bv64), Gamma_R11); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000349"} true; R10, Gamma_R10 := zero_extend32_32(bvadd32(R15[32:0], 1bv32)), Gamma_R15; call rely(); assert (L(mem, bvadd64(R8, 48bv64)) ==> Gamma_R13); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 48bv64), R13[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 48bv64), Gamma_R13); - assume {:captureState "addr:0x750"}true; + assume {:captureState "%00000357"} true; call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R14); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R9, 56bv64), R14), gamma_store64(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R14); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%0000035f"} true; call rely(); assert (L(mem, bvadd64(R12, 52bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R12, 52bv64), R10[8:0]), gamma_store8(Gamma_mem, bvadd64(R12, 52bv64), Gamma_R10); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000367"} true; return; } diff --git a/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation.expected b/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation.expected index 78613bbad..cb1eb0d81 100644 --- a/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation.expected +++ b/src/test/correct/initialisation/clang_no_plt_no_pic/initialisation.expected @@ -1,86 +1,86 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R11: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R11: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$a_addr: bv64; -axiom {:extern }($a_addr == 69696bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69680bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R11: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R11: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $a_addr: bv64; +axiom ($a_addr == 69696bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69680bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd65(bv65, bv65) returns (bv65); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp64(bv64, bv64) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp65(bv65, bv65) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd65(bv65, bv65) returns (bv65); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp64(bv64, bv64) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp65(bv65, bv65) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_64(bv64) returns (bv65); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_64(bv64) returns (bv65); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_64(bv64) returns (bv65); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_64(bv64) returns (bv65); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -121,7 +121,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -130,9 +130,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -264,7 +264,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; R9, Gamma_R9 := bvadd64(R9, 64bv64), Gamma_R9; @@ -275,7 +275,7 @@ procedure main() call rely(); assert (L(mem, bvadd64(R11, 48bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R11, 48bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R11, 48bv64), Gamma_R10); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%0000096a"} true; R11, Gamma_R11 := 69632bv64, true; call rely(); R10, Gamma_R10 := memory_load64_le(mem, bvadd64(R11, 56bv64)), (gamma_load64(Gamma_mem, bvadd64(R11, 56bv64)) || L(mem, bvadd64(R11, 56bv64))); @@ -288,14 +288,14 @@ procedure main() call rely(); assert (L(mem, bvadd64(R11, 56bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R11, 56bv64), R10), gamma_store64(Gamma_mem, bvadd64(R11, 56bv64), Gamma_R10); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%0000099a"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 64bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 64bv64)) || L(mem, bvadd64(R8, 64bv64))); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 3bv32)), Gamma_R8; call rely(); assert (L(mem, bvadd64(R9, 4bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 4bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 4bv64), Gamma_R8); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%000009af"} true; R9, Gamma_R9 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend56_8(memory_load8_le(mem, bvadd64(R9, 52bv64))), (gamma_load8(Gamma_mem, bvadd64(R9, 52bv64)) || L(mem, bvadd64(R9, 52bv64))); @@ -303,7 +303,7 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 52bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R9, 52bv64), R8[8:0]), gamma_store8(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000009c9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/initialisation/clang_pic/initialisation.expected b/src/test/correct/initialisation/clang_pic/initialisation.expected index a23c84893..eaefa7a71 100644 --- a/src/test/correct/initialisation/clang_pic/initialisation.expected +++ b/src/test/correct/initialisation/clang_pic/initialisation.expected @@ -1,84 +1,84 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$a_addr: bv64; -axiom {:extern }($a_addr == 69696bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69680bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $a_addr: bv64; +axiom ($a_addr == 69696bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69680bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd65(bv65, bv65) returns (bv65); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp64(bv64, bv64) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp65(bv65, bv65) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd65(bv65, bv65) returns (bv65); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp64(bv64, bv64) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp65(bv65, bv65) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_64(bv64) returns (bv65); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_64(bv64) returns (bv65); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_64(bv64) returns (bv65); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_64(bv64) returns (bv65); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -151,7 +151,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69566bv64) == 0bv8); free ensures (memory_load8_le(mem, 69567bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -160,9 +160,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -358,7 +358,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x794"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4040bv64)) || L(mem, bvadd64(R9, 4040bv64))); @@ -371,7 +371,7 @@ procedure main() call rely(); assert (L(mem, R10) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R10, R8[32:0]), gamma_store32(Gamma_mem, R10, Gamma_R8); - assume {:captureState "addr:0x7ac"}true; + assume {:captureState "%0000032d"} true; R10, Gamma_R10 := 65536bv64, true; call rely(); R10, Gamma_R10 := memory_load64_le(mem, bvadd64(R10, 4016bv64)), (gamma_load64(Gamma_mem, bvadd64(R10, 4016bv64)) || L(mem, bvadd64(R10, 4016bv64))); @@ -386,14 +386,14 @@ procedure main() call rely(); assert (L(mem, R10) ==> Gamma_R8); mem, Gamma_mem := memory_store64_le(mem, R10, R8), gamma_store64(Gamma_mem, R10, Gamma_R8); - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "%00000364"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R9)), (gamma_load32(Gamma_mem, R9) || L(mem, R9)); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 3bv32)), Gamma_R8; call rely(); assert (L(mem, bvadd64(R9, 4bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 4bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 4bv64), Gamma_R8); - assume {:captureState "addr:0x7cc"}true; + assume {:captureState "%00000379"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4048bv64)) || L(mem, bvadd64(R9, 4048bv64))); @@ -403,7 +403,7 @@ procedure main() call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x7e0"}true; + assume {:captureState "%0000039a"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/initialisation/gcc/initialisation.expected b/src/test/correct/initialisation/gcc/initialisation.expected index cea56edea..e0bc5e761 100644 --- a/src/test/correct/initialisation/gcc/initialisation.expected +++ b/src/test/correct/initialisation/gcc/initialisation.expected @@ -1,74 +1,74 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$a_addr: bv64; -axiom {:extern }($a_addr == 69664bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69648bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $a_addr: bv64; +axiom ($a_addr == 69664bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69648bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -109,7 +109,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -118,9 +118,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -242,7 +242,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 16bv64), Gamma_R0; call rely(); @@ -253,7 +253,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%0000034f"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -264,7 +264,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store64_le(mem, R0, R1), gamma_store64(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%0000037a"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 32bv64), Gamma_R0; call rely(); @@ -275,7 +275,7 @@ procedure main() call rely(); assert (L(mem, bvadd64(R0, 4bv64)) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R0, 4bv64), R1[32:0]), gamma_store32(Gamma_mem, bvadd64(R0, 4bv64), Gamma_R1); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%000003a5"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -287,7 +287,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%000003d6"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/initialisation/gcc_O2/initialisation.expected b/src/test/correct/initialisation/gcc_O2/initialisation.expected index 61ab8d5a3..c9efe3b33 100644 --- a/src/test/correct/initialisation/gcc_O2/initialisation.expected +++ b/src/test/correct/initialisation/gcc_O2/initialisation.expected @@ -1,84 +1,84 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R3: bool; -var {:extern }Gamma_R4: bool; -var {:extern }Gamma_R5: bool; -var {:extern }Gamma_R6: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }R3: bv64; -var {:extern }R4: bv64; -var {:extern }R5: bv64; -var {:extern }R6: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$a_addr: bv64; -axiom {:extern }($a_addr == 69664bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69648bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69672bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R3: bool; +var {:extern } Gamma_R4: bool; +var {:extern } Gamma_R5: bool; +var {:extern } Gamma_R6: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } R3: bv64; +var {:extern } R4: bv64; +var {:extern } R5: bv64; +var {:extern } R6: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $a_addr: bv64; +axiom ($a_addr == 69664bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69648bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69672bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -119,7 +119,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -128,9 +128,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -253,7 +253,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R5, Gamma_R5 := 69632bv64, true; R1, Gamma_R1 := bvadd64(R5, 16bv64), Gamma_R5; R0, Gamma_R0 := 0bv64, true; @@ -271,19 +271,19 @@ procedure main() call rely(); assert (L(mem, bvadd64(R5, 16bv64)) ==> Gamma_R6); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R5, 16bv64), R6[32:0]), gamma_store32(Gamma_mem, bvadd64(R5, 16bv64), Gamma_R6); - assume {:captureState "addr:0x628"}true; + assume {:captureState "%000001ec"} true; R3, Gamma_R3 := zero_extend32_32(bvadd32(R3[32:0], 3bv32)), Gamma_R3; call rely(); assert (L(mem, bvadd64(R1, 8bv64)) ==> Gamma_R4); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R1, 8bv64), R4), gamma_store64(Gamma_mem, bvadd64(R1, 8bv64), Gamma_R4); - assume {:captureState "addr:0x630"}true; + assume {:captureState "%000001fa"} true; call rely(); assert (L(mem, bvadd64(R1, 20bv64)) ==> Gamma_R3); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R3[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R3); - assume {:captureState "addr:0x634"}true; + assume {:captureState "%00000202"} true; call rely(); assert (L(mem, bvadd64(R1, 24bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R1, 24bv64), R2[8:0]), gamma_store8(Gamma_mem, bvadd64(R1, 24bv64), Gamma_R2); - assume {:captureState "addr:0x638"}true; + assume {:captureState "%0000020a"} true; return; } diff --git a/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation.expected b/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation.expected index cea56edea..d3f07b396 100644 --- a/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation.expected +++ b/src/test/correct/initialisation/gcc_no_plt_no_pic/initialisation.expected @@ -1,74 +1,74 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$a_addr: bv64; -axiom {:extern }($a_addr == 69664bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69648bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $a_addr: bv64; +axiom ($a_addr == 69664bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69648bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -109,7 +109,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -118,9 +118,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -242,7 +242,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 16bv64), Gamma_R0; call rely(); @@ -253,7 +253,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%00000a02"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -264,7 +264,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store64_le(mem, R0, R1), gamma_store64(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000a2d"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 32bv64), Gamma_R0; call rely(); @@ -275,7 +275,7 @@ procedure main() call rely(); assert (L(mem, bvadd64(R0, 4bv64)) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R0, 4bv64), R1[32:0]), gamma_store32(Gamma_mem, bvadd64(R0, 4bv64), Gamma_R1); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%00000a58"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -287,7 +287,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%00000a89"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/initialisation/gcc_pic/initialisation.expected b/src/test/correct/initialisation/gcc_pic/initialisation.expected index 57dd25c5e..c0c85331e 100644 --- a/src/test/correct/initialisation/gcc_pic/initialisation.expected +++ b/src/test/correct/initialisation/gcc_pic/initialisation.expected @@ -1,74 +1,74 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$a_addr: bv64; -axiom {:extern }($a_addr == 69664bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69648bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $a_addr: bv64; +axiom ($a_addr == 69664bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69648bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -141,7 +141,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 68998bv64) == 0bv8); free ensures (memory_load8_le(mem, 68999bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -150,9 +150,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -338,7 +338,7 @@ procedure main() free ensures (memory_load8_le(mem, 68999bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x794"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4048bv64)) || L(mem, bvadd64(R0, 4048bv64))); @@ -351,7 +351,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x7ac"}true; + assume {:captureState "%00000351"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4040bv64)) || L(mem, bvadd64(R0, 4040bv64))); @@ -364,7 +364,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store64_le(mem, R0, R1), gamma_store64(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x7c8"}true; + assume {:captureState "%0000037e"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -377,7 +377,7 @@ procedure main() call rely(); assert (L(mem, bvadd64(R0, 4bv64)) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R0, 4bv64), R1[32:0]), gamma_store32(Gamma_mem, bvadd64(R0, 4bv64), Gamma_R1); - assume {:captureState "addr:0x7e4"}true; + assume {:captureState "%000003ab"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); @@ -391,7 +391,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x804"}true; + assume {:captureState "%000003de"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/jumptable/clang_O2/jumptable.expected b/src/test/correct/jumptable/clang_O2/jumptable.expected index 4cf96683d..467d96736 100644 --- a/src/test/correct/jumptable/clang_O2/jumptable.expected +++ b/src/test/correct/jumptable/clang_O2/jumptable.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1916bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69680bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1916bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69680bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -78,7 +78,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -87,9 +87,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -188,7 +188,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x750"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; call rely(); @@ -197,6 +197,6 @@ procedure main() call rely(); assert (L(mem, bvadd64(R8, 48bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 48bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 48bv64), Gamma_R9); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000378"} true; return; } diff --git a/src/test/correct/jumptable/gcc_O2/jumptable.expected b/src/test/correct/jumptable/gcc_O2/jumptable.expected index 3906a8378..47773b7fd 100644 --- a/src/test/correct/jumptable/gcc_O2/jumptable.expected +++ b/src/test/correct/jumptable/gcc_O2/jumptable.expected @@ -1,65 +1,65 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1976bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69648bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1976bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69648bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -100,7 +100,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -109,9 +109,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure add_six() @@ -190,7 +190,7 @@ procedure add_six() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { ladd_six: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:ladd_six"} true; R1, Gamma_R1 := 69632bv64, true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); @@ -198,7 +198,7 @@ procedure add_six() call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000252"} true; return; } @@ -278,7 +278,7 @@ procedure add_two() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { ladd_two: - assume {:captureState "addr:0x760"}true; + assume {:captureState "addr:ladd_two"} true; R1, Gamma_R1 := 69632bv64, true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); @@ -286,7 +286,7 @@ procedure add_two() call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%00000233"} true; return; } @@ -392,29 +392,29 @@ procedure main() var #1: bv64; var Gamma_#1: bool; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; #1, Gamma_#1 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #1, R29), gamma_store64(Gamma_stack, #1, Gamma_R29); - assume {:captureState "addr:0x600"}true; + assume {:captureState "%00000202"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#1, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#1, 8bv64), Gamma_R30); - assume {:captureState "addr:0x600"}true; + assume {:captureState "%00000208"} true; R31, Gamma_R31 := #1, Gamma_#1; R29, Gamma_R29 := R31, Gamma_R31; R30, Gamma_R30 := 1548bv64, true; call add_two(); goto l0000027c; l0000027c: - assume {:captureState "addr:0x60c"}true; + assume {:captureState "addr:l0000027c"} true; R30, Gamma_R30 := 1552bv64, true; call add_six(); goto l00000283; l00000283: - assume {:captureState "addr:0x610"}true; + assume {:captureState "addr:l00000283"} true; R30, Gamma_R30 := 1556bv64, true; call sub_seven(); goto l0000028a; l0000028a: - assume {:captureState "addr:0x614"}true; + assume {:captureState "addr:l0000028a"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); @@ -498,7 +498,7 @@ procedure sub_seven() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lsub_seven: - assume {:captureState "addr:0x790"}true; + assume {:captureState "addr:lsub_seven"} true; R1, Gamma_R1 := 69632bv64, true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); @@ -506,6 +506,6 @@ procedure sub_seven() call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x79c"}true; + assume {:captureState "%00000275"} true; return; } diff --git a/src/test/correct/jumptable3/gcc/jumptable3.expected b/src/test/correct/jumptable3/gcc/jumptable3.expected index 6f0078804..bb2282634 100644 --- a/src/test/correct/jumptable3/gcc/jumptable3.expected +++ b/src/test/correct/jumptable3/gcc/jumptable3.expected @@ -1,69 +1,69 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvand"}bvand1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvand"} bvand1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -104,7 +104,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -113,9 +113,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure add_six() @@ -194,7 +194,7 @@ procedure add_six() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { ladd_six: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:ladd_six"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 16bv64), Gamma_R0; call rely(); @@ -205,7 +205,7 @@ procedure add_six() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x750"}true; + assume {:captureState "%00000511"} true; return; } @@ -285,7 +285,7 @@ procedure add_two() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { ladd_two: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:ladd_two"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 16bv64), Gamma_R0; call rely(); @@ -296,7 +296,7 @@ procedure add_two() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000004df"} true; return; } @@ -455,18 +455,18 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x780"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000556"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%0000055c"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%0000056e"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x78c"}true; + assume {:captureState "%00000576"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967284bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934581bv33))), (Gamma_R0 && Gamma_#5); @@ -479,7 +479,7 @@ procedure main() } goto l000005e0; l000005e0: - assume {:captureState "addr:0x79c"}true; + assume {:captureState "addr:l000005e0"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967284bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934581bv33))), (Gamma_R0 && Gamma_#6); @@ -492,7 +492,7 @@ procedure main() } goto l00000608; l00000608: - assume {:captureState "addr:0x7a8"}true; + assume {:captureState "addr:l00000608"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #7, Gamma_#7 := bvadd32(R0[32:0], 4294967285bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#7, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934582bv33))), (Gamma_R0 && Gamma_#7); @@ -505,35 +505,35 @@ procedure main() } goto l00000643; l00000629: - assume {:captureState "addr:0x8ec"}true; + assume {:captureState "addr:l00000629"} true; R30, Gamma_R30 := 2288bv64, true; call sub_seven(); goto l00000635; l00000635: - assume {:captureState "addr:0x8f0"}true; + assume {:captureState "addr:l00000635"} true; R30, Gamma_R30 := 2292bv64, true; call add_two(); goto l0000063c; l0000063c: - assume {:captureState "addr:0x8f4"}true; + assume {:captureState "addr:l0000063c"} true; R30, Gamma_R30 := 2296bv64, true; call add_six(); goto l00000599; l00000599: - assume {:captureState "addr:0x8f8"}true; + assume {:captureState "addr:l00000599"} true; R30, Gamma_R30 := 2300bv64, true; call sub_seven(); goto l000005a5; l000005a5: - assume {:captureState "addr:0x8fc"}true; + assume {:captureState "addr:l000005a5"} true; R30, Gamma_R30 := 2304bv64, true; call add_two(); goto l000005ac; l000005ac: - assume {:captureState "addr:0x900"}true; + assume {:captureState "addr:l000005ac"} true; goto l000005ad; l00000643: - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "addr:l00000643"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #8, Gamma_#8 := bvadd32(R0[32:0], 4294967285bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#8, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934582bv33))), (Gamma_R0 && Gamma_#8); @@ -546,7 +546,7 @@ procedure main() } goto l0000066b; l0000066b: - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "addr:l0000066b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #9, Gamma_#9 := bvadd32(R0[32:0], 4294967286bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#9, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934583bv33))), (Gamma_R0 && Gamma_#9); @@ -559,20 +559,20 @@ procedure main() } goto l000006a3; l0000068c: - assume {:captureState "addr:0x8e0"}true; + assume {:captureState "addr:l0000068c"} true; R30, Gamma_R30 := 2276bv64, true; call add_two(); goto l00000698; l00000698: - assume {:captureState "addr:0x8e4"}true; + assume {:captureState "addr:l00000698"} true; R30, Gamma_R30 := 2280bv64, true; call add_six(); goto l0000069f; l0000069f: - assume {:captureState "addr:0x8e8"}true; + assume {:captureState "addr:l0000069f"} true; goto l000005ad; l000006a3: - assume {:captureState "addr:0x7cc"}true; + assume {:captureState "addr:l000006a3"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #10, Gamma_#10 := bvadd32(R0[32:0], 4294967286bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#10, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934583bv33))), (Gamma_R0 && Gamma_#10); @@ -585,7 +585,7 @@ procedure main() } goto l000006cb; l000006cb: - assume {:captureState "addr:0x7d8"}true; + assume {:captureState "addr:l000006cb"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #11, Gamma_#11 := bvadd32(R0[32:0], 4294967287bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#11, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934584bv33))), (Gamma_R0 && Gamma_#11); @@ -598,7 +598,7 @@ procedure main() } goto l00000703; l00000703: - assume {:captureState "addr:0x7e4"}true; + assume {:captureState "addr:l00000703"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #12, Gamma_#12 := bvadd32(R0[32:0], 4294967287bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#12, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934584bv33))), (Gamma_R0 && Gamma_#12); @@ -611,7 +611,7 @@ procedure main() } goto l0000072b; l0000072b: - assume {:captureState "addr:0x7f0"}true; + assume {:captureState "addr:l0000072b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #13, Gamma_#13 := bvadd32(R0[32:0], 4294967288bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#13, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934585bv33))), (Gamma_R0 && Gamma_#13); @@ -624,7 +624,7 @@ procedure main() } goto l00000758; l00000758: - assume {:captureState "addr:0x7fc"}true; + assume {:captureState "addr:l00000758"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #14, Gamma_#14 := bvadd32(R0[32:0], 4294967288bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#14, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934585bv33))), (Gamma_R0 && Gamma_#14); @@ -637,7 +637,7 @@ procedure main() } goto l00000780; l00000780: - assume {:captureState "addr:0x808"}true; + assume {:captureState "addr:l00000780"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #15, Gamma_#15 := bvadd32(R0[32:0], 4294967289bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#15, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934586bv33))), (Gamma_R0 && Gamma_#15); @@ -650,7 +650,7 @@ procedure main() } goto l000007ad; l000007ad: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:l000007ad"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #16, Gamma_#16 := bvadd32(R0[32:0], 4294967289bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#16, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934586bv33))), (Gamma_R0 && Gamma_#16); @@ -663,7 +663,7 @@ procedure main() } goto l000007d5; l000007d5: - assume {:captureState "addr:0x820"}true; + assume {:captureState "addr:l000007d5"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #17, Gamma_#17 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#17, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#17); @@ -676,40 +676,40 @@ procedure main() } goto l00000809; l000007f6: - assume {:captureState "addr:0x8c4"}true; + assume {:captureState "addr:l000007f6"} true; R30, Gamma_R30 := 2248bv64, true; call add_six(); goto l00000802; l00000802: - assume {:captureState "addr:0x8c8"}true; + assume {:captureState "addr:l00000802"} true; R30, Gamma_R30 := 2252bv64, true; call add_two(); goto l000007a1; l000007a1: - assume {:captureState "addr:0x8cc"}true; + assume {:captureState "addr:l000007a1"} true; R30, Gamma_R30 := 2256bv64, true; call add_six(); goto l0000074c; l0000074c: - assume {:captureState "addr:0x8d0"}true; + assume {:captureState "addr:l0000074c"} true; R30, Gamma_R30 := 2260bv64, true; call sub_seven(); goto l000006ec; l000006ec: - assume {:captureState "addr:0x8d4"}true; + assume {:captureState "addr:l000006ec"} true; R30, Gamma_R30 := 2264bv64, true; call sub_seven(); goto l000006f8; l000006f8: - assume {:captureState "addr:0x8d8"}true; + assume {:captureState "addr:l000006f8"} true; R30, Gamma_R30 := 2268bv64, true; call add_six(); goto l000006ff; l000006ff: - assume {:captureState "addr:0x8dc"}true; + assume {:captureState "addr:l000006ff"} true; goto l000005ad; l00000809: - assume {:captureState "addr:0x82c"}true; + assume {:captureState "addr:l00000809"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #18, Gamma_#18 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#18, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#18); @@ -722,7 +722,7 @@ procedure main() } goto l00000831; l00000831: - assume {:captureState "addr:0x838"}true; + assume {:captureState "addr:l00000831"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #19, Gamma_#19 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#19, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#19); @@ -735,15 +735,15 @@ procedure main() } goto l00000862; l00000852: - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "addr:l00000852"} true; R30, Gamma_R30 := 2240bv64, true; call add_six(); goto l0000085e; l0000085e: - assume {:captureState "addr:0x8c0"}true; + assume {:captureState "addr:l0000085e"} true; goto l000005ad; l00000862: - assume {:captureState "addr:0x844"}true; + assume {:captureState "addr:l00000862"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #20, Gamma_#20 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#20, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#20); @@ -756,7 +756,7 @@ procedure main() } goto l0000088a; l0000088a: - assume {:captureState "addr:0x850"}true; + assume {:captureState "addr:l0000088a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #21, Gamma_#21 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#21, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#21); @@ -769,20 +769,20 @@ procedure main() } goto l000008c2; l000008ab: - assume {:captureState "addr:0x8b0"}true; + assume {:captureState "addr:l000008ab"} true; R30, Gamma_R30 := 2228bv64, true; call add_two(); goto l000008b7; l000008b7: - assume {:captureState "addr:0x8b4"}true; + assume {:captureState "addr:l000008b7"} true; R30, Gamma_R30 := 2232bv64, true; call sub_seven(); goto l000008be; l000008be: - assume {:captureState "addr:0x8b8"}true; + assume {:captureState "addr:l000008be"} true; goto l000005ad; l000008c2: - assume {:captureState "addr:0x85c"}true; + assume {:captureState "addr:l000008c2"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #22, Gamma_#22 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#22, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#22); @@ -795,7 +795,7 @@ procedure main() } goto l000008ea; l000008ea: - assume {:captureState "addr:0x868"}true; + assume {:captureState "addr:l000008ea"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #23, Gamma_#23 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#23, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#23); @@ -808,7 +808,7 @@ procedure main() } goto l0000091b; l0000091b: - assume {:captureState "addr:0x874"}true; + assume {:captureState "addr:l0000091b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #24, Gamma_#24 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#24, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#24); @@ -821,7 +821,7 @@ procedure main() } goto l00000943; l00000943: - assume {:captureState "addr:0x880"}true; + assume {:captureState "addr:l00000943"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #25, Gamma_#25 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#25, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#25); @@ -834,15 +834,15 @@ procedure main() } goto l0000097b; l00000964: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l00000964"} true; R30, Gamma_R30 := 2208bv64, true; call add_two(); goto l00000970; l00000970: - assume {:captureState "addr:0x8a0"}true; + assume {:captureState "addr:l00000970"} true; goto l000005ad; l0000097b: - assume {:captureState "addr:0x88c"}true; + assume {:captureState "addr:l0000097b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #26, Gamma_#26 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#26, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#26); @@ -855,34 +855,34 @@ procedure main() } goto l000009a1; l00000974: - assume {:captureState "addr:0x8a4"}true; + assume {:captureState "addr:l00000974"} true; R30, Gamma_R30 := 2216bv64, true; call add_six(); goto l0000090b; l0000090b: - assume {:captureState "addr:0x8a8"}true; + assume {:captureState "addr:l0000090b"} true; R30, Gamma_R30 := 2220bv64, true; call sub_seven(); goto l00000917; l00000917: - assume {:captureState "addr:0x8ac"}true; + assume {:captureState "addr:l00000917"} true; goto l000005ad; l000005ad: - assume {:captureState "addr:0x90c"}true; + assume {:captureState "addr:l000005ad"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 16bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); goto l000005c2; l000009a1: - assume {:captureState "addr:0x898"}true; + assume {:captureState "addr:l000009a1"} true; goto l000005d7; l000005d7: - assume {:captureState "addr:0x904"}true; + assume {:captureState "addr:l000005d7"} true; R0, Gamma_R0 := 1bv64, true; goto l000005c2; l000005c2: - assume {:captureState "addr:0x918"}true; + assume {:captureState "addr:l000005c2"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; @@ -965,7 +965,7 @@ procedure sub_seven() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lsub_seven: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:lsub_seven"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 16bv64), Gamma_R0; call rely(); @@ -976,6 +976,6 @@ procedure sub_seven() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x774"}true; + assume {:captureState "%00000543"} true; return; } diff --git a/src/test/correct/jumptable3/gcc_O2/jumptable3.expected b/src/test/correct/jumptable3/gcc_O2/jumptable3.expected index f1b44ef8f..12f14eba8 100644 --- a/src/test/correct/jumptable3/gcc_O2/jumptable3.expected +++ b/src/test/correct/jumptable3/gcc_O2/jumptable3.expected @@ -1,45 +1,45 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvand"}bvand1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvand"} bvand1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -80,7 +80,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -89,9 +89,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -219,7 +219,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; #1, Gamma_#1 := bvadd32(R0[32:0], 4294967289bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#1, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934586bv33))), (Gamma_R0 && Gamma_#1); @@ -232,14 +232,14 @@ procedure main() } goto l00000753; l00000753: - assume {:captureState "addr:0x60c"}true; + assume {:captureState "addr:l00000753"} true; assert (Gamma_ZF && (Gamma_VF && Gamma_NF)); if ((bvand1(bvcomp1(NF, VF), bvcomp1(ZF, 0bv1)) != 0bv1)) { goto l000006e8; } goto l0000075c; l000006e8: - assume {:captureState "addr:0x688"}true; + assume {:captureState "addr:l000006e8"} true; R1, Gamma_R1 := 69632bv64, true; #8, Gamma_#8 := bvadd32(R0[32:0], 4294967286bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#8, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934583bv33))), (Gamma_R0 && Gamma_#8); @@ -252,24 +252,24 @@ procedure main() } goto l0000070c; l000005f9: - assume {:captureState "addr:0x710"}true; + assume {:captureState "addr:l000005f9"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 8bv32)), Gamma_R0; call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%0000060c"} true; goto l00000360; l0000070c: - assume {:captureState "addr:0x694"}true; + assume {:captureState "addr:l0000070c"} true; assert (Gamma_ZF && (Gamma_VF && Gamma_NF)); if ((bvnot1(bvand1(bvcomp1(NF, VF), bvcomp1(ZF, 0bv1))) != 0bv1)) { goto l00000644; } goto l00000715; l00000644: - assume {:captureState "addr:0x6b8"}true; + assume {:captureState "addr:l00000644"} true; #6, Gamma_#6 := bvadd32(R0[32:0], 4294967288bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934585bv33))), (Gamma_R0 && Gamma_#6); CF, Gamma_CF := bvnot1(bvcomp33(zero_extend1_32(bvadd32(#6, 1bv32)), bvadd33(zero_extend1_32(R0[32:0]), 4294967289bv33))), (Gamma_R0 && Gamma_#6); @@ -281,7 +281,7 @@ procedure main() } goto l00000663; l00000663: - assume {:captureState "addr:0x6c0"}true; + assume {:captureState "addr:l00000663"} true; #7, Gamma_#7 := bvadd32(R0[32:0], 4294967287bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#7, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934584bv33))), (Gamma_R0 && Gamma_#7); CF, Gamma_CF := bvnot1(bvcomp33(zero_extend1_32(bvadd32(#7, 1bv32)), bvadd33(zero_extend1_32(R0[32:0]), 4294967288bv33))), (Gamma_R0 && Gamma_#7); @@ -293,7 +293,7 @@ procedure main() } goto l00000347; l00000715: - assume {:captureState "addr:0x698"}true; + assume {:captureState "addr:l00000715"} true; #9, Gamma_#9 := bvadd32(R0[32:0], 4294967285bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#9, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934582bv33))), (Gamma_R0 && Gamma_#9); CF, Gamma_CF := bvnot1(bvcomp33(zero_extend1_32(bvadd32(#9, 1bv32)), bvadd33(zero_extend1_32(R0[32:0]), 4294967286bv33))), (Gamma_R0 && Gamma_#9); @@ -305,17 +305,17 @@ procedure main() } goto l00000734; l00000612: - assume {:captureState "addr:0x720"}true; + assume {:captureState "addr:l00000612"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 1bv32)), Gamma_R0; call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000625"} true; goto l00000628; l00000734: - assume {:captureState "addr:0x6a0"}true; + assume {:captureState "addr:l00000734"} true; #10, Gamma_#10 := bvadd32(R0[32:0], 4294967284bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#10, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934581bv33))), (Gamma_R0 && Gamma_#10); CF, Gamma_CF := bvnot1(bvcomp33(zero_extend1_32(bvadd32(#10, 1bv32)), bvadd33(zero_extend1_32(R0[32:0]), 4294967285bv33))), (Gamma_R0 && Gamma_#10); @@ -327,17 +327,17 @@ procedure main() } goto l00000628; l00000628: - assume {:captureState "addr:0x6a8"}true; + assume {:captureState "addr:l00000628"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 4294967291bv32)), Gamma_R0; call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x6b0"}true; + assume {:captureState "%0000063e"} true; goto l00000360; l0000075c: - assume {:captureState "addr:0x610"}true; + assume {:captureState "addr:l0000075c"} true; #11, Gamma_#11 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#11, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#11); CF, Gamma_CF := bvnot1(bvcomp33(zero_extend1_32(bvadd32(#11, 1bv32)), bvadd33(zero_extend1_32(R0[32:0]), 4294967293bv33))), (Gamma_R0 && Gamma_#11); @@ -349,7 +349,7 @@ procedure main() } goto l0000077b; l0000069c: - assume {:captureState "addr:0x6d8"}true; + assume {:captureState "addr:l0000069c"} true; R1, Gamma_R1 := 69632bv64, true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); @@ -357,17 +357,17 @@ procedure main() call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x6e4"}true; + assume {:captureState "%000006b4"} true; goto l00000360; l0000077b: - assume {:captureState "addr:0x618"}true; + assume {:captureState "addr:l0000077b"} true; assert (Gamma_ZF && (Gamma_VF && Gamma_NF)); if ((bvand1(bvcomp1(NF, VF), bvcomp1(ZF, 0bv1)) != 0bv1)) { goto l000005bc; } goto l00000784; l000005bc: - assume {:captureState "addr:0x654"}true; + assume {:captureState "addr:l000005bc"} true; #5, Gamma_#5 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#5); CF, Gamma_CF := bvnot1(bvcomp33(zero_extend1_32(bvadd32(#5, 1bv32)), bvadd33(zero_extend1_32(R0[32:0]), 4294967292bv33))), (Gamma_R0 && Gamma_#5); @@ -379,7 +379,7 @@ procedure main() } goto l00000682; l000005d6: - assume {:captureState "addr:0x6fc"}true; + assume {:captureState "addr:l000005d6"} true; R1, Gamma_R1 := 69632bv64, true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); @@ -387,10 +387,10 @@ procedure main() call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x708"}true; + assume {:captureState "%000005f3"} true; goto l00000360; l00000682: - assume {:captureState "addr:0x65c"}true; + assume {:captureState "addr:l00000682"} true; R1, Gamma_R1 := 69632bv64, true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); @@ -398,40 +398,40 @@ procedure main() call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x668"}true; + assume {:captureState "%0000069a"} true; goto l00000317; l00000317: - assume {:captureState "addr:0x66c"}true; + assume {:captureState "addr:l00000317"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 6bv32)), Gamma_R0; call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x674"}true; + assume {:captureState "%0000032f"} true; goto l00000331; l00000331: - assume {:captureState "addr:0x678"}true; + assume {:captureState "addr:l00000331"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 4294967289bv32)), Gamma_R0; call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x680"}true; + assume {:captureState "%00000344"} true; goto l00000347; l00000347: - assume {:captureState "addr:0x6c8"}true; + assume {:captureState "addr:l00000347"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 4294967295bv32)), Gamma_R0; call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x6d0"}true; + assume {:captureState "%0000035d"} true; goto l00000360; l00000784: - assume {:captureState "addr:0x61c"}true; + assume {:captureState "addr:l00000784"} true; R1, Gamma_R1 := 69632bv64, true; #12, Gamma_#12 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#12, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#12); @@ -444,17 +444,17 @@ procedure main() } goto l000007a8; l000006ba: - assume {:captureState "addr:0x6ec"}true; + assume {:captureState "addr:l000006ba"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 6bv32)), Gamma_R0; call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x6f4"}true; + assume {:captureState "%000006cd"} true; goto l000006d0; l000007a8: - assume {:captureState "addr:0x628"}true; + assume {:captureState "addr:l000007a8"} true; #13, Gamma_#13 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#13, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#13); CF, Gamma_CF := bvnot1(bvcomp33(zero_extend1_32(bvadd32(#13, 1bv32)), bvadd33(zero_extend1_32(R0[32:0]), 4294967294bv33))), (Gamma_R0 && Gamma_#13); @@ -466,37 +466,37 @@ procedure main() } goto l000006d0; l00000368: - assume {:captureState "addr:0x640"}true; + assume {:captureState "addr:l00000368"} true; assert Gamma_R0; if ((bvnot1(bvcomp32(R0[32:0], 0bv32)) != 0bv1)) { goto l0000036b; } goto l000005a3; l0000036b: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l0000036b"} true; R0, Gamma_R0 := 1bv64, true; return; l000005a3: - assume {:captureState "addr:0x644"}true; + assume {:captureState "addr:l000005a3"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 2bv32)), Gamma_R0; call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x64c"}true; + assume {:captureState "%000005b6"} true; goto l00000360; l000006d0: - assume {:captureState "addr:0x630"}true; + assume {:captureState "addr:l000006d0"} true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R1, 16bv64))), (gamma_load32(Gamma_mem, bvadd64(R1, 16bv64)) || L(mem, bvadd64(R1, 16bv64))); R0, Gamma_R0 := zero_extend32_32(bvadd32(R0[32:0], 4294967289bv32)), Gamma_R0; call rely(); assert (L(mem, bvadd64(R1, 16bv64)) ==> Gamma_R0); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 16bv64), R0[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 16bv64), Gamma_R0); - assume {:captureState "addr:0x638"}true; + assume {:captureState "%000006e6"} true; goto l00000360; l00000360: - assume {:captureState "addr:0x63c"}true; + assume {:captureState "addr:l00000360"} true; return; } diff --git a/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3.expected b/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3.expected index c8c1c38f9..910e07a93 100644 --- a/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3.expected +++ b/src/test/correct/jumptable3/gcc_no_plt_no_pic/jumptable3.expected @@ -1,69 +1,69 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvand"}bvand1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvand"} bvand1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -104,7 +104,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -113,9 +113,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure add_six() @@ -194,7 +194,7 @@ procedure add_six() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { ladd_six: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:ladd_six"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 16bv64), Gamma_R0; call rely(); @@ -205,7 +205,7 @@ procedure add_six() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x750"}true; + assume {:captureState "%0000126c"} true; return; } @@ -285,7 +285,7 @@ procedure add_two() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { ladd_two: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:ladd_two"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 16bv64), Gamma_R0; call rely(); @@ -296,7 +296,7 @@ procedure add_two() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%0000123a"} true; return; } @@ -455,18 +455,18 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x780"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%000012b1"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%000012b7"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%000012c9"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x78c"}true; + assume {:captureState "%000012d1"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967284bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934581bv33))), (Gamma_R0 && Gamma_#5); @@ -479,7 +479,7 @@ procedure main() } goto l0000133b; l0000133b: - assume {:captureState "addr:0x79c"}true; + assume {:captureState "addr:l0000133b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967284bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934581bv33))), (Gamma_R0 && Gamma_#6); @@ -492,7 +492,7 @@ procedure main() } goto l00001363; l00001363: - assume {:captureState "addr:0x7a8"}true; + assume {:captureState "addr:l00001363"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #7, Gamma_#7 := bvadd32(R0[32:0], 4294967285bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#7, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934582bv33))), (Gamma_R0 && Gamma_#7); @@ -505,35 +505,35 @@ procedure main() } goto l0000139e; l00001384: - assume {:captureState "addr:0x8ec"}true; + assume {:captureState "addr:l00001384"} true; R30, Gamma_R30 := 2288bv64, true; call sub_seven(); goto l00001390; l00001390: - assume {:captureState "addr:0x8f0"}true; + assume {:captureState "addr:l00001390"} true; R30, Gamma_R30 := 2292bv64, true; call add_two(); goto l00001397; l00001397: - assume {:captureState "addr:0x8f4"}true; + assume {:captureState "addr:l00001397"} true; R30, Gamma_R30 := 2296bv64, true; call add_six(); goto l000012f4; l000012f4: - assume {:captureState "addr:0x8f8"}true; + assume {:captureState "addr:l000012f4"} true; R30, Gamma_R30 := 2300bv64, true; call sub_seven(); goto l00001300; l00001300: - assume {:captureState "addr:0x8fc"}true; + assume {:captureState "addr:l00001300"} true; R30, Gamma_R30 := 2304bv64, true; call add_two(); goto l00001307; l00001307: - assume {:captureState "addr:0x900"}true; + assume {:captureState "addr:l00001307"} true; goto l00001308; l0000139e: - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "addr:l0000139e"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #8, Gamma_#8 := bvadd32(R0[32:0], 4294967285bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#8, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934582bv33))), (Gamma_R0 && Gamma_#8); @@ -546,7 +546,7 @@ procedure main() } goto l000013c6; l000013c6: - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "addr:l000013c6"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #9, Gamma_#9 := bvadd32(R0[32:0], 4294967286bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#9, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934583bv33))), (Gamma_R0 && Gamma_#9); @@ -559,20 +559,20 @@ procedure main() } goto l000013fe; l000013e7: - assume {:captureState "addr:0x8e0"}true; + assume {:captureState "addr:l000013e7"} true; R30, Gamma_R30 := 2276bv64, true; call add_two(); goto l000013f3; l000013f3: - assume {:captureState "addr:0x8e4"}true; + assume {:captureState "addr:l000013f3"} true; R30, Gamma_R30 := 2280bv64, true; call add_six(); goto l000013fa; l000013fa: - assume {:captureState "addr:0x8e8"}true; + assume {:captureState "addr:l000013fa"} true; goto l00001308; l000013fe: - assume {:captureState "addr:0x7cc"}true; + assume {:captureState "addr:l000013fe"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #10, Gamma_#10 := bvadd32(R0[32:0], 4294967286bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#10, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934583bv33))), (Gamma_R0 && Gamma_#10); @@ -585,7 +585,7 @@ procedure main() } goto l00001426; l00001426: - assume {:captureState "addr:0x7d8"}true; + assume {:captureState "addr:l00001426"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #11, Gamma_#11 := bvadd32(R0[32:0], 4294967287bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#11, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934584bv33))), (Gamma_R0 && Gamma_#11); @@ -598,7 +598,7 @@ procedure main() } goto l0000145e; l0000145e: - assume {:captureState "addr:0x7e4"}true; + assume {:captureState "addr:l0000145e"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #12, Gamma_#12 := bvadd32(R0[32:0], 4294967287bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#12, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934584bv33))), (Gamma_R0 && Gamma_#12); @@ -611,7 +611,7 @@ procedure main() } goto l00001486; l00001486: - assume {:captureState "addr:0x7f0"}true; + assume {:captureState "addr:l00001486"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #13, Gamma_#13 := bvadd32(R0[32:0], 4294967288bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#13, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934585bv33))), (Gamma_R0 && Gamma_#13); @@ -624,7 +624,7 @@ procedure main() } goto l000014b3; l000014b3: - assume {:captureState "addr:0x7fc"}true; + assume {:captureState "addr:l000014b3"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #14, Gamma_#14 := bvadd32(R0[32:0], 4294967288bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#14, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934585bv33))), (Gamma_R0 && Gamma_#14); @@ -637,7 +637,7 @@ procedure main() } goto l000014db; l000014db: - assume {:captureState "addr:0x808"}true; + assume {:captureState "addr:l000014db"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #15, Gamma_#15 := bvadd32(R0[32:0], 4294967289bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#15, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934586bv33))), (Gamma_R0 && Gamma_#15); @@ -650,7 +650,7 @@ procedure main() } goto l00001508; l00001508: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:l00001508"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #16, Gamma_#16 := bvadd32(R0[32:0], 4294967289bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#16, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934586bv33))), (Gamma_R0 && Gamma_#16); @@ -663,7 +663,7 @@ procedure main() } goto l00001530; l00001530: - assume {:captureState "addr:0x820"}true; + assume {:captureState "addr:l00001530"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #17, Gamma_#17 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#17, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#17); @@ -676,40 +676,40 @@ procedure main() } goto l00001564; l00001551: - assume {:captureState "addr:0x8c4"}true; + assume {:captureState "addr:l00001551"} true; R30, Gamma_R30 := 2248bv64, true; call add_six(); goto l0000155d; l0000155d: - assume {:captureState "addr:0x8c8"}true; + assume {:captureState "addr:l0000155d"} true; R30, Gamma_R30 := 2252bv64, true; call add_two(); goto l000014fc; l000014fc: - assume {:captureState "addr:0x8cc"}true; + assume {:captureState "addr:l000014fc"} true; R30, Gamma_R30 := 2256bv64, true; call add_six(); goto l000014a7; l000014a7: - assume {:captureState "addr:0x8d0"}true; + assume {:captureState "addr:l000014a7"} true; R30, Gamma_R30 := 2260bv64, true; call sub_seven(); goto l00001447; l00001447: - assume {:captureState "addr:0x8d4"}true; + assume {:captureState "addr:l00001447"} true; R30, Gamma_R30 := 2264bv64, true; call sub_seven(); goto l00001453; l00001453: - assume {:captureState "addr:0x8d8"}true; + assume {:captureState "addr:l00001453"} true; R30, Gamma_R30 := 2268bv64, true; call add_six(); goto l0000145a; l0000145a: - assume {:captureState "addr:0x8dc"}true; + assume {:captureState "addr:l0000145a"} true; goto l00001308; l00001564: - assume {:captureState "addr:0x82c"}true; + assume {:captureState "addr:l00001564"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #18, Gamma_#18 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#18, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#18); @@ -722,7 +722,7 @@ procedure main() } goto l0000158c; l0000158c: - assume {:captureState "addr:0x838"}true; + assume {:captureState "addr:l0000158c"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #19, Gamma_#19 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#19, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#19); @@ -735,15 +735,15 @@ procedure main() } goto l000015bd; l000015ad: - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "addr:l000015ad"} true; R30, Gamma_R30 := 2240bv64, true; call add_six(); goto l000015b9; l000015b9: - assume {:captureState "addr:0x8c0"}true; + assume {:captureState "addr:l000015b9"} true; goto l00001308; l000015bd: - assume {:captureState "addr:0x844"}true; + assume {:captureState "addr:l000015bd"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #20, Gamma_#20 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#20, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#20); @@ -756,7 +756,7 @@ procedure main() } goto l000015e5; l000015e5: - assume {:captureState "addr:0x850"}true; + assume {:captureState "addr:l000015e5"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #21, Gamma_#21 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#21, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#21); @@ -769,20 +769,20 @@ procedure main() } goto l0000161d; l00001606: - assume {:captureState "addr:0x8b0"}true; + assume {:captureState "addr:l00001606"} true; R30, Gamma_R30 := 2228bv64, true; call add_two(); goto l00001612; l00001612: - assume {:captureState "addr:0x8b4"}true; + assume {:captureState "addr:l00001612"} true; R30, Gamma_R30 := 2232bv64, true; call sub_seven(); goto l00001619; l00001619: - assume {:captureState "addr:0x8b8"}true; + assume {:captureState "addr:l00001619"} true; goto l00001308; l0000161d: - assume {:captureState "addr:0x85c"}true; + assume {:captureState "addr:l0000161d"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #22, Gamma_#22 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#22, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#22); @@ -795,7 +795,7 @@ procedure main() } goto l00001645; l00001645: - assume {:captureState "addr:0x868"}true; + assume {:captureState "addr:l00001645"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #23, Gamma_#23 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#23, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#23); @@ -808,7 +808,7 @@ procedure main() } goto l00001676; l00001676: - assume {:captureState "addr:0x874"}true; + assume {:captureState "addr:l00001676"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #24, Gamma_#24 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#24, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#24); @@ -821,7 +821,7 @@ procedure main() } goto l0000169e; l0000169e: - assume {:captureState "addr:0x880"}true; + assume {:captureState "addr:l0000169e"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #25, Gamma_#25 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#25, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#25); @@ -834,15 +834,15 @@ procedure main() } goto l000016d6; l000016bf: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l000016bf"} true; R30, Gamma_R30 := 2208bv64, true; call add_two(); goto l000016cb; l000016cb: - assume {:captureState "addr:0x8a0"}true; + assume {:captureState "addr:l000016cb"} true; goto l00001308; l000016d6: - assume {:captureState "addr:0x88c"}true; + assume {:captureState "addr:l000016d6"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #26, Gamma_#26 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#26, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#26); @@ -855,34 +855,34 @@ procedure main() } goto l000016fc; l000016cf: - assume {:captureState "addr:0x8a4"}true; + assume {:captureState "addr:l000016cf"} true; R30, Gamma_R30 := 2216bv64, true; call add_six(); goto l00001666; l00001666: - assume {:captureState "addr:0x8a8"}true; + assume {:captureState "addr:l00001666"} true; R30, Gamma_R30 := 2220bv64, true; call sub_seven(); goto l00001672; l00001672: - assume {:captureState "addr:0x8ac"}true; + assume {:captureState "addr:l00001672"} true; goto l00001308; l00001308: - assume {:captureState "addr:0x90c"}true; + assume {:captureState "addr:l00001308"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 16bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); goto l0000131d; l000016fc: - assume {:captureState "addr:0x898"}true; + assume {:captureState "addr:l000016fc"} true; goto l00001332; l00001332: - assume {:captureState "addr:0x904"}true; + assume {:captureState "addr:l00001332"} true; R0, Gamma_R0 := 1bv64, true; goto l0000131d; l0000131d: - assume {:captureState "addr:0x918"}true; + assume {:captureState "addr:l0000131d"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; @@ -965,7 +965,7 @@ procedure sub_seven() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lsub_seven: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:lsub_seven"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 16bv64), Gamma_R0; call rely(); @@ -976,6 +976,6 @@ procedure sub_seven() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x774"}true; + assume {:captureState "%0000129e"} true; return; } diff --git a/src/test/correct/jumptable3/gcc_pic/jumptable3.expected b/src/test/correct/jumptable3/gcc_pic/jumptable3.expected index 98d58c4b2..c69c316c7 100644 --- a/src/test/correct/jumptable3/gcc_pic/jumptable3.expected +++ b/src/test/correct/jumptable3/gcc_pic/jumptable3.expected @@ -1,69 +1,69 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvand"}bvand1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvand"} bvand1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -112,7 +112,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69014bv64) == 0bv8); free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -121,9 +121,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure add_six() @@ -218,7 +218,7 @@ procedure add_six() free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); { ladd_six: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:ladd_six"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -231,7 +231,7 @@ procedure add_six() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x790"}true; + assume {:captureState "%00000515"} true; return; } @@ -327,7 +327,7 @@ procedure add_two() free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); { ladd_two: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:ladd_two"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -340,7 +340,7 @@ procedure add_two() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%000004e1"} true; return; } @@ -515,18 +515,18 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "%0000055c"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "%00000562"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x7c8"}true; + assume {:captureState "%00000574"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x7cc"}true; + assume {:captureState "%0000057c"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967284bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934581bv33))), (Gamma_R0 && Gamma_#5); @@ -539,7 +539,7 @@ procedure main() } goto l000005e7; l000005e7: - assume {:captureState "addr:0x7dc"}true; + assume {:captureState "addr:l000005e7"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967284bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934581bv33))), (Gamma_R0 && Gamma_#6); @@ -552,7 +552,7 @@ procedure main() } goto l0000060f; l0000060f: - assume {:captureState "addr:0x7e8"}true; + assume {:captureState "addr:l0000060f"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #7, Gamma_#7 := bvadd32(R0[32:0], 4294967285bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#7, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934582bv33))), (Gamma_R0 && Gamma_#7); @@ -565,35 +565,35 @@ procedure main() } goto l0000064a; l00000630: - assume {:captureState "addr:0x92c"}true; + assume {:captureState "addr:l00000630"} true; R30, Gamma_R30 := 2352bv64, true; call sub_seven(); goto l0000063c; l0000063c: - assume {:captureState "addr:0x930"}true; + assume {:captureState "addr:l0000063c"} true; R30, Gamma_R30 := 2356bv64, true; call add_two(); goto l00000643; l00000643: - assume {:captureState "addr:0x934"}true; + assume {:captureState "addr:l00000643"} true; R30, Gamma_R30 := 2360bv64, true; call add_six(); goto l0000059f; l0000059f: - assume {:captureState "addr:0x938"}true; + assume {:captureState "addr:l0000059f"} true; R30, Gamma_R30 := 2364bv64, true; call sub_seven(); goto l000005ab; l000005ab: - assume {:captureState "addr:0x93c"}true; + assume {:captureState "addr:l000005ab"} true; R30, Gamma_R30 := 2368bv64, true; call add_two(); goto l000005b2; l000005b2: - assume {:captureState "addr:0x940"}true; + assume {:captureState "addr:l000005b2"} true; goto l000005b3; l0000064a: - assume {:captureState "addr:0x7f4"}true; + assume {:captureState "addr:l0000064a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #8, Gamma_#8 := bvadd32(R0[32:0], 4294967285bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#8, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934582bv33))), (Gamma_R0 && Gamma_#8); @@ -606,7 +606,7 @@ procedure main() } goto l00000672; l00000672: - assume {:captureState "addr:0x800"}true; + assume {:captureState "addr:l00000672"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #9, Gamma_#9 := bvadd32(R0[32:0], 4294967286bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#9, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934583bv33))), (Gamma_R0 && Gamma_#9); @@ -619,20 +619,20 @@ procedure main() } goto l000006aa; l00000693: - assume {:captureState "addr:0x920"}true; + assume {:captureState "addr:l00000693"} true; R30, Gamma_R30 := 2340bv64, true; call add_two(); goto l0000069f; l0000069f: - assume {:captureState "addr:0x924"}true; + assume {:captureState "addr:l0000069f"} true; R30, Gamma_R30 := 2344bv64, true; call add_six(); goto l000006a6; l000006a6: - assume {:captureState "addr:0x928"}true; + assume {:captureState "addr:l000006a6"} true; goto l000005b3; l000006aa: - assume {:captureState "addr:0x80c"}true; + assume {:captureState "addr:l000006aa"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #10, Gamma_#10 := bvadd32(R0[32:0], 4294967286bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#10, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934583bv33))), (Gamma_R0 && Gamma_#10); @@ -645,7 +645,7 @@ procedure main() } goto l000006d2; l000006d2: - assume {:captureState "addr:0x818"}true; + assume {:captureState "addr:l000006d2"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #11, Gamma_#11 := bvadd32(R0[32:0], 4294967287bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#11, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934584bv33))), (Gamma_R0 && Gamma_#11); @@ -658,7 +658,7 @@ procedure main() } goto l0000070a; l0000070a: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l0000070a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #12, Gamma_#12 := bvadd32(R0[32:0], 4294967287bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#12, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934584bv33))), (Gamma_R0 && Gamma_#12); @@ -671,7 +671,7 @@ procedure main() } goto l00000732; l00000732: - assume {:captureState "addr:0x830"}true; + assume {:captureState "addr:l00000732"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #13, Gamma_#13 := bvadd32(R0[32:0], 4294967288bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#13, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934585bv33))), (Gamma_R0 && Gamma_#13); @@ -684,7 +684,7 @@ procedure main() } goto l0000075f; l0000075f: - assume {:captureState "addr:0x83c"}true; + assume {:captureState "addr:l0000075f"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #14, Gamma_#14 := bvadd32(R0[32:0], 4294967288bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#14, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934585bv33))), (Gamma_R0 && Gamma_#14); @@ -697,7 +697,7 @@ procedure main() } goto l00000787; l00000787: - assume {:captureState "addr:0x848"}true; + assume {:captureState "addr:l00000787"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #15, Gamma_#15 := bvadd32(R0[32:0], 4294967289bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#15, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934586bv33))), (Gamma_R0 && Gamma_#15); @@ -710,7 +710,7 @@ procedure main() } goto l000007b4; l000007b4: - assume {:captureState "addr:0x854"}true; + assume {:captureState "addr:l000007b4"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #16, Gamma_#16 := bvadd32(R0[32:0], 4294967289bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#16, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934586bv33))), (Gamma_R0 && Gamma_#16); @@ -723,7 +723,7 @@ procedure main() } goto l000007dc; l000007dc: - assume {:captureState "addr:0x860"}true; + assume {:captureState "addr:l000007dc"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #17, Gamma_#17 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#17, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#17); @@ -736,40 +736,40 @@ procedure main() } goto l00000810; l000007fd: - assume {:captureState "addr:0x904"}true; + assume {:captureState "addr:l000007fd"} true; R30, Gamma_R30 := 2312bv64, true; call add_six(); goto l00000809; l00000809: - assume {:captureState "addr:0x908"}true; + assume {:captureState "addr:l00000809"} true; R30, Gamma_R30 := 2316bv64, true; call add_two(); goto l000007a8; l000007a8: - assume {:captureState "addr:0x90c"}true; + assume {:captureState "addr:l000007a8"} true; R30, Gamma_R30 := 2320bv64, true; call add_six(); goto l00000753; l00000753: - assume {:captureState "addr:0x910"}true; + assume {:captureState "addr:l00000753"} true; R30, Gamma_R30 := 2324bv64, true; call sub_seven(); goto l000006f3; l000006f3: - assume {:captureState "addr:0x914"}true; + assume {:captureState "addr:l000006f3"} true; R30, Gamma_R30 := 2328bv64, true; call sub_seven(); goto l000006ff; l000006ff: - assume {:captureState "addr:0x918"}true; + assume {:captureState "addr:l000006ff"} true; R30, Gamma_R30 := 2332bv64, true; call add_six(); goto l00000706; l00000706: - assume {:captureState "addr:0x91c"}true; + assume {:captureState "addr:l00000706"} true; goto l000005b3; l00000810: - assume {:captureState "addr:0x86c"}true; + assume {:captureState "addr:l00000810"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #18, Gamma_#18 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#18, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#18); @@ -782,7 +782,7 @@ procedure main() } goto l00000838; l00000838: - assume {:captureState "addr:0x878"}true; + assume {:captureState "addr:l00000838"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #19, Gamma_#19 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#19, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#19); @@ -795,15 +795,15 @@ procedure main() } goto l00000869; l00000859: - assume {:captureState "addr:0x8fc"}true; + assume {:captureState "addr:l00000859"} true; R30, Gamma_R30 := 2304bv64, true; call add_six(); goto l00000865; l00000865: - assume {:captureState "addr:0x900"}true; + assume {:captureState "addr:l00000865"} true; goto l000005b3; l00000869: - assume {:captureState "addr:0x884"}true; + assume {:captureState "addr:l00000869"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #20, Gamma_#20 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#20, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#20); @@ -816,7 +816,7 @@ procedure main() } goto l00000891; l00000891: - assume {:captureState "addr:0x890"}true; + assume {:captureState "addr:l00000891"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #21, Gamma_#21 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#21, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#21); @@ -829,20 +829,20 @@ procedure main() } goto l000008c9; l000008b2: - assume {:captureState "addr:0x8f0"}true; + assume {:captureState "addr:l000008b2"} true; R30, Gamma_R30 := 2292bv64, true; call add_two(); goto l000008be; l000008be: - assume {:captureState "addr:0x8f4"}true; + assume {:captureState "addr:l000008be"} true; R30, Gamma_R30 := 2296bv64, true; call sub_seven(); goto l000008c5; l000008c5: - assume {:captureState "addr:0x8f8"}true; + assume {:captureState "addr:l000008c5"} true; goto l000005b3; l000008c9: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l000008c9"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #22, Gamma_#22 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#22, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#22); @@ -855,7 +855,7 @@ procedure main() } goto l000008f1; l000008f1: - assume {:captureState "addr:0x8a8"}true; + assume {:captureState "addr:l000008f1"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #23, Gamma_#23 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#23, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#23); @@ -868,7 +868,7 @@ procedure main() } goto l00000922; l00000922: - assume {:captureState "addr:0x8b4"}true; + assume {:captureState "addr:l00000922"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #24, Gamma_#24 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#24, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#24); @@ -881,7 +881,7 @@ procedure main() } goto l0000094a; l0000094a: - assume {:captureState "addr:0x8c0"}true; + assume {:captureState "addr:l0000094a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #25, Gamma_#25 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#25, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#25); @@ -894,15 +894,15 @@ procedure main() } goto l00000982; l0000096b: - assume {:captureState "addr:0x8dc"}true; + assume {:captureState "addr:l0000096b"} true; R30, Gamma_R30 := 2272bv64, true; call add_two(); goto l00000977; l00000977: - assume {:captureState "addr:0x8e0"}true; + assume {:captureState "addr:l00000977"} true; goto l000005b3; l00000982: - assume {:captureState "addr:0x8cc"}true; + assume {:captureState "addr:l00000982"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #26, Gamma_#26 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#26, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#26); @@ -915,20 +915,20 @@ procedure main() } goto l000009a8; l0000097b: - assume {:captureState "addr:0x8e4"}true; + assume {:captureState "addr:l0000097b"} true; R30, Gamma_R30 := 2280bv64, true; call add_six(); goto l00000912; l00000912: - assume {:captureState "addr:0x8e8"}true; + assume {:captureState "addr:l00000912"} true; R30, Gamma_R30 := 2284bv64, true; call sub_seven(); goto l0000091e; l0000091e: - assume {:captureState "addr:0x8ec"}true; + assume {:captureState "addr:l0000091e"} true; goto l000005b3; l000005b3: - assume {:captureState "addr:0x94c"}true; + assume {:captureState "addr:l000005b3"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -936,14 +936,14 @@ procedure main() R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); goto l000005c9; l000009a8: - assume {:captureState "addr:0x8d8"}true; + assume {:captureState "addr:l000009a8"} true; goto l000005de; l000005de: - assume {:captureState "addr:0x944"}true; + assume {:captureState "addr:l000005de"} true; R0, Gamma_R0 := 1bv64, true; goto l000005c9; l000005c9: - assume {:captureState "addr:0x958"}true; + assume {:captureState "addr:l000005c9"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; @@ -1042,7 +1042,7 @@ procedure sub_seven() free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); { lsub_seven: - assume {:captureState "addr:0x79c"}true; + assume {:captureState "addr:lsub_seven"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -1055,6 +1055,6 @@ procedure sub_seven() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "%00000549"} true; return; } diff --git a/src/test/correct/malloc_with_local/clang/malloc_with_local.expected b/src/test/correct/malloc_with_local/clang/malloc_with_local.expected index 1883bb73b..ce31f45fd 100644 --- a/src/test/correct/malloc_with_local/clang/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/clang/malloc_with_local.expected @@ -1,83 +1,83 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2256bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2256bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -178,7 +178,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -187,9 +187,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -607,50 +607,50 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000362"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000368"} true; R29, Gamma_R29 := bvadd64(R31, 32bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, R31, R8[32:0]), gamma_store32(Gamma_stack, R31, Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%0000037b"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%00000382"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l00000391; l00000391: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l00000391"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%00000397"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2112bv64, true; call malloc(); goto l000003a5; l000003a5: - assume {:captureState "addr:0x840"}true; + assume {:captureState "addr:l000003a5"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%000003ab"} true; R8, Gamma_R8 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x848"}true; + assume {:captureState "%000003b8"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%000003cc"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x860"}true; + assume {:captureState "%000003e0"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -660,7 +660,7 @@ procedure main() call printf(); goto l00000403; l00000403: - assume {:captureState "addr:0x878"}true; + assume {:captureState "addr:l00000403"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -670,7 +670,7 @@ procedure main() call printf(); goto l00000423; l00000423: - assume {:captureState "addr:0x88c"}true; + assume {:captureState "addr:l00000423"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2293bv64), Gamma_R0; @@ -678,19 +678,19 @@ procedure main() call printf(); goto l0000043c; l0000043c: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l0000043c"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R30, Gamma_R30 := 2212bv64, true; call #free(); goto l0000044b; l0000044b: - assume {:captureState "addr:0x8a4"}true; + assume {:captureState "addr:l0000044b"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R30, Gamma_R30 := 2220bv64, true; call #free(); goto l00000459; l00000459: - assume {:captureState "addr:0x8ac"}true; + assume {:captureState "addr:l00000459"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, R31)), gamma_load32(Gamma_stack, R31); #5, Gamma_#5 := bvadd64(R31, 32bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/malloc_with_local/clang_O2/malloc_with_local.expected b/src/test/correct/malloc_with_local/clang_O2/malloc_with_local.expected index 9d23a723c..6e1fa0e08 100644 --- a/src/test/correct/malloc_with_local/clang_O2/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/clang_O2/malloc_with_local.expected @@ -1,45 +1,45 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1964bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1964bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -140,7 +140,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69686bv64) == 0bv8); free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -149,9 +149,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -372,12 +372,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002f8"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002fe"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 0bv64, true; @@ -387,7 +387,7 @@ procedure main() call printf(); goto l00000322; l00000322: - assume {:captureState "addr:0x76c"}true; + assume {:captureState "addr:l00000322"} true; R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 1985bv64), Gamma_R0; R1, Gamma_R1 := 42bv64, true; @@ -395,7 +395,7 @@ procedure main() call printf(); goto l00000339; l00000339: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l00000339"} true; R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2001bv64), Gamma_R0; R1, Gamma_R1 := 10bv64, true; @@ -403,7 +403,7 @@ procedure main() call printf(); goto l00000350; l00000350: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l00000350"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local.expected b/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local.expected index 4ebaee775..c70421f04 100644 --- a/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/clang_no_plt_no_pic/malloc_with_local.expected @@ -1,83 +1,83 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2256bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2256bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -178,7 +178,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -187,9 +187,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -607,50 +607,50 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000ad4"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000ada"} true; R29, Gamma_R29 := bvadd64(R31, 32bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, R31, R8[32:0]), gamma_store32(Gamma_stack, R31, Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000aed"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%00000af4"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l00000b03; l00000b03: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l00000b03"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%00000b09"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2112bv64, true; call malloc(); goto l00000b17; l00000b17: - assume {:captureState "addr:0x840"}true; + assume {:captureState "addr:l00000b17"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%00000b1d"} true; R8, Gamma_R8 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x848"}true; + assume {:captureState "%00000b2a"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000b3e"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x860"}true; + assume {:captureState "%00000b52"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -660,7 +660,7 @@ procedure main() call printf(); goto l00000b75; l00000b75: - assume {:captureState "addr:0x878"}true; + assume {:captureState "addr:l00000b75"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -670,7 +670,7 @@ procedure main() call printf(); goto l00000b95; l00000b95: - assume {:captureState "addr:0x88c"}true; + assume {:captureState "addr:l00000b95"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2293bv64), Gamma_R0; @@ -678,19 +678,19 @@ procedure main() call printf(); goto l00000bae; l00000bae: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l00000bae"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R30, Gamma_R30 := 2212bv64, true; call #free(); goto l00000bbd; l00000bbd: - assume {:captureState "addr:0x8a4"}true; + assume {:captureState "addr:l00000bbd"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R30, Gamma_R30 := 2220bv64, true; call #free(); goto l00000bcb; l00000bcb: - assume {:captureState "addr:0x8ac"}true; + assume {:captureState "addr:l00000bcb"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, R31)), gamma_load32(Gamma_stack, R31); #5, Gamma_#5 := bvadd64(R31, 32bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/malloc_with_local/clang_pic/malloc_with_local.expected b/src/test/correct/malloc_with_local/clang_pic/malloc_with_local.expected index 4ebaee775..c70421f04 100644 --- a/src/test/correct/malloc_with_local/clang_pic/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/clang_pic/malloc_with_local.expected @@ -1,83 +1,83 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2256bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2256bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -178,7 +178,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -187,9 +187,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -607,50 +607,50 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000ad4"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000ada"} true; R29, Gamma_R29 := bvadd64(R31, 32bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, R31, R8[32:0]), gamma_store32(Gamma_stack, R31, Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000aed"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%00000af4"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l00000b03; l00000b03: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l00000b03"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%00000b09"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2112bv64, true; call malloc(); goto l00000b17; l00000b17: - assume {:captureState "addr:0x840"}true; + assume {:captureState "addr:l00000b17"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%00000b1d"} true; R8, Gamma_R8 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x848"}true; + assume {:captureState "%00000b2a"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000b3e"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x860"}true; + assume {:captureState "%00000b52"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -660,7 +660,7 @@ procedure main() call printf(); goto l00000b75; l00000b75: - assume {:captureState "addr:0x878"}true; + assume {:captureState "addr:l00000b75"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -670,7 +670,7 @@ procedure main() call printf(); goto l00000b95; l00000b95: - assume {:captureState "addr:0x88c"}true; + assume {:captureState "addr:l00000b95"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2293bv64), Gamma_R0; @@ -678,19 +678,19 @@ procedure main() call printf(); goto l00000bae; l00000bae: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l00000bae"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R30, Gamma_R30 := 2212bv64, true; call #free(); goto l00000bbd; l00000bbd: - assume {:captureState "addr:0x8a4"}true; + assume {:captureState "addr:l00000bbd"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R30, Gamma_R30 := 2220bv64, true; call #free(); goto l00000bcb; l00000bcb: - assume {:captureState "addr:0x8ac"}true; + assume {:captureState "addr:l00000bcb"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, R31)), gamma_load32(Gamma_stack, R31); #5, Gamma_#5 := bvadd64(R31, 32bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/malloc_with_local/gcc/malloc_with_local.expected b/src/test/correct/malloc_with_local/gcc/malloc_with_local.expected index c8c8180d9..2219ee6ab 100644 --- a/src/test/correct/malloc_with_local/gcc/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/gcc/malloc_with_local.expected @@ -1,79 +1,79 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2248bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2248bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -185,7 +185,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -194,9 +194,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -656,12 +656,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000350"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000356"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -669,32 +669,32 @@ procedure main() call malloc(); goto l0000036f; l0000036f: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l0000036f"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 32bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000375"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2096bv64, true; call malloc(); goto l00000383; l00000383: - assume {:captureState "addr:0x830"}true; + assume {:captureState "addr:l00000383"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 40bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 40bv64), Gamma_R0); - assume {:captureState "addr:0x830"}true; + assume {:captureState "%00000389"} true; R0, Gamma_R0 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x838"}true; + assume {:captureState "%00000396"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x844"}true; + assume {:captureState "%000003aa"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x850"}true; + assume {:captureState "%000003be"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -705,7 +705,7 @@ procedure main() call printf(); goto l000003e7; l000003e7: - assume {:captureState "addr:0x86c"}true; + assume {:captureState "addr:l000003e7"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -716,7 +716,7 @@ procedure main() call printf(); goto l0000040d; l0000040d: - assume {:captureState "addr:0x884"}true; + assume {:captureState "addr:l0000040d"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2296bv64), Gamma_R0; @@ -724,19 +724,19 @@ procedure main() call printf(); goto l00000426; l00000426: - assume {:captureState "addr:0x894"}true; + assume {:captureState "addr:l00000426"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R30, Gamma_R30 := 2204bv64, true; call #free(); goto l00000435; l00000435: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l00000435"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2212bv64, true; call #free(); goto l00000443; l00000443: - assume {:captureState "addr:0x8a4"}true; + assume {:captureState "addr:l00000443"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local.expected b/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local.expected index 023c5c714..e680279cb 100644 --- a/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/gcc_O2/malloc_with_local.expected @@ -1,47 +1,47 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R2: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2088bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R2: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2088bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -153,7 +153,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -162,9 +162,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure __printf_chk(); @@ -624,12 +624,12 @@ procedure main() var #1: bv64; var Gamma_#1: bool; lmain: - assume {:captureState "addr:0x680"}true; + assume {:captureState "addr:lmain"} true; #1, Gamma_#1 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #1, R29), gamma_store64(Gamma_stack, #1, Gamma_R29); - assume {:captureState "addr:0x680"}true; + assume {:captureState "%000001f2"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#1, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#1, 8bv64), Gamma_R30); - assume {:captureState "addr:0x680"}true; + assume {:captureState "%000001f8"} true; R31, Gamma_R31 := #1, Gamma_#1; R2, Gamma_R2 := 65bv64, true; R1, Gamma_R1 := 0bv64, true; @@ -640,7 +640,7 @@ procedure main() call __printf_chk(); goto l00000221; l00000221: - assume {:captureState "addr:0x69c"}true; + assume {:captureState "addr:l00000221"} true; R2, Gamma_R2 := 42bv64, true; R1, Gamma_R1 := 0bv64, true; R0, Gamma_R0 := 1bv64, true; @@ -649,7 +649,7 @@ procedure main() call __printf_chk(); goto l0000023d; l0000023d: - assume {:captureState "addr:0x6b0"}true; + assume {:captureState "addr:l0000023d"} true; R2, Gamma_R2 := 10bv64, true; R1, Gamma_R1 := 0bv64, true; R0, Gamma_R0 := 1bv64, true; @@ -658,7 +658,7 @@ procedure main() call __printf_chk(); goto l00000259; l00000259: - assume {:captureState "addr:0x6c4"}true; + assume {:captureState "addr:l00000259"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local.expected b/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local.expected index 438bb13d4..d4716b196 100644 --- a/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/gcc_no_plt_no_pic/malloc_with_local.expected @@ -1,79 +1,79 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2248bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2248bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -185,7 +185,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -194,9 +194,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -656,12 +656,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000aa1"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000aa7"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -669,32 +669,32 @@ procedure main() call malloc(); goto l00000ac0; l00000ac0: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l00000ac0"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 32bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000ac6"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2096bv64, true; call malloc(); goto l00000ad4; l00000ad4: - assume {:captureState "addr:0x830"}true; + assume {:captureState "addr:l00000ad4"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 40bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 40bv64), Gamma_R0); - assume {:captureState "addr:0x830"}true; + assume {:captureState "%00000ada"} true; R0, Gamma_R0 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x838"}true; + assume {:captureState "%00000ae7"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x844"}true; + assume {:captureState "%00000afb"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x850"}true; + assume {:captureState "%00000b0f"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -705,7 +705,7 @@ procedure main() call printf(); goto l00000b38; l00000b38: - assume {:captureState "addr:0x86c"}true; + assume {:captureState "addr:l00000b38"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -716,7 +716,7 @@ procedure main() call printf(); goto l00000b5e; l00000b5e: - assume {:captureState "addr:0x884"}true; + assume {:captureState "addr:l00000b5e"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2296bv64), Gamma_R0; @@ -724,19 +724,19 @@ procedure main() call printf(); goto l00000b77; l00000b77: - assume {:captureState "addr:0x894"}true; + assume {:captureState "addr:l00000b77"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R30, Gamma_R30 := 2204bv64, true; call #free(); goto l00000b86; l00000b86: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l00000b86"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2212bv64, true; call #free(); goto l00000b94; l00000b94: - assume {:captureState "addr:0x8a4"}true; + assume {:captureState "addr:l00000b94"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local.expected b/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local.expected index 438bb13d4..d4716b196 100644 --- a/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local.expected +++ b/src/test/correct/malloc_with_local/gcc_pic/malloc_with_local.expected @@ -1,79 +1,79 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2248bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2248bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -185,7 +185,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -194,9 +194,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -656,12 +656,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000aa1"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000aa7"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -669,32 +669,32 @@ procedure main() call malloc(); goto l00000ac0; l00000ac0: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l00000ac0"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 32bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000ac6"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2096bv64, true; call malloc(); goto l00000ad4; l00000ad4: - assume {:captureState "addr:0x830"}true; + assume {:captureState "addr:l00000ad4"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 40bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 40bv64), Gamma_R0); - assume {:captureState "addr:0x830"}true; + assume {:captureState "%00000ada"} true; R0, Gamma_R0 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x838"}true; + assume {:captureState "%00000ae7"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x844"}true; + assume {:captureState "%00000afb"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x850"}true; + assume {:captureState "%00000b0f"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -705,7 +705,7 @@ procedure main() call printf(); goto l00000b38; l00000b38: - assume {:captureState "addr:0x86c"}true; + assume {:captureState "addr:l00000b38"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -716,7 +716,7 @@ procedure main() call printf(); goto l00000b5e; l00000b5e: - assume {:captureState "addr:0x884"}true; + assume {:captureState "addr:l00000b5e"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2296bv64), Gamma_R0; @@ -724,19 +724,19 @@ procedure main() call printf(); goto l00000b77; l00000b77: - assume {:captureState "addr:0x894"}true; + assume {:captureState "addr:l00000b77"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R30, Gamma_R30 := 2204bv64, true; call #free(); goto l00000b86; l00000b86: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l00000b86"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2212bv64, true; call #free(); goto l00000b94; l00000b94: - assume {:captureState "addr:0x8a4"}true; + assume {:captureState "addr:l00000b94"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/malloc_with_local2/clang/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/clang/malloc_with_local2.expected index 6e3304845..7b71ddd4c 100644 --- a/src/test/correct/malloc_with_local2/clang/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/clang/malloc_with_local2.expected @@ -1,83 +1,83 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2292bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2292bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -178,7 +178,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -187,9 +187,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -607,67 +607,67 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551536bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 64bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000386"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%0000038c"} true; R29, Gamma_R29 := bvadd64(R31, 64bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%0000039f"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%000003a6"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l000003b5; l000003b5: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l000003b5"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R29, 18446744073709551600bv64), R0), gamma_store64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%000003bb"} true; R8, Gamma_R8 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551596bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551596bv64), Gamma_R8); - assume {:captureState "addr:0x83c"}true; + assume {:captureState "%000003c8"} true; R0, Gamma_R0 := 4bv64, true; stack, Gamma_stack := memory_store64_le(stack, R31, R0), gamma_store64(Gamma_stack, R31, Gamma_R0); - assume {:captureState "addr:0x844"}true; + assume {:captureState "%000003d5"} true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l000003de; l000003de: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l000003de"} true; R8, Gamma_R8 := R0, Gamma_R0; R0, Gamma_R0 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 32bv64), R8), gamma_store64(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R8); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%000003f1"} true; R8, Gamma_R8 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R8); - assume {:captureState "addr:0x85c"}true; + assume {:captureState "%000003fe"} true; R30, Gamma_R30 := 2148bv64, true; call malloc(); goto l00000407; l00000407: - assume {:captureState "addr:0x864"}true; + assume {:captureState "addr:l00000407"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x864"}true; + assume {:captureState "%0000040d"} true; R8, Gamma_R8 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%0000041a"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x878"}true; + assume {:captureState "%0000042e"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x884"}true; + assume {:captureState "%00000442"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -677,7 +677,7 @@ procedure main() call printf(); goto l00000465; l00000465: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l00000465"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -687,7 +687,7 @@ procedure main() call printf(); goto l00000485; l00000485: - assume {:captureState "addr:0x8b0"}true; + assume {:captureState "addr:l00000485"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2329bv64), Gamma_R0; @@ -695,19 +695,19 @@ procedure main() call printf(); goto l0000049e; l0000049e: - assume {:captureState "addr:0x8c0"}true; + assume {:captureState "addr:l0000049e"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R30, Gamma_R30 := 2248bv64, true; call #free(); goto l000004ad; l000004ad: - assume {:captureState "addr:0x8c8"}true; + assume {:captureState "addr:l000004ad"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R30, Gamma_R30 := 2256bv64, true; call #free(); goto l000004bb; l000004bb: - assume {:captureState "addr:0x8d0"}true; + assume {:captureState "addr:l000004bb"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd64(R31, 64bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2.expected index 9d23a723c..6e1fa0e08 100644 --- a/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/clang_O2/malloc_with_local2.expected @@ -1,45 +1,45 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1964bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1964bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -140,7 +140,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69686bv64) == 0bv8); free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -149,9 +149,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -372,12 +372,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002f8"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002fe"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 0bv64, true; @@ -387,7 +387,7 @@ procedure main() call printf(); goto l00000322; l00000322: - assume {:captureState "addr:0x76c"}true; + assume {:captureState "addr:l00000322"} true; R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 1985bv64), Gamma_R0; R1, Gamma_R1 := 42bv64, true; @@ -395,7 +395,7 @@ procedure main() call printf(); goto l00000339; l00000339: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l00000339"} true; R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2001bv64), Gamma_R0; R1, Gamma_R1 := 10bv64, true; @@ -403,7 +403,7 @@ procedure main() call printf(); goto l00000350; l00000350: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l00000350"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2.expected index b677f7d99..29511831b 100644 --- a/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/clang_no_plt_no_pic/malloc_with_local2.expected @@ -1,83 +1,83 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2292bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2292bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -178,7 +178,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -187,9 +187,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -607,67 +607,67 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551536bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 64bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000b63"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000b69"} true; R29, Gamma_R29 := bvadd64(R31, 64bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000b7c"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%00000b83"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l00000b92; l00000b92: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l00000b92"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R29, 18446744073709551600bv64), R0), gamma_store64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%00000b98"} true; R8, Gamma_R8 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551596bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551596bv64), Gamma_R8); - assume {:captureState "addr:0x83c"}true; + assume {:captureState "%00000ba5"} true; R0, Gamma_R0 := 4bv64, true; stack, Gamma_stack := memory_store64_le(stack, R31, R0), gamma_store64(Gamma_stack, R31, Gamma_R0); - assume {:captureState "addr:0x844"}true; + assume {:captureState "%00000bb2"} true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l00000bbb; l00000bbb: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l00000bbb"} true; R8, Gamma_R8 := R0, Gamma_R0; R0, Gamma_R0 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 32bv64), R8), gamma_store64(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R8); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000bce"} true; R8, Gamma_R8 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R8); - assume {:captureState "addr:0x85c"}true; + assume {:captureState "%00000bdb"} true; R30, Gamma_R30 := 2148bv64, true; call malloc(); goto l00000be4; l00000be4: - assume {:captureState "addr:0x864"}true; + assume {:captureState "addr:l00000be4"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x864"}true; + assume {:captureState "%00000bea"} true; R8, Gamma_R8 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%00000bf7"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x878"}true; + assume {:captureState "%00000c0b"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x884"}true; + assume {:captureState "%00000c1f"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -677,7 +677,7 @@ procedure main() call printf(); goto l00000c42; l00000c42: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l00000c42"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -687,7 +687,7 @@ procedure main() call printf(); goto l00000c62; l00000c62: - assume {:captureState "addr:0x8b0"}true; + assume {:captureState "addr:l00000c62"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2329bv64), Gamma_R0; @@ -695,19 +695,19 @@ procedure main() call printf(); goto l00000c7b; l00000c7b: - assume {:captureState "addr:0x8c0"}true; + assume {:captureState "addr:l00000c7b"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R30, Gamma_R30 := 2248bv64, true; call #free(); goto l00000c8a; l00000c8a: - assume {:captureState "addr:0x8c8"}true; + assume {:captureState "addr:l00000c8a"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R30, Gamma_R30 := 2256bv64, true; call #free(); goto l00000c98; l00000c98: - assume {:captureState "addr:0x8d0"}true; + assume {:captureState "addr:l00000c98"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd64(R31, 64bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2.expected index b677f7d99..29511831b 100644 --- a/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/clang_pic/malloc_with_local2.expected @@ -1,83 +1,83 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2292bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2292bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -178,7 +178,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -187,9 +187,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -607,67 +607,67 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551536bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 64bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000b63"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000b69"} true; R29, Gamma_R29 := bvadd64(R31, 64bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000b7c"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%00000b83"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l00000b92; l00000b92: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l00000b92"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R29, 18446744073709551600bv64), R0), gamma_store64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%00000b98"} true; R8, Gamma_R8 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551596bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551596bv64), Gamma_R8); - assume {:captureState "addr:0x83c"}true; + assume {:captureState "%00000ba5"} true; R0, Gamma_R0 := 4bv64, true; stack, Gamma_stack := memory_store64_le(stack, R31, R0), gamma_store64(Gamma_stack, R31, Gamma_R0); - assume {:captureState "addr:0x844"}true; + assume {:captureState "%00000bb2"} true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l00000bbb; l00000bbb: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l00000bbb"} true; R8, Gamma_R8 := R0, Gamma_R0; R0, Gamma_R0 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 32bv64), R8), gamma_store64(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R8); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000bce"} true; R8, Gamma_R8 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R8); - assume {:captureState "addr:0x85c"}true; + assume {:captureState "%00000bdb"} true; R30, Gamma_R30 := 2148bv64, true; call malloc(); goto l00000be4; l00000be4: - assume {:captureState "addr:0x864"}true; + assume {:captureState "addr:l00000be4"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x864"}true; + assume {:captureState "%00000bea"} true; R8, Gamma_R8 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%00000bf7"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x878"}true; + assume {:captureState "%00000c0b"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x884"}true; + assume {:captureState "%00000c1f"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -677,7 +677,7 @@ procedure main() call printf(); goto l00000c42; l00000c42: - assume {:captureState "addr:0x89c"}true; + assume {:captureState "addr:l00000c42"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -687,7 +687,7 @@ procedure main() call printf(); goto l00000c62; l00000c62: - assume {:captureState "addr:0x8b0"}true; + assume {:captureState "addr:l00000c62"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2329bv64), Gamma_R0; @@ -695,19 +695,19 @@ procedure main() call printf(); goto l00000c7b; l00000c7b: - assume {:captureState "addr:0x8c0"}true; + assume {:captureState "addr:l00000c7b"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R30, Gamma_R30 := 2248bv64, true; call #free(); goto l00000c8a; l00000c8a: - assume {:captureState "addr:0x8c8"}true; + assume {:captureState "addr:l00000c8a"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R30, Gamma_R30 := 2256bv64, true; call #free(); goto l00000c98; l00000c98: - assume {:captureState "addr:0x8d0"}true; + assume {:captureState "addr:l00000c98"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd64(R31, 64bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/malloc_with_local2/gcc/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/gcc/malloc_with_local2.expected index a749b374b..ed0d462a6 100644 --- a/src/test/correct/malloc_with_local2/gcc/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/gcc/malloc_with_local2.expected @@ -1,79 +1,79 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2272bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2272bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -185,7 +185,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -194,9 +194,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -656,12 +656,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551552bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%0000036c"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000372"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -669,46 +669,46 @@ procedure main() call malloc(); goto l0000038b; l0000038b: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l0000038b"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 40bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 40bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000391"} true; R0, Gamma_R0 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x82c"}true; + assume {:captureState "%0000039e"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2104bv64, true; call malloc(); goto l000003ac; l000003ac: - assume {:captureState "addr:0x838"}true; + assume {:captureState "addr:l000003ac"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 48bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 48bv64), Gamma_R0); - assume {:captureState "addr:0x838"}true; + assume {:captureState "%000003b2"} true; R0, Gamma_R0 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 32bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%000003bf"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l000003cd; l000003cd: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l000003cd"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 56bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 56bv64), Gamma_R0); - assume {:captureState "addr:0x84c"}true; + assume {:captureState "%000003d3"} true; R0, Gamma_R0 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 36bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 36bv64), Gamma_R0); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%000003e0"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x860"}true; + assume {:captureState "%000003f4"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%00000408"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -719,7 +719,7 @@ procedure main() call printf(); goto l00000431; l00000431: - assume {:captureState "addr:0x888"}true; + assume {:captureState "addr:l00000431"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -730,7 +730,7 @@ procedure main() call printf(); goto l00000457; l00000457: - assume {:captureState "addr:0x8a0"}true; + assume {:captureState "addr:l00000457"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 32bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 32bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2320bv64), Gamma_R0; @@ -738,19 +738,19 @@ procedure main() call printf(); goto l00000470; l00000470: - assume {:captureState "addr:0x8b0"}true; + assume {:captureState "addr:l00000470"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2232bv64, true; call #free(); goto l0000047f; l0000047f: - assume {:captureState "addr:0x8b8"}true; + assume {:captureState "addr:l0000047f"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R30, Gamma_R30 := 2240bv64, true; call #free(); goto l0000048d; l0000048d: - assume {:captureState "addr:0x8c0"}true; + assume {:captureState "addr:l0000048d"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2.expected index 023c5c714..e680279cb 100644 --- a/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/gcc_O2/malloc_with_local2.expected @@ -1,47 +1,47 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R2: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2088bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R2: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2088bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -153,7 +153,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -162,9 +162,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure __printf_chk(); @@ -624,12 +624,12 @@ procedure main() var #1: bv64; var Gamma_#1: bool; lmain: - assume {:captureState "addr:0x680"}true; + assume {:captureState "addr:lmain"} true; #1, Gamma_#1 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #1, R29), gamma_store64(Gamma_stack, #1, Gamma_R29); - assume {:captureState "addr:0x680"}true; + assume {:captureState "%000001f2"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#1, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#1, 8bv64), Gamma_R30); - assume {:captureState "addr:0x680"}true; + assume {:captureState "%000001f8"} true; R31, Gamma_R31 := #1, Gamma_#1; R2, Gamma_R2 := 65bv64, true; R1, Gamma_R1 := 0bv64, true; @@ -640,7 +640,7 @@ procedure main() call __printf_chk(); goto l00000221; l00000221: - assume {:captureState "addr:0x69c"}true; + assume {:captureState "addr:l00000221"} true; R2, Gamma_R2 := 42bv64, true; R1, Gamma_R1 := 0bv64, true; R0, Gamma_R0 := 1bv64, true; @@ -649,7 +649,7 @@ procedure main() call __printf_chk(); goto l0000023d; l0000023d: - assume {:captureState "addr:0x6b0"}true; + assume {:captureState "addr:l0000023d"} true; R2, Gamma_R2 := 10bv64, true; R1, Gamma_R1 := 0bv64, true; R0, Gamma_R0 := 1bv64, true; @@ -658,7 +658,7 @@ procedure main() call __printf_chk(); goto l00000259; l00000259: - assume {:captureState "addr:0x6c4"}true; + assume {:captureState "addr:l00000259"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2.expected index 8372c230e..6c40463e6 100644 --- a/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/gcc_no_plt_no_pic/malloc_with_local2.expected @@ -1,79 +1,79 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2272bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2272bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -185,7 +185,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -194,9 +194,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -656,12 +656,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551552bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000b0e"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000b14"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -669,46 +669,46 @@ procedure main() call malloc(); goto l00000b2d; l00000b2d: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l00000b2d"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 40bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 40bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000b33"} true; R0, Gamma_R0 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x82c"}true; + assume {:captureState "%00000b40"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2104bv64, true; call malloc(); goto l00000b4e; l00000b4e: - assume {:captureState "addr:0x838"}true; + assume {:captureState "addr:l00000b4e"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 48bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 48bv64), Gamma_R0); - assume {:captureState "addr:0x838"}true; + assume {:captureState "%00000b54"} true; R0, Gamma_R0 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 32bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%00000b61"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l00000b6f; l00000b6f: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l00000b6f"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 56bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 56bv64), Gamma_R0); - assume {:captureState "addr:0x84c"}true; + assume {:captureState "%00000b75"} true; R0, Gamma_R0 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 36bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 36bv64), Gamma_R0); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000b82"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x860"}true; + assume {:captureState "%00000b96"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%00000baa"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -719,7 +719,7 @@ procedure main() call printf(); goto l00000bd3; l00000bd3: - assume {:captureState "addr:0x888"}true; + assume {:captureState "addr:l00000bd3"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -730,7 +730,7 @@ procedure main() call printf(); goto l00000bf9; l00000bf9: - assume {:captureState "addr:0x8a0"}true; + assume {:captureState "addr:l00000bf9"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 32bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 32bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2320bv64), Gamma_R0; @@ -738,19 +738,19 @@ procedure main() call printf(); goto l00000c12; l00000c12: - assume {:captureState "addr:0x8b0"}true; + assume {:captureState "addr:l00000c12"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2232bv64, true; call #free(); goto l00000c21; l00000c21: - assume {:captureState "addr:0x8b8"}true; + assume {:captureState "addr:l00000c21"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R30, Gamma_R30 := 2240bv64, true; call #free(); goto l00000c2f; l00000c2f: - assume {:captureState "addr:0x8c0"}true; + assume {:captureState "addr:l00000c2f"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2.expected b/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2.expected index 8372c230e..6c40463e6 100644 --- a/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2.expected +++ b/src/test/correct/malloc_with_local2/gcc_pic/malloc_with_local2.expected @@ -1,79 +1,79 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2272bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2272bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -185,7 +185,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -194,9 +194,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -656,12 +656,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551552bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000b0e"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000b14"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -669,46 +669,46 @@ procedure main() call malloc(); goto l00000b2d; l00000b2d: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l00000b2d"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 40bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 40bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000b33"} true; R0, Gamma_R0 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x82c"}true; + assume {:captureState "%00000b40"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2104bv64, true; call malloc(); goto l00000b4e; l00000b4e: - assume {:captureState "addr:0x838"}true; + assume {:captureState "addr:l00000b4e"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 48bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 48bv64), Gamma_R0); - assume {:captureState "addr:0x838"}true; + assume {:captureState "%00000b54"} true; R0, Gamma_R0 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 32bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%00000b61"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l00000b6f; l00000b6f: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l00000b6f"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 56bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 56bv64), Gamma_R0); - assume {:captureState "addr:0x84c"}true; + assume {:captureState "%00000b75"} true; R0, Gamma_R0 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 36bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 36bv64), Gamma_R0); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000b82"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x860"}true; + assume {:captureState "%00000b96"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%00000baa"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -719,7 +719,7 @@ procedure main() call printf(); goto l00000bd3; l00000bd3: - assume {:captureState "addr:0x888"}true; + assume {:captureState "addr:l00000bd3"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -730,7 +730,7 @@ procedure main() call printf(); goto l00000bf9; l00000bf9: - assume {:captureState "addr:0x8a0"}true; + assume {:captureState "addr:l00000bf9"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 32bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 32bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2320bv64), Gamma_R0; @@ -738,19 +738,19 @@ procedure main() call printf(); goto l00000c12; l00000c12: - assume {:captureState "addr:0x8b0"}true; + assume {:captureState "addr:l00000c12"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2232bv64, true; call #free(); goto l00000c21; l00000c21: - assume {:captureState "addr:0x8b8"}true; + assume {:captureState "addr:l00000c21"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R30, Gamma_R30 := 2240bv64, true; call #free(); goto l00000c2f; l00000c2f: - assume {:captureState "addr:0x8c0"}true; + assume {:captureState "addr:l00000c2f"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/malloc_with_local3/clang/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/clang/malloc_with_local3.expected index 8e63d24b0..8e69c60a0 100644 --- a/src/test/correct/malloc_with_local3/clang/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/clang/malloc_with_local3.expected @@ -1,84 +1,84 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2344bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2344bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -185,7 +185,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -194,9 +194,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -638,73 +638,73 @@ procedure main() var Gamma_#4: bool; var Gamma_#7: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551536bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 64bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%000003ba"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%000003c0"} true; R29, Gamma_R29 := bvadd64(R31, 64bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%000003d3"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%000003da"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l000003e9; l000003e9: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l000003e9"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R29, 18446744073709551600bv64), R0), gamma_store64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%000003ef"} true; R8, Gamma_R8 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551596bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551596bv64), Gamma_R8); - assume {:captureState "addr:0x83c"}true; + assume {:captureState "%000003fc"} true; R0, Gamma_R0 := 4bv64, true; stack, Gamma_stack := memory_store64_le(stack, R31, R0), gamma_store64(Gamma_stack, R31, Gamma_R0); - assume {:captureState "addr:0x844"}true; + assume {:captureState "%00000409"} true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l00000412; l00000412: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l00000412"} true; R8, Gamma_R8 := R0, Gamma_R0; R0, Gamma_R0 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 32bv64), R8), gamma_store64(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R8); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000425"} true; R8, Gamma_R8 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R8); - assume {:captureState "addr:0x85c"}true; + assume {:captureState "%00000432"} true; R30, Gamma_R30 := 2148bv64, true; call malloc(); goto l0000043b; l0000043b: - assume {:captureState "addr:0x864"}true; + assume {:captureState "addr:l0000043b"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x864"}true; + assume {:captureState "%00000441"} true; R8, Gamma_R8 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%0000044e"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x878"}true; + assume {:captureState "%00000462"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x884"}true; + assume {:captureState "%00000476"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R30, Gamma_R30 := 2192bv64, true; call printCharValue(); goto l00000504; l00000504: - assume {:captureState "addr:0x890"}true; + assume {:captureState "addr:l00000504"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -714,7 +714,7 @@ procedure main() call printf(); goto l00000524; l00000524: - assume {:captureState "addr:0x8a4"}true; + assume {:captureState "addr:l00000524"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2364bv64), Gamma_R0; @@ -722,19 +722,19 @@ procedure main() call printf(); goto l0000053d; l0000053d: - assume {:captureState "addr:0x8b4"}true; + assume {:captureState "addr:l0000053d"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R30, Gamma_R30 := 2236bv64, true; call #free(); goto l0000054c; l0000054c: - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "addr:l0000054c"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R30, Gamma_R30 := 2244bv64, true; call #free(); goto l0000055a; l0000055a: - assume {:captureState "addr:0x8c4"}true; + assume {:captureState "addr:l0000055a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #7, Gamma_#7 := bvadd64(R31, 64bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #7), gamma_load64(Gamma_stack, #7); @@ -1166,16 +1166,16 @@ procedure printCharValue() var Gamma_#5: bool; var Gamma_#6: bool; lprintCharValue: - assume {:captureState "addr:0x8d4"}true; + assume {:captureState "addr:lprintCharValue"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #5, R29), gamma_store64(Gamma_stack, #5, Gamma_R29); - assume {:captureState "addr:0x8d8"}true; + assume {:captureState "%00000496"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#5, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#5, 8bv64), Gamma_R30); - assume {:captureState "addr:0x8d8"}true; + assume {:captureState "%0000049c"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x8e0"}true; + assume {:captureState "%000004aa"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R8, Gamma_R8 := zero_extend56_8(memory_load8_le(mem, R9)), (gamma_load8(Gamma_mem, R9) || L(mem, R9)); @@ -1183,7 +1183,7 @@ procedure printCharValue() call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x8f0"}true; + assume {:captureState "%000004c6"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -1193,7 +1193,7 @@ procedure printCharValue() call printf(); goto l000004e9; l000004e9: - assume {:captureState "addr:0x908"}true; + assume {:captureState "addr:l000004e9"} true; #6, Gamma_#6 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #6), gamma_load64(Gamma_stack, #6); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#6, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#6, 8bv64)); diff --git a/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3.expected index abdd2f976..9d9df1295 100644 --- a/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/clang_O2/malloc_with_local3.expected @@ -1,45 +1,45 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1996bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1996bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -146,7 +146,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69686bv64) == 0bv8); free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -155,9 +155,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -390,12 +390,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%00000318"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%0000031e"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 0bv64, true; @@ -405,7 +405,7 @@ procedure main() call printf(); goto l00000342; l00000342: - assume {:captureState "addr:0x76c"}true; + assume {:captureState "addr:l00000342"} true; R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2000bv64), Gamma_R0; R1, Gamma_R1 := 42bv64, true; @@ -413,7 +413,7 @@ procedure main() call printf(); goto l00000359; l00000359: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l00000359"} true; R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2016bv64), Gamma_R0; R1, Gamma_R1 := 10bv64, true; @@ -421,7 +421,7 @@ procedure main() call printf(); goto l00000370; l00000370: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l00000370"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3.expected index fc27896ba..5aae86cb6 100644 --- a/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/clang_no_plt_no_pic/malloc_with_local3.expected @@ -1,84 +1,84 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2344bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2344bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -185,7 +185,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -194,9 +194,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -638,73 +638,73 @@ procedure main() var Gamma_#4: bool; var Gamma_#7: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551536bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 64bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000c45"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000c4b"} true; R29, Gamma_R29 := bvadd64(R31, 64bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000c5e"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%00000c65"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l00000c74; l00000c74: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l00000c74"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R29, 18446744073709551600bv64), R0), gamma_store64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%00000c7a"} true; R8, Gamma_R8 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551596bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551596bv64), Gamma_R8); - assume {:captureState "addr:0x83c"}true; + assume {:captureState "%00000c87"} true; R0, Gamma_R0 := 4bv64, true; stack, Gamma_stack := memory_store64_le(stack, R31, R0), gamma_store64(Gamma_stack, R31, Gamma_R0); - assume {:captureState "addr:0x844"}true; + assume {:captureState "%00000c94"} true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l00000c9d; l00000c9d: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l00000c9d"} true; R8, Gamma_R8 := R0, Gamma_R0; R0, Gamma_R0 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 32bv64), R8), gamma_store64(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R8); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000cb0"} true; R8, Gamma_R8 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R8); - assume {:captureState "addr:0x85c"}true; + assume {:captureState "%00000cbd"} true; R30, Gamma_R30 := 2148bv64, true; call malloc(); goto l00000cc6; l00000cc6: - assume {:captureState "addr:0x864"}true; + assume {:captureState "addr:l00000cc6"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x864"}true; + assume {:captureState "%00000ccc"} true; R8, Gamma_R8 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%00000cd9"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x878"}true; + assume {:captureState "%00000ced"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x884"}true; + assume {:captureState "%00000d01"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R30, Gamma_R30 := 2192bv64, true; call printCharValue(); goto l00000d8f; l00000d8f: - assume {:captureState "addr:0x890"}true; + assume {:captureState "addr:l00000d8f"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -714,7 +714,7 @@ procedure main() call printf(); goto l00000daf; l00000daf: - assume {:captureState "addr:0x8a4"}true; + assume {:captureState "addr:l00000daf"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2364bv64), Gamma_R0; @@ -722,19 +722,19 @@ procedure main() call printf(); goto l00000dc8; l00000dc8: - assume {:captureState "addr:0x8b4"}true; + assume {:captureState "addr:l00000dc8"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R30, Gamma_R30 := 2236bv64, true; call #free(); goto l00000dd7; l00000dd7: - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "addr:l00000dd7"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R30, Gamma_R30 := 2244bv64, true; call #free(); goto l00000de5; l00000de5: - assume {:captureState "addr:0x8c4"}true; + assume {:captureState "addr:l00000de5"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #7, Gamma_#7 := bvadd64(R31, 64bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #7), gamma_load64(Gamma_stack, #7); @@ -1166,16 +1166,16 @@ procedure printCharValue() var Gamma_#5: bool; var Gamma_#6: bool; lprintCharValue: - assume {:captureState "addr:0x8d4"}true; + assume {:captureState "addr:lprintCharValue"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #5, R29), gamma_store64(Gamma_stack, #5, Gamma_R29); - assume {:captureState "addr:0x8d8"}true; + assume {:captureState "%00000d21"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#5, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#5, 8bv64), Gamma_R30); - assume {:captureState "addr:0x8d8"}true; + assume {:captureState "%00000d27"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x8e0"}true; + assume {:captureState "%00000d35"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R8, Gamma_R8 := zero_extend56_8(memory_load8_le(mem, R9)), (gamma_load8(Gamma_mem, R9) || L(mem, R9)); @@ -1183,7 +1183,7 @@ procedure printCharValue() call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x8f0"}true; + assume {:captureState "%00000d51"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -1193,7 +1193,7 @@ procedure printCharValue() call printf(); goto l00000d74; l00000d74: - assume {:captureState "addr:0x908"}true; + assume {:captureState "addr:l00000d74"} true; #6, Gamma_#6 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #6), gamma_load64(Gamma_stack, #6); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#6, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#6, 8bv64)); diff --git a/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3.expected index fc27896ba..5aae86cb6 100644 --- a/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/clang_pic/malloc_with_local3.expected @@ -1,84 +1,84 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2344bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2344bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -185,7 +185,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -194,9 +194,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -638,73 +638,73 @@ procedure main() var Gamma_#4: bool; var Gamma_#7: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551536bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 64bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000c45"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000c4b"} true; R29, Gamma_R29 := bvadd64(R31, 64bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000c5e"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%00000c65"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l00000c74; l00000c74: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l00000c74"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R29, 18446744073709551600bv64), R0), gamma_store64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%00000c7a"} true; R8, Gamma_R8 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551596bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551596bv64), Gamma_R8); - assume {:captureState "addr:0x83c"}true; + assume {:captureState "%00000c87"} true; R0, Gamma_R0 := 4bv64, true; stack, Gamma_stack := memory_store64_le(stack, R31, R0), gamma_store64(Gamma_stack, R31, Gamma_R0); - assume {:captureState "addr:0x844"}true; + assume {:captureState "%00000c94"} true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l00000c9d; l00000c9d: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l00000c9d"} true; R8, Gamma_R8 := R0, Gamma_R0; R0, Gamma_R0 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 32bv64), R8), gamma_store64(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R8); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000cb0"} true; R8, Gamma_R8 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R8); - assume {:captureState "addr:0x85c"}true; + assume {:captureState "%00000cbd"} true; R30, Gamma_R30 := 2148bv64, true; call malloc(); goto l00000cc6; l00000cc6: - assume {:captureState "addr:0x864"}true; + assume {:captureState "addr:l00000cc6"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x864"}true; + assume {:captureState "%00000ccc"} true; R8, Gamma_R8 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%00000cd9"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x878"}true; + assume {:captureState "%00000ced"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x884"}true; + assume {:captureState "%00000d01"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R30, Gamma_R30 := 2192bv64, true; call printCharValue(); goto l00000d8f; l00000d8f: - assume {:captureState "addr:0x890"}true; + assume {:captureState "addr:l00000d8f"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -714,7 +714,7 @@ procedure main() call printf(); goto l00000daf; l00000daf: - assume {:captureState "addr:0x8a4"}true; + assume {:captureState "addr:l00000daf"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2364bv64), Gamma_R0; @@ -722,19 +722,19 @@ procedure main() call printf(); goto l00000dc8; l00000dc8: - assume {:captureState "addr:0x8b4"}true; + assume {:captureState "addr:l00000dc8"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R29, 18446744073709551600bv64)), gamma_load64(Gamma_stack, bvadd64(R29, 18446744073709551600bv64)); R30, Gamma_R30 := 2236bv64, true; call #free(); goto l00000dd7; l00000dd7: - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "addr:l00000dd7"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 32bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 32bv64)); R30, Gamma_R30 := 2244bv64, true; call #free(); goto l00000de5; l00000de5: - assume {:captureState "addr:0x8c4"}true; + assume {:captureState "addr:l00000de5"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #7, Gamma_#7 := bvadd64(R31, 64bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #7), gamma_load64(Gamma_stack, #7); @@ -1166,16 +1166,16 @@ procedure printCharValue() var Gamma_#5: bool; var Gamma_#6: bool; lprintCharValue: - assume {:captureState "addr:0x8d4"}true; + assume {:captureState "addr:lprintCharValue"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; #5, Gamma_#5 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #5, R29), gamma_store64(Gamma_stack, #5, Gamma_R29); - assume {:captureState "addr:0x8d8"}true; + assume {:captureState "%00000d21"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#5, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#5, 8bv64), Gamma_R30); - assume {:captureState "addr:0x8d8"}true; + assume {:captureState "%00000d27"} true; R29, Gamma_R29 := bvadd64(R31, 16bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x8e0"}true; + assume {:captureState "%00000d35"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R8, Gamma_R8 := zero_extend56_8(memory_load8_le(mem, R9)), (gamma_load8(Gamma_mem, R9) || L(mem, R9)); @@ -1183,7 +1183,7 @@ procedure printCharValue() call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x8f0"}true; + assume {:captureState "%00000d51"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -1193,7 +1193,7 @@ procedure printCharValue() call printf(); goto l00000d74; l00000d74: - assume {:captureState "addr:0x908"}true; + assume {:captureState "addr:l00000d74"} true; #6, Gamma_#6 := bvadd64(R31, 16bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #6), gamma_load64(Gamma_stack, #6); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(#6, 8bv64)), gamma_load64(Gamma_stack, bvadd64(#6, 8bv64)); diff --git a/src/test/correct/malloc_with_local3/gcc/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/gcc/malloc_with_local3.expected index 10b8ebb3f..d42093c1c 100644 --- a/src/test/correct/malloc_with_local3/gcc/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/gcc/malloc_with_local3.expected @@ -1,80 +1,80 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2328bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2328bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -190,7 +190,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -199,9 +199,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -677,12 +677,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551552bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%000003a4"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%000003aa"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -690,52 +690,52 @@ procedure main() call malloc(); goto l000003c3; l000003c3: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l000003c3"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 40bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 40bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%000003c9"} true; R0, Gamma_R0 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x82c"}true; + assume {:captureState "%000003d6"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2104bv64, true; call malloc(); goto l000003e4; l000003e4: - assume {:captureState "addr:0x838"}true; + assume {:captureState "addr:l000003e4"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 48bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 48bv64), Gamma_R0); - assume {:captureState "addr:0x838"}true; + assume {:captureState "%000003ea"} true; R0, Gamma_R0 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 32bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%000003f7"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l00000405; l00000405: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l00000405"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 56bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 56bv64), Gamma_R0); - assume {:captureState "addr:0x84c"}true; + assume {:captureState "%0000040b"} true; R0, Gamma_R0 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 36bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 36bv64), Gamma_R0); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000418"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x860"}true; + assume {:captureState "%0000042c"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%00000440"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2168bv64, true; call printCharValue(); goto l000004db; l000004db: - assume {:captureState "addr:0x878"}true; + assume {:captureState "addr:l000004db"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -746,7 +746,7 @@ procedure main() call printf(); goto l00000501; l00000501: - assume {:captureState "addr:0x890"}true; + assume {:captureState "addr:l00000501"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 32bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 32bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2352bv64), Gamma_R0; @@ -754,19 +754,19 @@ procedure main() call printf(); goto l0000051a; l0000051a: - assume {:captureState "addr:0x8a0"}true; + assume {:captureState "addr:l0000051a"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2216bv64, true; call #free(); goto l00000529; l00000529: - assume {:captureState "addr:0x8a8"}true; + assume {:captureState "addr:l00000529"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R30, Gamma_R30 := 2224bv64, true; call #free(); goto l00000537; l00000537: - assume {:captureState "addr:0x8b0"}true; + assume {:captureState "addr:l00000537"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); @@ -1231,16 +1231,16 @@ procedure printCharValue() var #5: bv64; var Gamma_#5: bool; lprintCharValue: - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "addr:lprintCharValue"} true; #5, Gamma_#5 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #5, R29), gamma_store64(Gamma_stack, #5, Gamma_R29); - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "%0000045a"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#5, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#5, 8bv64), Gamma_R30); - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "%00000460"} true; R31, Gamma_R31 := #5, Gamma_#5; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 24bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x8c4"}true; + assume {:captureState "%00000472"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -1250,7 +1250,7 @@ procedure printCharValue() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x8dc"}true; + assume {:captureState "%0000049b"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -1261,7 +1261,7 @@ procedure printCharValue() call printf(); goto l000004c4; l000004c4: - assume {:captureState "addr:0x8f8"}true; + assume {:captureState "addr:l000004c4"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; diff --git a/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3.expected index b2fd5b9eb..b7dd816ae 100644 --- a/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/gcc_O2/malloc_with_local3.expected @@ -1,70 +1,70 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R19: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R3: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R19: bv64; -var {:extern }R2: bv64; -var {:extern }R29: bv64; -var {:extern }R3: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2264bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R19: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R3: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R19: bv64; +var {:extern } R2: bv64; +var {:extern } R29: bv64; +var {:extern } R3: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2264bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -176,7 +176,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -185,9 +185,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure __printf_chk(); @@ -866,33 +866,33 @@ procedure main() var #1: bv64; var Gamma_#1: bool; lmain: - assume {:captureState "addr:0x700"}true; + assume {:captureState "addr:lmain"} true; #1, Gamma_#1 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #1, R29), gamma_store64(Gamma_stack, #1, Gamma_R29); - assume {:captureState "addr:0x700"}true; + assume {:captureState "%00000222"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#1, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#1, 8bv64), Gamma_R30); - assume {:captureState "addr:0x700"}true; + assume {:captureState "%00000228"} true; R31, Gamma_R31 := #1, Gamma_#1; R0, Gamma_R0 := 1bv64, true; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R19), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R19); - assume {:captureState "addr:0x70c"}true; + assume {:captureState "%0000023f"} true; R30, Gamma_R30 := 1812bv64, true; call malloc(); goto l00000249; l00000249: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:l00000249"} true; R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000254"} true; R19, Gamma_R19 := R0, Gamma_R0; R30, Gamma_R30 := 1828bv64, true; call printCharValue(); goto l0000029a; l0000029a: - assume {:captureState "addr:0x724"}true; + assume {:captureState "addr:l0000029a"} true; R2, Gamma_R2 := 42bv64, true; R1, Gamma_R1 := 0bv64, true; R0, Gamma_R0 := 1bv64, true; @@ -901,7 +901,7 @@ procedure main() call __printf_chk(); goto l000002b6; l000002b6: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l000002b6"} true; R1, Gamma_R1 := 0bv64, true; R1, Gamma_R1 := bvadd64(R1, 2312bv64), Gamma_R1; R2, Gamma_R2 := 10bv64, true; @@ -910,13 +910,13 @@ procedure main() call __printf_chk(); goto l000002d2; l000002d2: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l000002d2"} true; R0, Gamma_R0 := R19, Gamma_R19; R30, Gamma_R30 := 1876bv64, true; call #free(); goto l000002e0; l000002e0: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l000002e0"} true; R0, Gamma_R0 := 0bv64, true; R19, Gamma_R19 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); @@ -1360,7 +1360,7 @@ procedure printCharValue() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lprintCharValue: - assume {:captureState "addr:0x8a0"}true; + assume {:captureState "addr:lprintCharValue"} true; R3, Gamma_R3 := R0, Gamma_R0; R0, Gamma_R0 := 1bv64, true; R1, Gamma_R1 := 0bv64, true; @@ -1372,7 +1372,7 @@ procedure printCharValue() call rely(); assert (L(mem, R3) ==> Gamma_R2); mem, Gamma_mem := memory_store8_le(mem, R3, R2[8:0]), gamma_store8(Gamma_mem, R3, Gamma_R2); - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "%00000293"} true; call __printf_chk(); //no return target assume false; diff --git a/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3.expected index deef3778f..d1c04e08d 100644 --- a/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/gcc_no_plt_no_pic/malloc_with_local3.expected @@ -1,80 +1,80 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2328bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2328bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -190,7 +190,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -199,9 +199,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -677,12 +677,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551552bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000c00"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000c06"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -690,52 +690,52 @@ procedure main() call malloc(); goto l00000c1f; l00000c1f: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l00000c1f"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 40bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 40bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000c25"} true; R0, Gamma_R0 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x82c"}true; + assume {:captureState "%00000c32"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2104bv64, true; call malloc(); goto l00000c40; l00000c40: - assume {:captureState "addr:0x838"}true; + assume {:captureState "addr:l00000c40"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 48bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 48bv64), Gamma_R0); - assume {:captureState "addr:0x838"}true; + assume {:captureState "%00000c46"} true; R0, Gamma_R0 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 32bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%00000c53"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l00000c61; l00000c61: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l00000c61"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 56bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 56bv64), Gamma_R0); - assume {:captureState "addr:0x84c"}true; + assume {:captureState "%00000c67"} true; R0, Gamma_R0 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 36bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 36bv64), Gamma_R0); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000c74"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x860"}true; + assume {:captureState "%00000c88"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%00000c9c"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2168bv64, true; call printCharValue(); goto l00000d37; l00000d37: - assume {:captureState "addr:0x878"}true; + assume {:captureState "addr:l00000d37"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -746,7 +746,7 @@ procedure main() call printf(); goto l00000d5d; l00000d5d: - assume {:captureState "addr:0x890"}true; + assume {:captureState "addr:l00000d5d"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 32bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 32bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2352bv64), Gamma_R0; @@ -754,19 +754,19 @@ procedure main() call printf(); goto l00000d76; l00000d76: - assume {:captureState "addr:0x8a0"}true; + assume {:captureState "addr:l00000d76"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2216bv64, true; call #free(); goto l00000d85; l00000d85: - assume {:captureState "addr:0x8a8"}true; + assume {:captureState "addr:l00000d85"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R30, Gamma_R30 := 2224bv64, true; call #free(); goto l00000d93; l00000d93: - assume {:captureState "addr:0x8b0"}true; + assume {:captureState "addr:l00000d93"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); @@ -1231,16 +1231,16 @@ procedure printCharValue() var #5: bv64; var Gamma_#5: bool; lprintCharValue: - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "addr:lprintCharValue"} true; #5, Gamma_#5 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #5, R29), gamma_store64(Gamma_stack, #5, Gamma_R29); - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "%00000cb6"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#5, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#5, 8bv64), Gamma_R30); - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "%00000cbc"} true; R31, Gamma_R31 := #5, Gamma_#5; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 24bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x8c4"}true; + assume {:captureState "%00000cce"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -1250,7 +1250,7 @@ procedure printCharValue() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x8dc"}true; + assume {:captureState "%00000cf7"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -1261,7 +1261,7 @@ procedure printCharValue() call printf(); goto l00000d20; l00000d20: - assume {:captureState "addr:0x8f8"}true; + assume {:captureState "addr:l00000d20"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; diff --git a/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3.expected b/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3.expected index deef3778f..d1c04e08d 100644 --- a/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3.expected +++ b/src/test/correct/malloc_with_local3/gcc_pic/malloc_with_local3.expected @@ -1,80 +1,80 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2328bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2328bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -190,7 +190,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -199,9 +199,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -677,12 +677,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551552bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000c00"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000c06"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -690,52 +690,52 @@ procedure main() call malloc(); goto l00000c1f; l00000c1f: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l00000c1f"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 40bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 40bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000c25"} true; R0, Gamma_R0 := 11bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x82c"}true; + assume {:captureState "%00000c32"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2104bv64, true; call malloc(); goto l00000c40; l00000c40: - assume {:captureState "addr:0x838"}true; + assume {:captureState "addr:l00000c40"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 48bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 48bv64), Gamma_R0); - assume {:captureState "addr:0x838"}true; + assume {:captureState "%00000c46"} true; R0, Gamma_R0 := 10bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 32bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 32bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%00000c53"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2124bv64, true; call malloc(); goto l00000c61; l00000c61: - assume {:captureState "addr:0x84c"}true; + assume {:captureState "addr:l00000c61"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 56bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 56bv64), Gamma_R0); - assume {:captureState "addr:0x84c"}true; + assume {:captureState "%00000c67"} true; R0, Gamma_R0 := 9bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 36bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 36bv64), Gamma_R0); - assume {:captureState "addr:0x854"}true; + assume {:captureState "%00000c74"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x860"}true; + assume {:captureState "%00000c88"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x86c"}true; + assume {:captureState "%00000c9c"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2168bv64, true; call printCharValue(); goto l00000d37; l00000d37: - assume {:captureState "addr:0x878"}true; + assume {:captureState "addr:l00000d37"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -746,7 +746,7 @@ procedure main() call printf(); goto l00000d5d; l00000d5d: - assume {:captureState "addr:0x890"}true; + assume {:captureState "addr:l00000d5d"} true; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 32bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 32bv64)); R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 2352bv64), Gamma_R0; @@ -754,19 +754,19 @@ procedure main() call printf(); goto l00000d76; l00000d76: - assume {:captureState "addr:0x8a0"}true; + assume {:captureState "addr:l00000d76"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 40bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 40bv64)); R30, Gamma_R30 := 2216bv64, true; call #free(); goto l00000d85; l00000d85: - assume {:captureState "addr:0x8a8"}true; + assume {:captureState "addr:l00000d85"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 48bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 48bv64)); R30, Gamma_R30 := 2224bv64, true; call #free(); goto l00000d93; l00000d93: - assume {:captureState "addr:0x8b0"}true; + assume {:captureState "addr:l00000d93"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); @@ -1231,16 +1231,16 @@ procedure printCharValue() var #5: bv64; var Gamma_#5: bool; lprintCharValue: - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "addr:lprintCharValue"} true; #5, Gamma_#5 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #5, R29), gamma_store64(Gamma_stack, #5, Gamma_R29); - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "%00000cb6"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#5, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#5, 8bv64), Gamma_R30); - assume {:captureState "addr:0x8bc"}true; + assume {:captureState "%00000cbc"} true; R31, Gamma_R31 := #5, Gamma_#5; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 24bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x8c4"}true; + assume {:captureState "%00000cce"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -1250,7 +1250,7 @@ procedure printCharValue() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x8dc"}true; + assume {:captureState "%00000cf7"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -1261,7 +1261,7 @@ procedure printCharValue() call printf(); goto l00000d20; l00000d20: - assume {:captureState "addr:0x8f8"}true; + assume {:captureState "addr:l00000d20"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; diff --git a/src/test/correct/multi_malloc/clang/multi_malloc.expected b/src/test/correct/multi_malloc/clang/multi_malloc.expected index 957754193..bfc6dccdd 100644 --- a/src/test/correct/multi_malloc/clang/multi_malloc.expected +++ b/src/test/correct/multi_malloc/clang/multi_malloc.expected @@ -1,83 +1,83 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2232bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2232bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -151,7 +151,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -160,9 +160,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -472,47 +472,47 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%0000034a"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000350"} true; R29, Gamma_R29 := bvadd64(R31, 32bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000363"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%0000036a"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l00000379; l00000379: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l00000379"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%0000037f"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2112bv64, true; call malloc(); goto l0000038d; l0000038d: - assume {:captureState "addr:0x840"}true; + assume {:captureState "addr:l0000038d"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%00000393"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x84c"}true; + assume {:captureState "%000003a7"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x858"}true; + assume {:captureState "%000003bb"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -522,7 +522,7 @@ procedure main() call printf(); goto l000003de; l000003de: - assume {:captureState "addr:0x870"}true; + assume {:captureState "addr:l000003de"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -532,19 +532,19 @@ procedure main() call printf(); goto l000003fe; l000003fe: - assume {:captureState "addr:0x884"}true; + assume {:captureState "addr:l000003fe"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R30, Gamma_R30 := 2188bv64, true; call #free(); goto l0000040d; l0000040d: - assume {:captureState "addr:0x88c"}true; + assume {:captureState "addr:l0000040d"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R30, Gamma_R30 := 2196bv64, true; call #free(); goto l0000041b; l0000041b: - assume {:captureState "addr:0x894"}true; + assume {:captureState "addr:l0000041b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); #5, Gamma_#5 := bvadd64(R31, 32bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/multi_malloc/clang_O2/multi_malloc.expected b/src/test/correct/multi_malloc/clang_O2/multi_malloc.expected index 983f2bee1..6837f9a9c 100644 --- a/src/test/correct/multi_malloc/clang_O2/multi_malloc.expected +++ b/src/test/correct/multi_malloc/clang_O2/multi_malloc.expected @@ -1,45 +1,45 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1948bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1948bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -113,7 +113,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69686bv64) == 0bv8); free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -122,9 +122,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -291,12 +291,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002e8"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002ee"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 0bv64, true; @@ -306,7 +306,7 @@ procedure main() call printf(); goto l00000312; l00000312: - assume {:captureState "addr:0x76c"}true; + assume {:captureState "addr:l00000312"} true; R0, Gamma_R0 := 0bv64, true; R0, Gamma_R0 := bvadd64(R0, 1969bv64), Gamma_R0; R1, Gamma_R1 := 42bv64, true; @@ -314,7 +314,7 @@ procedure main() call printf(); goto l00000329; l00000329: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l00000329"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc.expected b/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc.expected index 86eef3bee..0bd9b5530 100644 --- a/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc.expected +++ b/src/test/correct/multi_malloc/clang_no_plt_no_pic/multi_malloc.expected @@ -1,83 +1,83 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2232bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2232bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -151,7 +151,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -160,9 +160,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -472,47 +472,47 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000a78"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000a7e"} true; R29, Gamma_R29 := bvadd64(R31, 32bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000a91"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%00000a98"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l00000aa7; l00000aa7: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l00000aa7"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%00000aad"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2112bv64, true; call malloc(); goto l00000abb; l00000abb: - assume {:captureState "addr:0x840"}true; + assume {:captureState "addr:l00000abb"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%00000ac1"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x84c"}true; + assume {:captureState "%00000ad5"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x858"}true; + assume {:captureState "%00000ae9"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -522,7 +522,7 @@ procedure main() call printf(); goto l00000b0c; l00000b0c: - assume {:captureState "addr:0x870"}true; + assume {:captureState "addr:l00000b0c"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -532,19 +532,19 @@ procedure main() call printf(); goto l00000b2c; l00000b2c: - assume {:captureState "addr:0x884"}true; + assume {:captureState "addr:l00000b2c"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R30, Gamma_R30 := 2188bv64, true; call #free(); goto l00000b3b; l00000b3b: - assume {:captureState "addr:0x88c"}true; + assume {:captureState "addr:l00000b3b"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R30, Gamma_R30 := 2196bv64, true; call #free(); goto l00000b49; l00000b49: - assume {:captureState "addr:0x894"}true; + assume {:captureState "addr:l00000b49"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); #5, Gamma_#5 := bvadd64(R31, 32bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/multi_malloc/clang_pic/multi_malloc.expected b/src/test/correct/multi_malloc/clang_pic/multi_malloc.expected index 86eef3bee..0bd9b5530 100644 --- a/src/test/correct/multi_malloc/clang_pic/multi_malloc.expected +++ b/src/test/correct/multi_malloc/clang_pic/multi_malloc.expected @@ -1,83 +1,83 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2232bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2232bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -151,7 +151,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69702bv64) == 0bv8); free ensures (memory_load8_le(mem, 69703bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -160,9 +160,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -472,47 +472,47 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000a78"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x818"}true; + assume {:captureState "%00000a7e"} true; R29, Gamma_R29 := bvadd64(R31, 32bv64), Gamma_R31; R8, Gamma_R8 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000a91"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x828"}true; + assume {:captureState "%00000a98"} true; R0, Gamma_R0 := 1bv64, true; R30, Gamma_R30 := 2100bv64, true; call malloc(); goto l00000aa7; l00000aa7: - assume {:captureState "addr:0x834"}true; + assume {:captureState "addr:l00000aa7"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x834"}true; + assume {:captureState "%00000aad"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2112bv64, true; call malloc(); goto l00000abb; l00000abb: - assume {:captureState "addr:0x840"}true; + assume {:captureState "addr:l00000abb"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x840"}true; + assume {:captureState "%00000ac1"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R8, Gamma_R8 := 65bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x84c"}true; + assume {:captureState "%00000ad5"} true; R9, Gamma_R9 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := 42bv64, true; call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x858"}true; + assume {:captureState "%00000ae9"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); call rely(); R1, Gamma_R1 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); @@ -522,7 +522,7 @@ procedure main() call printf(); goto l00000b0c; l00000b0c: - assume {:captureState "addr:0x870"}true; + assume {:captureState "addr:l00000b0c"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R1, Gamma_R1 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -532,19 +532,19 @@ procedure main() call printf(); goto l00000b2c; l00000b2c: - assume {:captureState "addr:0x884"}true; + assume {:captureState "addr:l00000b2c"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R30, Gamma_R30 := 2188bv64, true; call #free(); goto l00000b3b; l00000b3b: - assume {:captureState "addr:0x88c"}true; + assume {:captureState "addr:l00000b3b"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R30, Gamma_R30 := 2196bv64, true; call #free(); goto l00000b49; l00000b49: - assume {:captureState "addr:0x894"}true; + assume {:captureState "addr:l00000b49"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); #5, Gamma_#5 := bvadd64(R31, 32bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/multi_malloc/gcc/multi_malloc.expected b/src/test/correct/multi_malloc/gcc/multi_malloc.expected index 9897cd900..8d5d8855b 100644 --- a/src/test/correct/multi_malloc/gcc/multi_malloc.expected +++ b/src/test/correct/multi_malloc/gcc/multi_malloc.expected @@ -1,79 +1,79 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2224bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2224bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -158,7 +158,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -167,9 +167,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -521,12 +521,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000338"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%0000033e"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -534,29 +534,29 @@ procedure main() call malloc(); goto l00000357; l00000357: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l00000357"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%0000035d"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2096bv64, true; call malloc(); goto l0000036b; l0000036b: - assume {:captureState "addr:0x830"}true; + assume {:captureState "addr:l0000036b"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 24bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x830"}true; + assume {:captureState "%00000371"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x83c"}true; + assume {:captureState "%00000385"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x848"}true; + assume {:captureState "%00000399"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -567,7 +567,7 @@ procedure main() call printf(); goto l000003c2; l000003c2: - assume {:captureState "addr:0x864"}true; + assume {:captureState "addr:l000003c2"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -578,19 +578,19 @@ procedure main() call printf(); goto l000003e8; l000003e8: - assume {:captureState "addr:0x87c"}true; + assume {:captureState "addr:l000003e8"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R30, Gamma_R30 := 2180bv64, true; call #free(); goto l000003f7; l000003f7: - assume {:captureState "addr:0x884"}true; + assume {:captureState "addr:l000003f7"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R30, Gamma_R30 := 2188bv64, true; call #free(); goto l00000405; l00000405: - assume {:captureState "addr:0x88c"}true; + assume {:captureState "addr:l00000405"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/multi_malloc/gcc_O2/multi_malloc.expected b/src/test/correct/multi_malloc/gcc_O2/multi_malloc.expected index b456c480d..f780a9e26 100644 --- a/src/test/correct/multi_malloc/gcc_O2/multi_malloc.expected +++ b/src/test/correct/multi_malloc/gcc_O2/multi_malloc.expected @@ -1,47 +1,47 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R2: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2024bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R2: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2024bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -126,7 +126,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -135,9 +135,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure __printf_chk(); @@ -489,12 +489,12 @@ procedure main() var #1: bv64; var Gamma_#1: bool; lmain: - assume {:captureState "addr:0x680"}true; + assume {:captureState "addr:lmain"} true; #1, Gamma_#1 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #1, R29), gamma_store64(Gamma_stack, #1, Gamma_R29); - assume {:captureState "addr:0x680"}true; + assume {:captureState "%000001b2"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#1, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#1, 8bv64), Gamma_R30); - assume {:captureState "addr:0x680"}true; + assume {:captureState "%000001b8"} true; R31, Gamma_R31 := #1, Gamma_#1; R2, Gamma_R2 := 65bv64, true; R1, Gamma_R1 := 0bv64, true; @@ -505,7 +505,7 @@ procedure main() call __printf_chk(); goto l000001e1; l000001e1: - assume {:captureState "addr:0x69c"}true; + assume {:captureState "addr:l000001e1"} true; R2, Gamma_R2 := 42bv64, true; R1, Gamma_R1 := 0bv64, true; R0, Gamma_R0 := 1bv64, true; @@ -514,7 +514,7 @@ procedure main() call __printf_chk(); goto l000001fd; l000001fd: - assume {:captureState "addr:0x6b0"}true; + assume {:captureState "addr:l000001fd"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc.expected b/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc.expected index 7c5417b45..2590a4df1 100644 --- a/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc.expected +++ b/src/test/correct/multi_malloc/gcc_no_plt_no_pic/multi_malloc.expected @@ -1,79 +1,79 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2224bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2224bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -158,7 +158,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -167,9 +167,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -521,12 +521,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000a45"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000a4b"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -534,29 +534,29 @@ procedure main() call malloc(); goto l00000a64; l00000a64: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l00000a64"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000a6a"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2096bv64, true; call malloc(); goto l00000a78; l00000a78: - assume {:captureState "addr:0x830"}true; + assume {:captureState "addr:l00000a78"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 24bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x830"}true; + assume {:captureState "%00000a7e"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x83c"}true; + assume {:captureState "%00000a92"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x848"}true; + assume {:captureState "%00000aa6"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -567,7 +567,7 @@ procedure main() call printf(); goto l00000acf; l00000acf: - assume {:captureState "addr:0x864"}true; + assume {:captureState "addr:l00000acf"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -578,19 +578,19 @@ procedure main() call printf(); goto l00000af5; l00000af5: - assume {:captureState "addr:0x87c"}true; + assume {:captureState "addr:l00000af5"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R30, Gamma_R30 := 2180bv64, true; call #free(); goto l00000b04; l00000b04: - assume {:captureState "addr:0x884"}true; + assume {:captureState "addr:l00000b04"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R30, Gamma_R30 := 2188bv64, true; call #free(); goto l00000b12; l00000b12: - assume {:captureState "addr:0x88c"}true; + assume {:captureState "addr:l00000b12"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/multi_malloc/gcc_pic/multi_malloc.expected b/src/test/correct/multi_malloc/gcc_pic/multi_malloc.expected index 7c5417b45..2590a4df1 100644 --- a/src/test/correct/multi_malloc/gcc_pic/multi_malloc.expected +++ b/src/test/correct/multi_malloc/gcc_pic/multi_malloc.expected @@ -1,79 +1,79 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 2224bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 2224bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -158,7 +158,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -167,9 +167,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure #free(); @@ -521,12 +521,12 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x814"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000a45"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x814"}true; + assume {:captureState "%00000a4b"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; R0, Gamma_R0 := 1bv64, true; @@ -534,29 +534,29 @@ procedure main() call malloc(); goto l00000a64; l00000a64: - assume {:captureState "addr:0x824"}true; + assume {:captureState "addr:l00000a64"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R0); - assume {:captureState "addr:0x824"}true; + assume {:captureState "%00000a6a"} true; R0, Gamma_R0 := 4bv64, true; R30, Gamma_R30 := 2096bv64, true; call malloc(); goto l00000a78; l00000a78: - assume {:captureState "addr:0x830"}true; + assume {:captureState "addr:l00000a78"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 24bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x830"}true; + assume {:captureState "%00000a7e"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R1, Gamma_R1 := 65bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x83c"}true; + assume {:captureState "%00000a92"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R1, Gamma_R1 := 42bv64, true; call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x848"}true; + assume {:captureState "%00000aa6"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); @@ -567,7 +567,7 @@ procedure main() call printf(); goto l00000acf; l00000acf: - assume {:captureState "addr:0x864"}true; + assume {:captureState "addr:l00000acf"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); @@ -578,19 +578,19 @@ procedure main() call printf(); goto l00000af5; l00000af5: - assume {:captureState "addr:0x87c"}true; + assume {:captureState "addr:l00000af5"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 16bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 16bv64)); R30, Gamma_R30 := 2180bv64, true; call #free(); goto l00000b04; l00000b04: - assume {:captureState "addr:0x884"}true; + assume {:captureState "addr:l00000b04"} true; R0, Gamma_R0 := memory_load64_le(stack, bvadd64(R31, 24bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 24bv64)); R30, Gamma_R30 := 2188bv64, true; call #free(); goto l00000b12; l00000b12: - assume {:captureState "addr:0x88c"}true; + assume {:captureState "addr:l00000b12"} true; R0, Gamma_R0 := 0bv64, true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/nestedif/clang/nestedif.expected b/src/test/correct/nestedif/clang/nestedif.expected index 5abf39619..2087b50c5 100644 --- a/src/test/correct/nestedif/clang/nestedif.expected +++ b/src/test/correct/nestedif/clang/nestedif.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1968bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1968bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -90,9 +90,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -203,15 +203,15 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%0000033d"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000034a"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), true); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000351"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 0bv33))), (Gamma_R8 && Gamma_#4); @@ -237,7 +237,7 @@ procedure main() } goto l00000442; l00000387: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000387"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd32(R8[32:0], 4294967294bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934591bv33))), (Gamma_R8 && Gamma_#5); @@ -263,7 +263,7 @@ procedure main() } goto l0000042d; l000003c0: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l000003c0"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #6, Gamma_#6 := bvadd32(R8[32:0], 4294967293bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934590bv33))), (Gamma_R8 && Gamma_#6); @@ -289,40 +289,40 @@ procedure main() } goto l00000418; l00000418: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l00000418"} true; goto l00000419; l00000419: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l00000419"} true; R8, Gamma_R8 := 7bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000427"} true; goto l000003f9; l000003f9: - assume {:captureState "addr:0x788"}true; + assume {:captureState "addr:l000003f9"} true; goto l000003ff; l0000042d: - assume {:captureState "addr:0x758"}true; + assume {:captureState "addr:l0000042d"} true; goto l0000042e; l0000042e: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l0000042e"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%0000043c"} true; goto l000003ff; l000003ff: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l000003ff"} true; goto l00000403; l00000442: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000442"} true; goto l00000443; l00000443: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000443"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000451"} true; goto l00000403; l00000403: - assume {:captureState "addr:0x790"}true; + assume {:captureState "addr:l00000403"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/nestedif/clang_O2/nestedif.expected b/src/test/correct/nestedif/clang_O2/nestedif.expected index 863d7bd46..dfc8a4e7d 100644 --- a/src/test/correct/nestedif/clang_O2/nestedif.expected +++ b/src/test/correct/nestedif/clang_O2/nestedif.expected @@ -1,14 +1,14 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1840bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1840bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -49,7 +49,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -58,9 +58,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -155,7 +155,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif.expected b/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif.expected index a11142224..b85515bb7 100644 --- a/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif.expected +++ b/src/test/correct/nestedif/clang_no_plt_no_pic/nestedif.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1968bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1968bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -90,9 +90,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -203,15 +203,15 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000a6e"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000a7b"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), true); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000a82"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 0bv33))), (Gamma_R8 && Gamma_#4); @@ -237,7 +237,7 @@ procedure main() } goto l00000b73; l00000ab8: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000ab8"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd32(R8[32:0], 4294967294bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934591bv33))), (Gamma_R8 && Gamma_#5); @@ -263,7 +263,7 @@ procedure main() } goto l00000b5e; l00000af1: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000af1"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #6, Gamma_#6 := bvadd32(R8[32:0], 4294967293bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934590bv33))), (Gamma_R8 && Gamma_#6); @@ -289,40 +289,40 @@ procedure main() } goto l00000b49; l00000b49: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l00000b49"} true; goto l00000b4a; l00000b4a: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l00000b4a"} true; R8, Gamma_R8 := 7bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000b58"} true; goto l00000b2a; l00000b2a: - assume {:captureState "addr:0x788"}true; + assume {:captureState "addr:l00000b2a"} true; goto l00000b30; l00000b5e: - assume {:captureState "addr:0x758"}true; + assume {:captureState "addr:l00000b5e"} true; goto l00000b5f; l00000b5f: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l00000b5f"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000b6d"} true; goto l00000b30; l00000b30: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l00000b30"} true; goto l00000b34; l00000b73: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000b73"} true; goto l00000b74; l00000b74: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000b74"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000b82"} true; goto l00000b34; l00000b34: - assume {:captureState "addr:0x790"}true; + assume {:captureState "addr:l00000b34"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/nestedif/clang_pic/nestedif.expected b/src/test/correct/nestedif/clang_pic/nestedif.expected index a11142224..b85515bb7 100644 --- a/src/test/correct/nestedif/clang_pic/nestedif.expected +++ b/src/test/correct/nestedif/clang_pic/nestedif.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1968bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1968bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -90,9 +90,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -203,15 +203,15 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000a6e"} true; R8, Gamma_R8 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000a7b"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), true); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000a82"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 0bv33))), (Gamma_R8 && Gamma_#4); @@ -237,7 +237,7 @@ procedure main() } goto l00000b73; l00000ab8: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000ab8"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd32(R8[32:0], 4294967294bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934591bv33))), (Gamma_R8 && Gamma_#5); @@ -263,7 +263,7 @@ procedure main() } goto l00000b5e; l00000af1: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000af1"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #6, Gamma_#6 := bvadd32(R8[32:0], 4294967293bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934590bv33))), (Gamma_R8 && Gamma_#6); @@ -289,40 +289,40 @@ procedure main() } goto l00000b49; l00000b49: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l00000b49"} true; goto l00000b4a; l00000b4a: - assume {:captureState "addr:0x77c"}true; + assume {:captureState "addr:l00000b4a"} true; R8, Gamma_R8 := 7bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000b58"} true; goto l00000b2a; l00000b2a: - assume {:captureState "addr:0x788"}true; + assume {:captureState "addr:l00000b2a"} true; goto l00000b30; l00000b5e: - assume {:captureState "addr:0x758"}true; + assume {:captureState "addr:l00000b5e"} true; goto l00000b5f; l00000b5f: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l00000b5f"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000b6d"} true; goto l00000b30; l00000b30: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l00000b30"} true; goto l00000b34; l00000b73: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000b73"} true; goto l00000b74; l00000b74: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000b74"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000b82"} true; goto l00000b34; l00000b34: - assume {:captureState "addr:0x790"}true; + assume {:captureState "addr:l00000b34"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/nestedif/gcc/nestedif.expected b/src/test/correct/nestedif/gcc/nestedif.expected index e9ee57ce5..ac520a132 100644 --- a/src/test/correct/nestedif/gcc/nestedif.expected +++ b/src/test/correct/nestedif/gcc/nestedif.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1928bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1928bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -201,13 +201,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000031b"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000322"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#4); @@ -220,7 +220,7 @@ procedure main() } goto l000003c4; l00000345: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000345"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#5); @@ -233,7 +233,7 @@ procedure main() } goto l000003b3; l0000036b: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l0000036b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#6); @@ -246,25 +246,25 @@ procedure main() } goto l000003a6; l000003a6: - assume {:captureState "addr:0x760"}true; + assume {:captureState "addr:l000003a6"} true; R0, Gamma_R0 := 7bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%000003b1"} true; goto l00000391; l000003b3: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l000003b3"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%000003be"} true; goto l00000391; l000003c4: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l000003c4"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%000003cf"} true; goto l00000391; l00000391: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000391"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/nestedif/gcc_O2/nestedif.expected b/src/test/correct/nestedif/gcc_O2/nestedif.expected index 418f9a5da..db578d839 100644 --- a/src/test/correct/nestedif/gcc_O2/nestedif.expected +++ b/src/test/correct/nestedif/gcc_O2/nestedif.expected @@ -1,14 +1,14 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1896bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1896bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -49,7 +49,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -58,9 +58,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -155,7 +155,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif.expected b/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif.expected index 0980d9726..d94363d97 100644 --- a/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif.expected +++ b/src/test/correct/nestedif/gcc_no_plt_no_pic/nestedif.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1928bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1928bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -201,13 +201,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000009b7"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000009be"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#4); @@ -220,7 +220,7 @@ procedure main() } goto l00000a60; l000009e1: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l000009e1"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#5); @@ -233,7 +233,7 @@ procedure main() } goto l00000a4f; l00000a07: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l00000a07"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#6); @@ -246,25 +246,25 @@ procedure main() } goto l00000a42; l00000a42: - assume {:captureState "addr:0x760"}true; + assume {:captureState "addr:l00000a42"} true; R0, Gamma_R0 := 7bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%00000a4d"} true; goto l00000a2d; l00000a4f: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000a4f"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%00000a5a"} true; goto l00000a2d; l00000a60: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000a60"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000a6b"} true; goto l00000a2d; l00000a2d: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000a2d"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/nestedif/gcc_pic/nestedif.expected b/src/test/correct/nestedif/gcc_pic/nestedif.expected index 0980d9726..d94363d97 100644 --- a/src/test/correct/nestedif/gcc_pic/nestedif.expected +++ b/src/test/correct/nestedif/gcc_pic/nestedif.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1928bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1928bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -201,13 +201,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000009b7"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000009be"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#4); @@ -220,7 +220,7 @@ procedure main() } goto l00000a60; l000009e1: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l000009e1"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#5); @@ -233,7 +233,7 @@ procedure main() } goto l00000a4f; l00000a07: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l00000a07"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#6); @@ -246,25 +246,25 @@ procedure main() } goto l00000a42; l00000a42: - assume {:captureState "addr:0x760"}true; + assume {:captureState "addr:l00000a42"} true; R0, Gamma_R0 := 7bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%00000a4d"} true; goto l00000a2d; l00000a4f: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000a4f"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%00000a5a"} true; goto l00000a2d; l00000a60: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000a60"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000a6b"} true; goto l00000a2d; l00000a2d: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000a2d"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/no_interference_update_x/clang/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/clang/no_interference_update_x.expected index 02cb1d620..3d075bbc1 100644 --- a/src/test/correct/no_interference_update_x/clang/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/clang/no_interference_update_x.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); @@ -185,7 +185,7 @@ procedure main() { var y_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 1bv64, true; call rely(); @@ -193,7 +193,7 @@ procedure main() y_old := memory_load32_le(mem, $y_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert (memory_load32_le(mem, $y_addr) == y_old); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002ce"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x.expected index 9eb531be8..05dd01c87 100644 --- a/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/clang_O2/no_interference_update_x.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); @@ -185,7 +185,7 @@ procedure main() { var y_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 1bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -194,6 +194,6 @@ procedure main() y_old := memory_load32_le(mem, $y_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert (memory_load32_le(mem, $y_addr) == y_old); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d3"} true; return; } diff --git a/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x.expected index 02cb1d620..6ea1581ee 100644 --- a/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/clang_no_plt_no_pic/no_interference_update_x.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); @@ -185,7 +185,7 @@ procedure main() { var y_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 1bv64, true; call rely(); @@ -193,7 +193,7 @@ procedure main() y_old := memory_load32_le(mem, $y_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert (memory_load32_le(mem, $y_addr) == y_old); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000845"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x.expected index d0ee9ad05..cc0e9e8c1 100644 --- a/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/clang_pic/no_interference_update_x.expected @@ -1,45 +1,45 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -88,7 +88,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69598bv64) == 0bv8); free ensures (memory_load8_le(mem, 69599bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -96,12 +96,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); @@ -217,7 +217,7 @@ procedure main() { var y_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4040bv64)) || L(mem, bvadd64(R9, 4040bv64))); @@ -227,7 +227,7 @@ procedure main() y_old := memory_load32_le(mem, $y_addr); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assert (memory_load32_le(mem, $y_addr) == y_old); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/no_interference_update_x/gcc/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/gcc/no_interference_update_x.expected index d3d6c65d5..976c54ca5 100644 --- a/src/test/correct/no_interference_update_x/gcc/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/gcc/no_interference_update_x.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); @@ -183,7 +183,7 @@ procedure main() { var y_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -192,7 +192,7 @@ procedure main() y_old := memory_load32_le(mem, $y_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (memory_load32_le(mem, $y_addr) == y_old); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d8"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x.expected index ba8f09dd7..95c686547 100644 --- a/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/gcc_O2/no_interference_update_x.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); @@ -185,7 +185,7 @@ procedure main() { var y_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := 1bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -194,6 +194,6 @@ procedure main() y_old := memory_load32_le(mem, $y_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); assert (memory_load32_le(mem, $y_addr) == y_old); - assume {:captureState "addr:0x60c"}true; + assume {:captureState "%000001bd"} true; return; } diff --git a/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x.expected index d3d6c65d5..477cd0244 100644 --- a/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/gcc_no_plt_no_pic/no_interference_update_x.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); @@ -183,7 +183,7 @@ procedure main() { var y_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -192,7 +192,7 @@ procedure main() y_old := memory_load32_le(mem, $y_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (memory_load32_le(mem, $y_addr) == y_old); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000085b"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x.expected b/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x.expected index 66100cb2c..3b9db6a24 100644 --- a/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x.expected +++ b/src/test/correct/no_interference_update_x/gcc_pic/no_interference_update_x.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -86,7 +86,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69014bv64) == 0bv8); free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -94,12 +94,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); @@ -215,7 +215,7 @@ procedure main() { var y_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -225,7 +225,7 @@ procedure main() y_old := memory_load32_le(mem, $y_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (memory_load32_le(mem, $y_addr) == y_old); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/no_interference_update_y/clang/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/clang/no_interference_update_y.expected index f5d1eaace..2f031f723 100644 --- a/src/test/correct/no_interference_update_y/clang/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/clang/no_interference_update_y.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -185,7 +185,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 1bv64, true; call rely(); @@ -193,7 +193,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert (memory_load32_le(mem, $x_addr) == x_old); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002ce"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y.expected index 6f021c8f0..e2265a10a 100644 --- a/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/clang_O2/no_interference_update_y.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -185,7 +185,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 1bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -194,6 +194,6 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert (memory_load32_le(mem, $x_addr) == x_old); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d3"} true; return; } diff --git a/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y.expected index f5d1eaace..100fbb2a8 100644 --- a/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/clang_no_plt_no_pic/no_interference_update_y.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -185,7 +185,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 1bv64, true; call rely(); @@ -193,7 +193,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert (memory_load32_le(mem, $x_addr) == x_old); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000845"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y.expected index 69562d75e..c2ed7684d 100644 --- a/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/clang_pic/no_interference_update_y.expected @@ -1,45 +1,45 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -88,7 +88,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69598bv64) == 0bv8); free ensures (memory_load8_le(mem, 69599bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); { @@ -96,12 +96,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -217,7 +217,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4048bv64)) || L(mem, bvadd64(R9, 4048bv64))); @@ -227,7 +227,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assert (memory_load32_le(mem, $x_addr) == x_old); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/no_interference_update_y/gcc/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/gcc/no_interference_update_y.expected index 5567fed6b..f860c613f 100644 --- a/src/test/correct/no_interference_update_y/gcc/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/gcc/no_interference_update_y.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -183,7 +183,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -192,7 +192,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (memory_load32_le(mem, $x_addr) == x_old); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d8"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y.expected index 42731f16f..5933f7204 100644 --- a/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/gcc_O2/no_interference_update_y.expected @@ -1,37 +1,37 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69656bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69656bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -72,7 +72,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); { @@ -80,12 +80,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -185,7 +185,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := 1bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -194,6 +194,6 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); assert (memory_load32_le(mem, $x_addr) == x_old); - assume {:captureState "addr:0x60c"}true; + assume {:captureState "%000001bd"} true; return; } diff --git a/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y.expected index 5567fed6b..4b982d936 100644 --- a/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/gcc_no_plt_no_pic/no_interference_update_y.expected @@ -1,35 +1,35 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -70,7 +70,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); { @@ -78,12 +78,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -183,7 +183,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -192,7 +192,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (memory_load32_le(mem, $x_addr) == x_old); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000085b"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y.expected b/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y.expected index 211747e8a..93d1df00e 100644 --- a/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y.expected +++ b/src/test/correct/no_interference_update_y/gcc_pic/no_interference_update_y.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$y_addr: bv64; -axiom {:extern }($y_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $y_addr: bv64; +axiom ($y_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $y_addr) then true else (if (index == $x_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); @@ -86,7 +86,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69014bv64) == 0bv8); free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $y_addr) == old(memory_load32_le(mem, $y_addr))); { @@ -94,12 +94,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $y_addr) == memory_load32_le(mem, $y_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); @@ -215,7 +215,7 @@ procedure main() { var x_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); @@ -225,7 +225,7 @@ procedure main() x_old := memory_load32_le(mem, $x_addr); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert (memory_load32_le(mem, $x_addr) == x_old); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/secret_write/clang/secret_write.expected b/src/test/correct/secret_write/clang/secret_write.expected index 034422fdf..1d4b7703e 100644 --- a/src/test/correct/secret_write/clang/secret_write.expected +++ b/src/test/correct/secret_write/clang/secret_write.expected @@ -1,49 +1,49 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69688bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69692bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69688bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69692bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $x_addr) then (bvsmod32(memory_load32_le(memory, $z_addr), 2bv32) == 0bv32) else (if (index == $z_addr) then true else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsge"}bvsge32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvsmod"}bvsmod32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsge"} bvsge32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvsmod"} bvsmod32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -85,7 +85,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -94,13 +94,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert bvsge32(memory_load32_le(mem, $z_addr), memory_load32_le(mem, $z_addr)); @@ -204,7 +204,7 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; call rely(); @@ -214,7 +214,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), true); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002f5"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R9, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R9, 52bv64)) || L(mem, bvadd64(R9, 52bv64))); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; @@ -225,7 +225,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000030a"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R10, Gamma_R10 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); @@ -237,7 +237,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 60bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 60bv64), Gamma_R10); assert ((bvadd64(R8, 60bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000323"} true; call rely(); assert (L(mem, bvadd64(R8, 60bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); @@ -245,7 +245,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 60bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 60bv64), true); assert ((bvadd64(R8, 60bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%0000032a"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R9, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R9, 52bv64)) || L(mem, bvadd64(R9, 52bv64))); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; @@ -256,6 +256,6 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%0000033f"} true; return; } diff --git a/src/test/correct/secret_write/clang_O2/secret_write.expected b/src/test/correct/secret_write/clang_O2/secret_write.expected index 225c6b7b6..b43c831f2 100644 --- a/src/test/correct/secret_write/clang_O2/secret_write.expected +++ b/src/test/correct/secret_write/clang_O2/secret_write.expected @@ -1,47 +1,47 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69688bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69692bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69688bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69692bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $x_addr) then (bvsmod32(memory_load32_le(memory, $z_addr), 2bv32) == 0bv32) else (if (index == $z_addr) then true else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsge"}bvsge32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvsmod"}bvsmod32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsge"} bvsge32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvsmod"} bvsmod32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -92,13 +92,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert bvsge32(memory_load32_le(mem, $z_addr), memory_load32_le(mem, $z_addr)); @@ -202,7 +202,7 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; @@ -214,7 +214,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 60bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 60bv64), true); assert ((bvadd64(R8, 60bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000002df"} true; call rely(); assert (L(mem, bvadd64(R9, 52bv64)) ==> Gamma_R10); z_old := memory_load32_le(mem, $z_addr); @@ -222,6 +222,6 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R10); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000002e7"} true; return; } diff --git a/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write.expected b/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write.expected index 034422fdf..d90604b7c 100644 --- a/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write.expected +++ b/src/test/correct/secret_write/clang_no_plt_no_pic/secret_write.expected @@ -1,49 +1,49 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69688bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69692bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69688bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69692bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $x_addr) then (bvsmod32(memory_load32_le(memory, $z_addr), 2bv32) == 0bv32) else (if (index == $z_addr) then true else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsge"}bvsge32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvsmod"}bvsmod32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsge"} bvsge32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvsmod"} bvsmod32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -85,7 +85,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -94,13 +94,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert bvsge32(memory_load32_le(mem, $z_addr), memory_load32_le(mem, $z_addr)); @@ -204,7 +204,7 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; call rely(); @@ -214,7 +214,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), true); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000008ec"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R9, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R9, 52bv64)) || L(mem, bvadd64(R9, 52bv64))); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; @@ -225,7 +225,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000901"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R10, Gamma_R10 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); @@ -237,7 +237,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 60bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 60bv64), Gamma_R10); assert ((bvadd64(R8, 60bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000091a"} true; call rely(); assert (L(mem, bvadd64(R8, 60bv64)) ==> true); z_old := memory_load32_le(mem, $z_addr); @@ -245,7 +245,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 60bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 60bv64), true); assert ((bvadd64(R8, 60bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000921"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R9, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R9, 52bv64)) || L(mem, bvadd64(R9, 52bv64))); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; @@ -256,6 +256,6 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000936"} true; return; } diff --git a/src/test/correct/secret_write/clang_pic/secret_write.expected b/src/test/correct/secret_write/clang_pic/secret_write.expected index 4baf62826..ab5b6efc8 100644 --- a/src/test/correct/secret_write/clang_pic/secret_write.expected +++ b/src/test/correct/secret_write/clang_pic/secret_write.expected @@ -1,57 +1,57 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69688bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69692bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69688bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69692bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $x_addr) then (bvsmod32(memory_load32_le(memory, $z_addr), 2bv32) == 0bv32) else (if (index == $z_addr) then true else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsge"}bvsge32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvsmod"}bvsmod32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsge"} bvsge32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvsmod"} bvsmod32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -117,7 +117,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69566bv64) == 0bv8); free ensures (memory_load8_le(mem, 69567bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -126,13 +126,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert bvsge32(memory_load32_le(mem, $z_addr), memory_load32_le(mem, $z_addr)); @@ -284,7 +284,7 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4024bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4024bv64)) || L(mem, bvadd64(R9, 4024bv64))); @@ -296,7 +296,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R9, 0bv32), gamma_store32(Gamma_mem, R9, true); assert ((R9 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000308"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R9)), (gamma_load32(Gamma_mem, R9) || L(mem, R9)); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; @@ -307,7 +307,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assert ((R9 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%0000031d"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4048bv64)) || L(mem, bvadd64(R8, 4048bv64))); @@ -323,7 +323,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R8, R10[32:0]), gamma_store32(Gamma_mem, R8, Gamma_R10); assert ((R8 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%00000344"} true; call rely(); assert (L(mem, R8) ==> true); z_old := memory_load32_le(mem, $z_addr); @@ -331,7 +331,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R8, 0bv32), gamma_store32(Gamma_mem, R8, true); assert ((R8 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%0000034b"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R9)), (gamma_load32(Gamma_mem, R9) || L(mem, R9)); R8, Gamma_R8 := zero_extend32_32(bvadd32(R8[32:0], 1bv32)), Gamma_R8; @@ -342,6 +342,6 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assert ((R9 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x794"}true; + assume {:captureState "%00000360"} true; return; } diff --git a/src/test/correct/secret_write/gcc/secret_write.expected b/src/test/correct/secret_write/gcc/secret_write.expected index 80e69648c..79a5d1522 100644 --- a/src/test/correct/secret_write/gcc/secret_write.expected +++ b/src/test/correct/secret_write/gcc/secret_write.expected @@ -1,45 +1,45 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69660bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69656bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69660bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69656bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $x_addr) then (bvsmod32(memory_load32_le(memory, $z_addr), 2bv32) == 0bv32) else (if (index == $z_addr) then true else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsge"}bvsge32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvsmod"}bvsmod32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsge"} bvsge32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvsmod"} bvsmod32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -90,13 +90,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert bvsge32(memory_load32_le(mem, $z_addr), memory_load32_le(mem, $z_addr)); @@ -200,7 +200,7 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -210,7 +210,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000032a"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -225,7 +225,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000355"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 28bv64), Gamma_R0; call rely(); @@ -239,7 +239,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x750"}true; + assume {:captureState "%0000037a"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -249,7 +249,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%0000038c"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -264,7 +264,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%000003b7"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/secret_write/gcc_O2/secret_write.expected b/src/test/correct/secret_write/gcc_O2/secret_write.expected index fc00e6e23..2fc76ef05 100644 --- a/src/test/correct/secret_write/gcc_O2/secret_write.expected +++ b/src/test/correct/secret_write/gcc_O2/secret_write.expected @@ -1,47 +1,47 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_R3: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }R3: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69660bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_R3: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } R3: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69660bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $x_addr) then (bvsmod32(memory_load32_le(memory, $z_addr), 2bv32) == 0bv32) else (if (index == $z_addr) then true else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsge"}bvsge32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvsmod"}bvsmod32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsge"} bvsge32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvsmod"} bvsmod32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -92,13 +92,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert bvsge32(memory_load32_le(mem, $z_addr), memory_load32_le(mem, $z_addr)); @@ -202,7 +202,7 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := bvadd64(R1, 20bv64), Gamma_R1; R3, Gamma_R3 := 2bv64, true; @@ -214,7 +214,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), true); assert ((bvadd64(R1, 20bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001c2"} true; call rely(); assert (L(mem, bvadd64(R2, 4bv64)) ==> Gamma_R3); z_old := memory_load32_le(mem, $z_addr); @@ -222,6 +222,6 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R2, 4bv64), R3[32:0]), gamma_store32(Gamma_mem, bvadd64(R2, 4bv64), Gamma_R3); assert ((bvadd64(R2, 4bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x614"}true; + assume {:captureState "%000001ca"} true; return; } diff --git a/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write.expected b/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write.expected index 80e69648c..5de4303c7 100644 --- a/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write.expected +++ b/src/test/correct/secret_write/gcc_no_plt_no_pic/secret_write.expected @@ -1,45 +1,45 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69660bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69656bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69660bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69656bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $x_addr) then (bvsmod32(memory_load32_le(memory, $z_addr), 2bv32) == 0bv32) else (if (index == $z_addr) then true else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsge"}bvsge32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvsmod"}bvsmod32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsge"} bvsge32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvsmod"} bvsmod32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -90,13 +90,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert bvsge32(memory_load32_le(mem, $z_addr), memory_load32_le(mem, $z_addr)); @@ -200,7 +200,7 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -210,7 +210,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000009b8"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -225,7 +225,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%000009e3"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 28bv64), Gamma_R0; call rely(); @@ -239,7 +239,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x750"}true; + assume {:captureState "%00000a08"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); @@ -249,7 +249,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%00000a1a"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -264,7 +264,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%00000a45"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/secret_write/gcc_pic/secret_write.expected b/src/test/correct/secret_write/gcc_pic/secret_write.expected index dfdaf6ea3..26aaecbce 100644 --- a/src/test/correct/secret_write/gcc_pic/secret_write.expected +++ b/src/test/correct/secret_write/gcc_pic/secret_write.expected @@ -1,53 +1,53 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69660bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69656bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69660bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69656bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $x_addr) then (bvsmod32(memory_load32_le(memory, $z_addr), 2bv32) == 0bv32) else (if (index == $z_addr) then true else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvsge"}bvsge32(bv32, bv32) returns (bool); -function {:extern } {:bvbuiltin "bvsmod"}bvsmod32(bv32, bv32) returns (bv32); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvsge"} bvsge32(bv32, bv32) returns (bool); +function {:extern } {:bvbuiltin "bvsmod"} bvsmod32(bv32, bv32) returns (bv32); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); @@ -113,7 +113,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 68998bv64) == 0bv8); free ensures (memory_load8_le(mem, 68999bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $z_addr) == old(memory_load32_le(mem, $z_addr))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -122,13 +122,13 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr)); assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert bvsge32(memory_load32_le(mem, $z_addr), memory_load32_le(mem, $z_addr)); @@ -280,7 +280,7 @@ procedure main() var Gamma_x_old: bool; var z_old: bv32; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4048bv64)) || L(mem, bvadd64(R0, 4048bv64))); @@ -291,7 +291,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%0000032b"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4048bv64)) || L(mem, bvadd64(R0, 4048bv64))); @@ -308,7 +308,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%00000358"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); @@ -324,7 +324,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x790"}true; + assume {:captureState "%0000037f"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -335,7 +335,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x79c"}true; + assume {:captureState "%00000392"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4048bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4048bv64)) || L(mem, bvadd64(R0, 4048bv64))); @@ -352,7 +352,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert bvsge32(memory_load32_le(mem, $z_addr), z_old); - assume {:captureState "addr:0x7b8"}true; + assume {:captureState "%000003bf"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/simple_jump/clang/simple_jump.expected b/src/test/correct/simple_jump/clang/simple_jump.expected index 32e9685b4..a6d221d75 100644 --- a/src/test/correct/simple_jump/clang/simple_jump.expected +++ b/src/test/correct/simple_jump/clang/simple_jump.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1892bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1892bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -90,9 +90,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,13 +199,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002f1"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002fe"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967290bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934587bv33))), (Gamma_R8 && Gamma_#4); @@ -231,16 +231,16 @@ procedure main() } goto l0000034b; l0000034b: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l0000034b"} true; goto l0000034c; l0000034c: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l0000034c"} true; R8, Gamma_R8 := 6bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%0000035a"} true; goto l00000334; l00000334: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000334"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/simple_jump/clang_O2/simple_jump.expected b/src/test/correct/simple_jump/clang_O2/simple_jump.expected index 863d7bd46..dfc8a4e7d 100644 --- a/src/test/correct/simple_jump/clang_O2/simple_jump.expected +++ b/src/test/correct/simple_jump/clang_O2/simple_jump.expected @@ -1,14 +1,14 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1840bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1840bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -49,7 +49,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -58,9 +58,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -155,7 +155,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump.expected b/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump.expected index 8090021a9..6fcd81902 100644 --- a/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump.expected +++ b/src/test/correct/simple_jump/clang_no_plt_no_pic/simple_jump.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1892bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1892bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -90,9 +90,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,13 +199,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000903"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000910"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967290bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934587bv33))), (Gamma_R8 && Gamma_#4); @@ -231,16 +231,16 @@ procedure main() } goto l0000095d; l0000095d: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l0000095d"} true; goto l0000095e; l0000095e: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l0000095e"} true; R8, Gamma_R8 := 6bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%0000096c"} true; goto l00000946; l00000946: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000946"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/simple_jump/clang_pic/simple_jump.expected b/src/test/correct/simple_jump/clang_pic/simple_jump.expected index 8090021a9..6fcd81902 100644 --- a/src/test/correct/simple_jump/clang_pic/simple_jump.expected +++ b/src/test/correct/simple_jump/clang_pic/simple_jump.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1892bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1892bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -90,9 +90,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,13 +199,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000903"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000910"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967290bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934587bv33))), (Gamma_R8 && Gamma_#4); @@ -231,16 +231,16 @@ procedure main() } goto l0000095d; l0000095d: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l0000095d"} true; goto l0000095e; l0000095e: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l0000095e"} true; R8, Gamma_R8 := 6bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%0000096c"} true; goto l00000946; l00000946: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000946"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/simple_jump/gcc/simple_jump.expected b/src/test/correct/simple_jump/gcc/simple_jump.expected index 260f165dc..f38dfebe9 100644 --- a/src/test/correct/simple_jump/gcc/simple_jump.expected +++ b/src/test/correct/simple_jump/gcc/simple_jump.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1876bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1876bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -197,11 +197,11 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002e7"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#4); @@ -214,13 +214,13 @@ procedure main() } goto l0000031f; l0000031f: - assume {:captureState "addr:0x72c"}true; + assume {:captureState "addr:l0000031f"} true; R0, Gamma_R0 := 6bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%0000032a"} true; goto l0000030a; l0000030a: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l0000030a"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/simple_jump/gcc_O2/simple_jump.expected b/src/test/correct/simple_jump/gcc_O2/simple_jump.expected index 418f9a5da..db578d839 100644 --- a/src/test/correct/simple_jump/gcc_O2/simple_jump.expected +++ b/src/test/correct/simple_jump/gcc_O2/simple_jump.expected @@ -1,14 +1,14 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1896bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1896bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -49,7 +49,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -58,9 +58,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -155,7 +155,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump.expected b/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump.expected index fd5d1056b..4f0549236 100644 --- a/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump.expected +++ b/src/test/correct/simple_jump/gcc_no_plt_no_pic/simple_jump.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1876bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1876bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -197,11 +197,11 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000008be"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#4); @@ -214,13 +214,13 @@ procedure main() } goto l000008f6; l000008f6: - assume {:captureState "addr:0x72c"}true; + assume {:captureState "addr:l000008f6"} true; R0, Gamma_R0 := 6bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%00000901"} true; goto l000008e1; l000008e1: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l000008e1"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/simple_jump/gcc_pic/simple_jump.expected b/src/test/correct/simple_jump/gcc_pic/simple_jump.expected index fd5d1056b..4f0549236 100644 --- a/src/test/correct/simple_jump/gcc_pic/simple_jump.expected +++ b/src/test/correct/simple_jump/gcc_pic/simple_jump.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1876bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1876bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -197,11 +197,11 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000008be"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#4); @@ -214,13 +214,13 @@ procedure main() } goto l000008f6; l000008f6: - assume {:captureState "addr:0x72c"}true; + assume {:captureState "addr:l000008f6"} true; R0, Gamma_R0 := 6bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%00000901"} true; goto l000008e1; l000008e1: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l000008e1"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/switch/clang/switch.expected b/src/test/correct/switch/clang/switch.expected index 5d685847f..bb6a2c6e9 100644 --- a/src/test/correct/switch/clang/switch.expected +++ b/src/test/correct/switch/clang/switch.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1936bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1936bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,16 +199,16 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000323"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000032a"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000339"} true; #4, Gamma_#4 := bvadd32(R8[32:0], 4294967294bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934591bv33))), (Gamma_R8 && Gamma_#4); CF, Gamma_CF := bvnot1(bvcomp33(zero_extend1_32(bvadd32(#4, 1bv32)), bvadd33(zero_extend1_32(R8[32:0]), 4294967295bv33))), (Gamma_R8 && Gamma_#4); @@ -233,10 +233,10 @@ procedure main() } goto l0000039a; l0000039a: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l0000039a"} true; goto l0000039b; l0000039b: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l0000039b"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); #5, Gamma_#5 := bvadd32(R8[32:0], 4294967292bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934589bv33))), (Gamma_R8 && Gamma_#5); @@ -262,28 +262,28 @@ procedure main() } goto l000003d7; l00000389: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000389"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%00000394"} true; goto l0000037b; l000003d7: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l000003d7"} true; goto l000003d8; l000003d8: - assume {:captureState "addr:0x750"}true; + assume {:captureState "addr:l000003d8"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000003e6"} true; goto l00000368; l00000368: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l00000368"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000378"} true; goto l0000037b; l0000037b: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:l0000037b"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/switch/clang_O2/switch.expected b/src/test/correct/switch/clang_O2/switch.expected index 6ca38a2b2..a691307d3 100644 --- a/src/test/correct/switch/clang_O2/switch.expected +++ b/src/test/correct/switch/clang_O2/switch.expected @@ -1,12 +1,12 @@ -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1836bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1836bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -47,7 +47,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -56,9 +56,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -152,6 +152,6 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; return; } diff --git a/src/test/correct/switch/clang_no_plt_no_pic/switch.expected b/src/test/correct/switch/clang_no_plt_no_pic/switch.expected index f59c57b1d..f42ab7744 100644 --- a/src/test/correct/switch/clang_no_plt_no_pic/switch.expected +++ b/src/test/correct/switch/clang_no_plt_no_pic/switch.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1936bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1936bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,16 +199,16 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000009d8"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000009df"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000009ee"} true; #4, Gamma_#4 := bvadd32(R8[32:0], 4294967294bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934591bv33))), (Gamma_R8 && Gamma_#4); CF, Gamma_CF := bvnot1(bvcomp33(zero_extend1_32(bvadd32(#4, 1bv32)), bvadd33(zero_extend1_32(R8[32:0]), 4294967295bv33))), (Gamma_R8 && Gamma_#4); @@ -233,10 +233,10 @@ procedure main() } goto l00000a4f; l00000a4f: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000a4f"} true; goto l00000a50; l00000a50: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000a50"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); #5, Gamma_#5 := bvadd32(R8[32:0], 4294967292bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934589bv33))), (Gamma_R8 && Gamma_#5); @@ -262,28 +262,28 @@ procedure main() } goto l00000a8c; l00000a3e: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000a3e"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%00000a49"} true; goto l00000a30; l00000a8c: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l00000a8c"} true; goto l00000a8d; l00000a8d: - assume {:captureState "addr:0x750"}true; + assume {:captureState "addr:l00000a8d"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%00000a9b"} true; goto l00000a1d; l00000a1d: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l00000a1d"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000a2d"} true; goto l00000a30; l00000a30: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:l00000a30"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/switch/clang_pic/switch.expected b/src/test/correct/switch/clang_pic/switch.expected index f59c57b1d..f42ab7744 100644 --- a/src/test/correct/switch/clang_pic/switch.expected +++ b/src/test/correct/switch/clang_pic/switch.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1936bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1936bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,16 +199,16 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000009d8"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000009df"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000009ee"} true; #4, Gamma_#4 := bvadd32(R8[32:0], 4294967294bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934591bv33))), (Gamma_R8 && Gamma_#4); CF, Gamma_CF := bvnot1(bvcomp33(zero_extend1_32(bvadd32(#4, 1bv32)), bvadd33(zero_extend1_32(R8[32:0]), 4294967295bv33))), (Gamma_R8 && Gamma_#4); @@ -233,10 +233,10 @@ procedure main() } goto l00000a4f; l00000a4f: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000a4f"} true; goto l00000a50; l00000a50: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000a50"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); #5, Gamma_#5 := bvadd32(R8[32:0], 4294967292bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934589bv33))), (Gamma_R8 && Gamma_#5); @@ -262,28 +262,28 @@ procedure main() } goto l00000a8c; l00000a3e: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000a3e"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%00000a49"} true; goto l00000a30; l00000a8c: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l00000a8c"} true; goto l00000a8d; l00000a8d: - assume {:captureState "addr:0x750"}true; + assume {:captureState "addr:l00000a8d"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%00000a9b"} true; goto l00000a1d; l00000a1d: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l00000a1d"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000a2d"} true; goto l00000a30; l00000a30: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:l00000a30"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/switch/gcc/switch.expected b/src/test/correct/switch/gcc/switch.expected index 7ed50a4be..1c1f4e5b3 100644 --- a/src/test/correct/switch/gcc/switch.expected +++ b/src/test/correct/switch/gcc/switch.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1916bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1916bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,13 +199,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000030f"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000316"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#4); @@ -218,7 +218,7 @@ procedure main() } goto l0000036b; l0000036b: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l0000036b"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#5); @@ -231,25 +231,25 @@ procedure main() } goto l00000391; l0000035c: - assume {:captureState "addr:0x750"}true; + assume {:captureState "addr:l0000035c"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%00000367"} true; goto l0000034c; l00000391: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000391"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%0000039c"} true; goto l00000339; l00000339: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000339"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000349"} true; goto l0000034c; l0000034c: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l0000034c"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/switch/gcc_O2/switch.expected b/src/test/correct/switch/gcc_O2/switch.expected index cf806e8fd..9c7036705 100644 --- a/src/test/correct/switch/gcc_O2/switch.expected +++ b/src/test/correct/switch/gcc_O2/switch.expected @@ -1,12 +1,12 @@ -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1896bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1896bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -47,7 +47,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -56,9 +56,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -152,6 +152,6 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; return; } diff --git a/src/test/correct/switch/gcc_no_plt_no_pic/switch.expected b/src/test/correct/switch/gcc_no_plt_no_pic/switch.expected index 5418587da..c5cfde371 100644 --- a/src/test/correct/switch/gcc_no_plt_no_pic/switch.expected +++ b/src/test/correct/switch/gcc_no_plt_no_pic/switch.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1916bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1916bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,13 +199,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000096e"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000975"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#4); @@ -218,7 +218,7 @@ procedure main() } goto l000009ca; l000009ca: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l000009ca"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#5); @@ -231,25 +231,25 @@ procedure main() } goto l000009f0; l000009bb: - assume {:captureState "addr:0x750"}true; + assume {:captureState "addr:l000009bb"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000009c6"} true; goto l000009ab; l000009f0: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l000009f0"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%000009fb"} true; goto l00000998; l00000998: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000998"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%000009a8"} true; goto l000009ab; l000009ab: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l000009ab"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/switch/gcc_pic/switch.expected b/src/test/correct/switch/gcc_pic/switch.expected index 5418587da..c5cfde371 100644 --- a/src/test/correct/switch/gcc_pic/switch.expected +++ b/src/test/correct/switch/gcc_pic/switch.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1916bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1916bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -199,13 +199,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000096e"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%00000975"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#4); @@ -218,7 +218,7 @@ procedure main() } goto l000009ca; l000009ca: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l000009ca"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#5); @@ -231,25 +231,25 @@ procedure main() } goto l000009f0; l000009bb: - assume {:captureState "addr:0x750"}true; + assume {:captureState "addr:l000009bb"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000009c6"} true; goto l000009ab; l000009f0: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l000009f0"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%000009fb"} true; goto l00000998; l00000998: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000998"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%000009a8"} true; goto l000009ab; l000009ab: - assume {:captureState "addr:0x75c"}true; + assume {:captureState "addr:l000009ab"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/correct/switch2/clang_O2/switch2.expected b/src/test/correct/switch2/clang_O2/switch2.expected index fc05afa85..00ab15c63 100644 --- a/src/test/correct/switch2/clang_O2/switch2.expected +++ b/src/test/correct/switch2/clang_O2/switch2.expected @@ -1,11 +1,11 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }mem: [bv64]bv8; -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } mem: [bv64]bv8; +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -46,7 +46,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -55,9 +55,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -152,6 +152,6 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x71c"}true; + assume {:captureState "addr:lmain"} true; return; } diff --git a/src/test/correct/switch2/gcc/switch2.expected b/src/test/correct/switch2/gcc/switch2.expected index 2dd4115fb..979e96843 100644 --- a/src/test/correct/switch2/gcc/switch2.expected +++ b/src/test/correct/switch2/gcc/switch2.expected @@ -1,65 +1,65 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvand"}bvand1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvand"} bvand1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -100,7 +100,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -109,9 +109,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -237,20 +237,20 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x71c"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000386"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000038c"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000039e"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000003a6"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), true); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000003ad"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#5); @@ -263,13 +263,13 @@ procedure main() } goto l00000408; l000003d0: - assume {:captureState "addr:0x7bc"}true; + assume {:captureState "addr:l000003d0"} true; R0, Gamma_R0 := 4bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "%000003e0"} true; goto l000003e2; l00000408: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000408"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#6); @@ -282,7 +282,7 @@ procedure main() } goto l00000430; l00000430: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000430"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #7, Gamma_#7 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#7, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#7); @@ -295,7 +295,7 @@ procedure main() } goto l00000467; l00000467: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l00000467"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #8, Gamma_#8 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#8, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#8); @@ -308,7 +308,7 @@ procedure main() } goto l0000048f; l0000048f: - assume {:captureState "addr:0x760"}true; + assume {:captureState "addr:l0000048f"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #9, Gamma_#9 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#9, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#9); @@ -321,17 +321,17 @@ procedure main() } goto l000004e2; l000004b0: - assume {:captureState "addr:0x794"}true; + assume {:captureState "addr:l000004b0"} true; R30, Gamma_R30 := 1944bv64, true; call r(); goto l000004bc; l000004bc: - assume {:captureState "addr:0x798"}true; + assume {:captureState "addr:l000004bc"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x798"}true; + assume {:captureState "%000004c2"} true; goto l000004c4; l000004e2: - assume {:captureState "addr:0x76c"}true; + assume {:captureState "addr:l000004e2"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #10, Gamma_#10 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#10, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#10); @@ -344,7 +344,7 @@ procedure main() } goto l0000050a; l0000050a: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l0000050a"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #11, Gamma_#11 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#11, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#11); @@ -357,13 +357,13 @@ procedure main() } goto l00000530; l000004c4: - assume {:captureState "addr:0x79c"}true; + assume {:captureState "addr:l000004c4"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7a0"}true; + assume {:captureState "%000004cf"} true; goto l000003f1; l00000530: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:l00000530"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #12, Gamma_#12 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#12, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#12); @@ -376,28 +376,28 @@ procedure main() } goto l00000556; l000004d5: - assume {:captureState "addr:0x7a8"}true; + assume {:captureState "addr:l000004d5"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7ac"}true; + assume {:captureState "%000004e0"} true; goto l00000451; l00000451: - assume {:captureState "addr:0x7b0"}true; + assume {:captureState "addr:l00000451"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "%00000461"} true; goto l000003f1; l00000556: - assume {:captureState "addr:0x790"}true; + assume {:captureState "addr:l00000556"} true; goto l000003e2; l000003e2: - assume {:captureState "addr:0x7c4"}true; + assume {:captureState "addr:l000003e2"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7c8"}true; + assume {:captureState "%000003ed"} true; goto l000003f1; l000003f1: - assume {:captureState "addr:0x7d0"}true; + assume {:captureState "addr:l000003f1"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; @@ -480,7 +480,7 @@ procedure r() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lr: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lr"} true; R0, Gamma_R0 := 1bv64, true; return; } diff --git a/src/test/correct/switch2/gcc_O2/switch2.expected b/src/test/correct/switch2/gcc_O2/switch2.expected index 40a765b0b..3b9fce4b6 100644 --- a/src/test/correct/switch2/gcc_O2/switch2.expected +++ b/src/test/correct/switch2/gcc_O2/switch2.expected @@ -1,11 +1,11 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }mem: [bv64]bv8; -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } mem: [bv64]bv8; +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -46,7 +46,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -55,9 +55,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -152,6 +152,6 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; return; } diff --git a/src/test/correct/switch2/gcc_no_plt_no_pic/switch2.expected b/src/test/correct/switch2/gcc_no_plt_no_pic/switch2.expected index 3128f788a..f2edcd64a 100644 --- a/src/test/correct/switch2/gcc_no_plt_no_pic/switch2.expected +++ b/src/test/correct/switch2/gcc_no_plt_no_pic/switch2.expected @@ -1,65 +1,65 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvand"}bvand1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvand"} bvand1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -100,7 +100,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -109,9 +109,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -237,20 +237,20 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x71c"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000be5"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000beb"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000bfd"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000c05"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), true); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%00000c0c"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#5); @@ -263,13 +263,13 @@ procedure main() } goto l00000c67; l00000c2f: - assume {:captureState "addr:0x7bc"}true; + assume {:captureState "addr:l00000c2f"} true; R0, Gamma_R0 := 4bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "%00000c3f"} true; goto l00000c41; l00000c67: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000c67"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#6); @@ -282,7 +282,7 @@ procedure main() } goto l00000c8f; l00000c8f: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000c8f"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #7, Gamma_#7 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#7, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#7); @@ -295,7 +295,7 @@ procedure main() } goto l00000cc6; l00000cc6: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l00000cc6"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #8, Gamma_#8 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#8, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#8); @@ -308,7 +308,7 @@ procedure main() } goto l00000cee; l00000cee: - assume {:captureState "addr:0x760"}true; + assume {:captureState "addr:l00000cee"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #9, Gamma_#9 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#9, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#9); @@ -321,17 +321,17 @@ procedure main() } goto l00000d41; l00000d0f: - assume {:captureState "addr:0x794"}true; + assume {:captureState "addr:l00000d0f"} true; R30, Gamma_R30 := 1944bv64, true; call r(); goto l00000d1b; l00000d1b: - assume {:captureState "addr:0x798"}true; + assume {:captureState "addr:l00000d1b"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x798"}true; + assume {:captureState "%00000d21"} true; goto l00000d23; l00000d41: - assume {:captureState "addr:0x76c"}true; + assume {:captureState "addr:l00000d41"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #10, Gamma_#10 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#10, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#10); @@ -344,7 +344,7 @@ procedure main() } goto l00000d69; l00000d69: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l00000d69"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #11, Gamma_#11 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#11, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#11); @@ -357,13 +357,13 @@ procedure main() } goto l00000d8f; l00000d23: - assume {:captureState "addr:0x79c"}true; + assume {:captureState "addr:l00000d23"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7a0"}true; + assume {:captureState "%00000d2e"} true; goto l00000c50; l00000d8f: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:l00000d8f"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #12, Gamma_#12 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#12, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#12); @@ -376,28 +376,28 @@ procedure main() } goto l00000db5; l00000d34: - assume {:captureState "addr:0x7a8"}true; + assume {:captureState "addr:l00000d34"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7ac"}true; + assume {:captureState "%00000d3f"} true; goto l00000cb0; l00000cb0: - assume {:captureState "addr:0x7b0"}true; + assume {:captureState "addr:l00000cb0"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "%00000cc0"} true; goto l00000c50; l00000db5: - assume {:captureState "addr:0x790"}true; + assume {:captureState "addr:l00000db5"} true; goto l00000c41; l00000c41: - assume {:captureState "addr:0x7c4"}true; + assume {:captureState "addr:l00000c41"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7c8"}true; + assume {:captureState "%00000c4c"} true; goto l00000c50; l00000c50: - assume {:captureState "addr:0x7d0"}true; + assume {:captureState "addr:l00000c50"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; @@ -480,7 +480,7 @@ procedure r() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lr: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lr"} true; R0, Gamma_R0 := 1bv64, true; return; } diff --git a/src/test/correct/switch2/gcc_pic/switch2.expected b/src/test/correct/switch2/gcc_pic/switch2.expected index 3128f788a..f2edcd64a 100644 --- a/src/test/correct/switch2/gcc_pic/switch2.expected +++ b/src/test/correct/switch2/gcc_pic/switch2.expected @@ -1,65 +1,65 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvand"}bvand1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvand"} bvand1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -100,7 +100,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -109,9 +109,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -237,20 +237,20 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x71c"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000be5"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000beb"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000bfd"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000c05"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), true); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%00000c0c"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #5, Gamma_#5 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#5, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#5); @@ -263,13 +263,13 @@ procedure main() } goto l00000c67; l00000c2f: - assume {:captureState "addr:0x7bc"}true; + assume {:captureState "addr:l00000c2f"} true; R0, Gamma_R0 := 4bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "%00000c3f"} true; goto l00000c41; l00000c67: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000c67"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967290bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934587bv33))), (Gamma_R0 && Gamma_#6); @@ -282,7 +282,7 @@ procedure main() } goto l00000c8f; l00000c8f: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000c8f"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #7, Gamma_#7 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#7, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#7); @@ -295,7 +295,7 @@ procedure main() } goto l00000cc6; l00000cc6: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:l00000cc6"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #8, Gamma_#8 := bvadd32(R0[32:0], 4294967291bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#8, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934588bv33))), (Gamma_R0 && Gamma_#8); @@ -308,7 +308,7 @@ procedure main() } goto l00000cee; l00000cee: - assume {:captureState "addr:0x760"}true; + assume {:captureState "addr:l00000cee"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #9, Gamma_#9 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#9, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#9); @@ -321,17 +321,17 @@ procedure main() } goto l00000d41; l00000d0f: - assume {:captureState "addr:0x794"}true; + assume {:captureState "addr:l00000d0f"} true; R30, Gamma_R30 := 1944bv64, true; call r(); goto l00000d1b; l00000d1b: - assume {:captureState "addr:0x798"}true; + assume {:captureState "addr:l00000d1b"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x798"}true; + assume {:captureState "%00000d21"} true; goto l00000d23; l00000d41: - assume {:captureState "addr:0x76c"}true; + assume {:captureState "addr:l00000d41"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #10, Gamma_#10 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#10, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#10); @@ -344,7 +344,7 @@ procedure main() } goto l00000d69; l00000d69: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l00000d69"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #11, Gamma_#11 := bvadd32(R0[32:0], 4294967294bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#11, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934591bv33))), (Gamma_R0 && Gamma_#11); @@ -357,13 +357,13 @@ procedure main() } goto l00000d8f; l00000d23: - assume {:captureState "addr:0x79c"}true; + assume {:captureState "addr:l00000d23"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7a0"}true; + assume {:captureState "%00000d2e"} true; goto l00000c50; l00000d8f: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:l00000d8f"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #12, Gamma_#12 := bvadd32(R0[32:0], 4294967293bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#12, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934590bv33))), (Gamma_R0 && Gamma_#12); @@ -376,28 +376,28 @@ procedure main() } goto l00000db5; l00000d34: - assume {:captureState "addr:0x7a8"}true; + assume {:captureState "addr:l00000d34"} true; R0, Gamma_R0 := 2bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7ac"}true; + assume {:captureState "%00000d3f"} true; goto l00000cb0; l00000cb0: - assume {:captureState "addr:0x7b0"}true; + assume {:captureState "addr:l00000cb0"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "%00000cc0"} true; goto l00000c50; l00000db5: - assume {:captureState "addr:0x790"}true; + assume {:captureState "addr:l00000db5"} true; goto l00000c41; l00000c41: - assume {:captureState "addr:0x7c4"}true; + assume {:captureState "addr:l00000c41"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x7c8"}true; + assume {:captureState "%00000c4c"} true; goto l00000c50; l00000c50: - assume {:captureState "addr:0x7d0"}true; + assume {:captureState "addr:l00000c50"} true; R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R31, Gamma_R31 := bvadd64(R31, 48bv64), Gamma_R31; @@ -480,7 +480,7 @@ procedure r() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lr: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lr"} true; R0, Gamma_R0 := 1bv64, true; return; } diff --git a/src/test/correct/syscall/clang/syscall.expected b/src/test/correct/syscall/clang/syscall.expected index 16febb0c3..63c701a70 100644 --- a/src/test/correct/syscall/clang/syscall.expected +++ b/src/test/correct/syscall/clang/syscall.expected @@ -1,62 +1,62 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1944bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1944bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -97,7 +97,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69686bv64) == 0bv8); free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -106,9 +106,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure fork(); @@ -286,27 +286,27 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002ea"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002f0"} true; R29, Gamma_R29 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002fd"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551608bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551608bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%00000305"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%0000030d"} true; R30, Gamma_R30 := 1904bv64, true; call fork(); goto l00000317; l00000317: - assume {:captureState "addr:0x770"}true; + assume {:captureState "addr:l00000317"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x770"}true; + assume {:captureState "%0000031d"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); #5, Gamma_#5 := bvadd64(R31, 32bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/syscall/clang_no_plt_no_pic/syscall.expected b/src/test/correct/syscall/clang_no_plt_no_pic/syscall.expected index d6e7b2e96..ec5e63070 100644 --- a/src/test/correct/syscall/clang_no_plt_no_pic/syscall.expected +++ b/src/test/correct/syscall/clang_no_plt_no_pic/syscall.expected @@ -1,62 +1,62 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1944bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1944bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -97,7 +97,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69686bv64) == 0bv8); free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -106,9 +106,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure fork(); @@ -286,27 +286,27 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000902"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000908"} true; R29, Gamma_R29 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000915"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551608bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551608bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%0000091d"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000925"} true; R30, Gamma_R30 := 1904bv64, true; call fork(); goto l0000092f; l0000092f: - assume {:captureState "addr:0x770"}true; + assume {:captureState "addr:l0000092f"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x770"}true; + assume {:captureState "%00000935"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); #5, Gamma_#5 := bvadd64(R31, 32bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/syscall/clang_pic/syscall.expected b/src/test/correct/syscall/clang_pic/syscall.expected index d6e7b2e96..ec5e63070 100644 --- a/src/test/correct/syscall/clang_pic/syscall.expected +++ b/src/test/correct/syscall/clang_pic/syscall.expected @@ -1,62 +1,62 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1944bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1944bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -97,7 +97,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69686bv64) == 0bv8); free ensures (memory_load8_le(mem, 69687bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -106,9 +106,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure fork(); @@ -286,27 +286,27 @@ procedure main() var Gamma_#4: bool; var Gamma_#5: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; #4, Gamma_#4 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000902"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000908"} true; R29, Gamma_R29 := bvadd64(R31, 32bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551612bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551612bv64), true); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%00000915"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R29, 18446744073709551608bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R29, 18446744073709551608bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%0000091d"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000925"} true; R30, Gamma_R30 := 1904bv64, true; call fork(); goto l0000092f; l0000092f: - assume {:captureState "addr:0x770"}true; + assume {:captureState "addr:l0000092f"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x770"}true; + assume {:captureState "%00000935"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); #5, Gamma_#5 := bvadd64(R31, 32bv64), Gamma_R31; R29, Gamma_R29 := memory_load64_le(stack, #5), gamma_load64(Gamma_stack, #5); diff --git a/src/test/correct/syscall/gcc/syscall.expected b/src/test/correct/syscall/gcc/syscall.expected index c22fb9300..6e685e564 100644 --- a/src/test/correct/syscall/gcc/syscall.expected +++ b/src/test/correct/syscall/gcc/syscall.expected @@ -1,62 +1,62 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1932bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1932bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -97,7 +97,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -106,9 +106,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure fork(); @@ -284,25 +284,25 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002d8"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000002de"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%000002f0"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002f8"} true; R30, Gamma_R30 := 1896bv64, true; call fork(); goto l00000302; l00000302: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000302"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000308"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 44bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 44bv64)); R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/syscall/gcc_O2/syscall.expected b/src/test/correct/syscall/gcc_O2/syscall.expected index 29ff7f2b3..1147e7be6 100644 --- a/src/test/correct/syscall/gcc_O2/syscall.expected +++ b/src/test/correct/syscall/gcc_O2/syscall.expected @@ -1,16 +1,16 @@ -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1960bv64); -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1960bv64); +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -51,7 +51,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -60,9 +60,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure fork(); diff --git a/src/test/correct/syscall/gcc_no_plt_no_pic/syscall.expected b/src/test/correct/syscall/gcc_no_plt_no_pic/syscall.expected index 605df38e0..9a1a0f525 100644 --- a/src/test/correct/syscall/gcc_no_plt_no_pic/syscall.expected +++ b/src/test/correct/syscall/gcc_no_plt_no_pic/syscall.expected @@ -1,62 +1,62 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1932bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1932bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -97,7 +97,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -106,9 +106,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure fork(); @@ -284,25 +284,25 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000008cf"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000008d5"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%000008e7"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000008ef"} true; R30, Gamma_R30 := 1896bv64, true; call fork(); goto l000008f9; l000008f9: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l000008f9"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%000008ff"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 44bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 44bv64)); R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/syscall/gcc_pic/syscall.expected b/src/test/correct/syscall/gcc_pic/syscall.expected index 605df38e0..9a1a0f525 100644 --- a/src/test/correct/syscall/gcc_pic/syscall.expected +++ b/src/test/correct/syscall/gcc_pic/syscall.expected @@ -1,62 +1,62 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R16: bool; -var {:extern }Gamma_R17: bool; -var {:extern }Gamma_R29: bool; -var {:extern }Gamma_R30: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R16: bv64; -var {:extern }R17: bv64; -var {:extern }R29: bv64; -var {:extern }R30: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$_IO_stdin_used_addr: bv64; -axiom {:extern }($_IO_stdin_used_addr == 1932bv64); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R16: bool; +var {:extern } Gamma_R17: bool; +var {:extern } Gamma_R29: bool; +var {:extern } Gamma_R30: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R16: bv64; +var {:extern } R17: bv64; +var {:extern } R29: bv64; +var {:extern } R30: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $_IO_stdin_used_addr: bv64; +axiom ($_IO_stdin_used_addr == 1932bv64); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -97,7 +97,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -106,9 +106,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure fork(); @@ -284,25 +284,25 @@ procedure main() var #4: bv64; var Gamma_#4: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; #4, Gamma_#4 := bvadd64(R31, 18446744073709551568bv64), Gamma_R31; stack, Gamma_stack := memory_store64_le(stack, #4, R29), gamma_store64(Gamma_stack, #4, Gamma_R29); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000008cf"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(#4, 8bv64), R30), gamma_store64(Gamma_stack, bvadd64(#4, 8bv64), Gamma_R30); - assume {:captureState "addr:0x754"}true; + assume {:captureState "%000008d5"} true; R31, Gamma_R31 := #4, Gamma_#4; R29, Gamma_R29 := R31, Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x75c"}true; + assume {:captureState "%000008e7"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 16bv64), R1), gamma_store64(Gamma_stack, bvadd64(R31, 16bv64), Gamma_R1); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000008ef"} true; R30, Gamma_R30 := 1896bv64, true; call fork(); goto l000008f9; l000008f9: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l000008f9"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 44bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 44bv64), Gamma_R0); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%000008ff"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 44bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 44bv64)); R29, Gamma_R29 := memory_load64_le(stack, R31), gamma_load64(Gamma_stack, R31); R30, Gamma_R30 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); diff --git a/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional.expected index 19b31d637..b28d5fecc 100644 --- a/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/clang/using_gamma_conditional.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); { @@ -95,12 +95,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); @@ -211,10 +211,10 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002f5"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -242,21 +242,21 @@ procedure main() } goto l00000358; l00000330: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l00000330"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000340"} true; goto l00000343; l00000358: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000358"} true; goto l00000359; l00000359: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l00000359"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000361"} true; goto l00000343; l00000343: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000343"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional.expected index d44f99374..70a7a92c3 100644 --- a/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/clang_O2/using_gamma_conditional.expected @@ -1,40 +1,40 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -75,7 +75,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); { @@ -83,12 +83,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); @@ -197,7 +197,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); diff --git a/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional.expected index eb2bb7d65..5bd1f8366 100644 --- a/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/clang_no_plt_no_pic/using_gamma_conditional.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -87,7 +87,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); { @@ -95,12 +95,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); @@ -211,10 +211,10 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000910"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -242,21 +242,21 @@ procedure main() } goto l00000973; l0000094b: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l0000094b"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%0000095b"} true; goto l0000095e; l00000973: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000973"} true; goto l00000974; l00000974: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l00000974"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%0000097c"} true; goto l0000095e; l0000095e: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l0000095e"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional.expected index 3055085a8..02566c5be 100644 --- a/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/clang_pic/using_gamma_conditional.expected @@ -1,60 +1,60 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -103,7 +103,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69598bv64) == 0bv8); free ensures (memory_load8_le(mem, 69599bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); { @@ -111,12 +111,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); @@ -243,10 +243,10 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000002f9"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4040bv64)) || L(mem, bvadd64(R8, 4040bv64))); @@ -276,21 +276,21 @@ procedure main() } goto l00000363; l0000033b: - assume {:captureState "addr:0x780"}true; + assume {:captureState "addr:l0000033b"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%0000034b"} true; goto l0000034e; l00000363: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:l00000363"} true; goto l00000364; l00000364: - assume {:captureState "addr:0x778"}true; + assume {:captureState "addr:l00000364"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%0000036c"} true; goto l0000034e; l0000034e: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l0000034e"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional.expected index 91c5174a3..9c3a5aa73 100644 --- a/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/gcc/using_gamma_conditional.expected @@ -1,38 +1,38 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -73,7 +73,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); { @@ -81,12 +81,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); @@ -195,7 +195,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -211,14 +211,14 @@ procedure main() } goto l00000309; l000002fa: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l000002fa"} true; R0, Gamma_R0 := 1bv64, true; goto l00000304; l00000309: - assume {:captureState "addr:0x728"}true; + assume {:captureState "addr:l00000309"} true; R0, Gamma_R0 := 0bv64, true; goto l00000304; l00000304: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l00000304"} true; return; } diff --git a/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional.expected index 91d0231c6..b9ad0a983 100644 --- a/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/gcc_O2/using_gamma_conditional.expected @@ -1,38 +1,38 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -73,7 +73,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); { @@ -81,12 +81,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); @@ -195,7 +195,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, bvadd64(R0, 20bv64))), (gamma_load32(Gamma_mem, bvadd64(R0, 20bv64)) || L(mem, bvadd64(R0, 20bv64))); diff --git a/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional.expected index 1d618a77c..7eff00ef6 100644 --- a/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/gcc_no_plt_no_pic/using_gamma_conditional.expected @@ -1,38 +1,38 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -73,7 +73,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); { @@ -81,12 +81,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); @@ -195,7 +195,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -211,14 +211,14 @@ procedure main() } goto l000008c2; l000008b3: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l000008b3"} true; R0, Gamma_R0 := 1bv64, true; goto l000008bd; l000008c2: - assume {:captureState "addr:0x728"}true; + assume {:captureState "addr:l000008c2"} true; R0, Gamma_R0 := 0bv64, true; goto l000008bd; l000008bd: - assume {:captureState "addr:0x734"}true; + assume {:captureState "addr:l000008bd"} true; return; } diff --git a/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional.expected b/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional.expected index 55866c8b9..c801ee5ba 100644 --- a/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional.expected +++ b/src/test/correct/using_gamma_conditional/gcc_pic/using_gamma_conditional.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -89,7 +89,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69014bv64) == 0bv8); free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (old(gamma_load32(Gamma_mem, $x_addr)) ==> gamma_load32(Gamma_mem, $x_addr)); { @@ -97,12 +97,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); @@ -227,7 +227,7 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -244,14 +244,14 @@ procedure main() } goto l0000030a; l000002fb: - assume {:captureState "addr:0x770"}true; + assume {:captureState "addr:l000002fb"} true; R0, Gamma_R0 := 1bv64, true; goto l00000305; l0000030a: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l0000030a"} true; R0, Gamma_R0 := 0bv64, true; goto l00000305; l00000305: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:l00000305"} true; return; } diff --git a/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z.expected index 5257e2483..d5c6f60ac 100644 --- a/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/clang/using_gamma_write_z.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); { @@ -84,12 +84,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -189,7 +189,7 @@ procedure main() { var Gamma_x_old: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 1bv64, true; call rely(); @@ -198,7 +198,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002ce"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z.expected index 1ad5400b4..94dfe0e17 100644 --- a/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/clang_O2/using_gamma_write_z.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); { @@ -84,12 +84,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -189,7 +189,7 @@ procedure main() { var Gamma_x_old: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 1bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -199,6 +199,6 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); assert ((bvadd64(R8, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d3"} true; return; } diff --git a/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z.expected index 5257e2483..5e1b2c563 100644 --- a/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/clang_no_plt_no_pic/using_gamma_write_z.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); { @@ -84,12 +84,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -189,7 +189,7 @@ procedure main() { var Gamma_x_old: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 69632bv64, true; R8, Gamma_R8 := 1bv64, true; call rely(); @@ -198,7 +198,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 52bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 52bv64), Gamma_R8); assert ((bvadd64(R9, 52bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000845"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z.expected index 9d4f0b023..14214bad0 100644 --- a/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/clang_pic/using_gamma_write_z.expected @@ -1,49 +1,49 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69684bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69684bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); @@ -92,7 +92,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69598bv64) == 0bv8); free ensures (memory_load8_le(mem, 69599bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); { @@ -100,12 +100,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -221,7 +221,7 @@ procedure main() { var Gamma_x_old: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R9, Gamma_R9 := 65536bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R9, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R9, 4040bv64)) || L(mem, bvadd64(R9, 4040bv64))); @@ -232,7 +232,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); assert ((R9 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z.expected index faa535bd0..e7b37f433 100644 --- a/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/gcc/using_gamma_write_z.expected @@ -1,39 +1,39 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); @@ -74,7 +74,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); { @@ -82,12 +82,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -187,7 +187,7 @@ procedure main() { var Gamma_x_old: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -197,7 +197,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002d8"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z.expected index 137eb78e6..dd1f6d89b 100644 --- a/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/gcc_O2/using_gamma_write_z.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69656bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69656bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); { @@ -84,12 +84,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -189,7 +189,7 @@ procedure main() { var Gamma_x_old: bool; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := 1bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -199,6 +199,6 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); assert ((bvadd64(R1, 20bv64) == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); - assume {:captureState "addr:0x60c"}true; + assume {:captureState "%000001bd"} true; return; } diff --git a/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z.expected index faa535bd0..730fa2be4 100644 --- a/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/gcc_no_plt_no_pic/using_gamma_write_z.expected @@ -1,39 +1,39 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); @@ -74,7 +74,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); { @@ -82,12 +82,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -187,7 +187,7 @@ procedure main() { var Gamma_x_old: bool; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := 1bv64, true; @@ -197,7 +197,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%0000085b"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z.expected b/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z.expected index 15fdf23f4..24b2a2181 100644 --- a/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z.expected +++ b/src/test/correct/using_gamma_write_z/gcc_pic/using_gamma_write_z.expected @@ -1,47 +1,47 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $x_addr) then (memory_load32_le(memory, $z_addr) == 0bv32) else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); @@ -90,7 +90,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69014bv64) == 0bv8); free ensures (memory_load8_le(mem, 69015bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures ((old(memory_load32_le(mem, $x_addr)) == memory_load32_le(mem, $x_addr)) && (old(memory_load32_le(mem, $z_addr)) == memory_load32_le(mem, $z_addr))); { @@ -98,12 +98,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert ((memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)) && (memory_load32_le(mem, $z_addr) == memory_load32_le(mem, $z_addr))); } -procedure {:extern }guarantee_reflexive() +procedure {:extern } guarantee_reflexive() modifies Gamma_mem, mem; { assert (gamma_load32(Gamma_mem, $x_addr) ==> gamma_load32(Gamma_mem, $x_addr)); @@ -219,7 +219,7 @@ procedure main() { var Gamma_x_old: bool; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -230,7 +230,7 @@ procedure main() mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); assert ((R0 == $z_addr) ==> (L(mem, $x_addr) ==> Gamma_x_old)); assert (Gamma_x_old ==> gamma_load32(Gamma_mem, $x_addr)); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%000002d9"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/incorrect/basicassign/clang/basicassign.expected b/src/test/incorrect/basicassign/clang/basicassign.expected index a768e33c0..dcd284749 100644 --- a/src/test/incorrect/basicassign/clang/basicassign.expected +++ b/src/test/incorrect/basicassign/clang/basicassign.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R11: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R11: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69684bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69692bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R11: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R11: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69684bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69692bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else (if (index == $x_addr) then false else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -91,12 +91,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -191,7 +191,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R10, Gamma_R10 := 69632bv64, true; call rely(); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(mem, bvadd64(R10, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R10, 52bv64)) || L(mem, bvadd64(R10, 52bv64))); @@ -199,30 +199,30 @@ procedure main() call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), Gamma_R9); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002f9"} true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> true); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000305"} true; call rely(); R11, Gamma_R11 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 60bv64)) ==> Gamma_R11); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 60bv64), R11[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 60bv64), Gamma_R11); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000319"} true; call rely(); R10, Gamma_R10 := zero_extend32_32(memory_load32_le(mem, bvadd64(R10, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R10, 52bv64)) || L(mem, bvadd64(R10, 52bv64))); call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), Gamma_R10); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000328"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); call rely(); assert (L(mem, bvadd64(R9, 60bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 60bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 60bv64), Gamma_R8); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%00000337"} true; return; } diff --git a/src/test/incorrect/basicassign/clang_O2/basicassign.expected b/src/test/incorrect/basicassign/clang_O2/basicassign.expected index b9d00d50e..c75852079 100644 --- a/src/test/incorrect/basicassign/clang_O2/basicassign.expected +++ b/src/test/incorrect/basicassign/clang_O2/basicassign.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69684bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69692bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69684bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69692bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else (if (index == $x_addr) then false else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -89,12 +89,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -189,7 +189,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; R9, Gamma_R9 := 69632bv64, true; @@ -199,10 +199,10 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000002eb"} true; call rely(); assert (L(mem, bvadd64(R10, 60bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R10, 60bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R10, 60bv64), Gamma_R8); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%000002f3"} true; return; } diff --git a/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign.expected b/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign.expected index a768e33c0..96a69ffd6 100644 --- a/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign.expected +++ b/src/test/incorrect/basicassign/clang_no_plt_no_pic/basicassign.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R11: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R11: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69684bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69692bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R11: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R11: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69684bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69692bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else (if (index == $x_addr) then false else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -91,12 +91,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -191,7 +191,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R10, Gamma_R10 := 69632bv64, true; call rely(); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(mem, bvadd64(R10, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R10, 52bv64)) || L(mem, bvadd64(R10, 52bv64))); @@ -199,30 +199,30 @@ procedure main() call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), Gamma_R9); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000008e6"} true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> true); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), 0bv32), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), true); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000008f2"} true; call rely(); R11, Gamma_R11 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 60bv64)) ==> Gamma_R11); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 60bv64), R11[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 60bv64), Gamma_R11); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000906"} true; call rely(); R10, Gamma_R10 := zero_extend32_32(memory_load32_le(mem, bvadd64(R10, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R10, 52bv64)) || L(mem, bvadd64(R10, 52bv64))); call rely(); assert (L(mem, bvadd64(R8, 56bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 56bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 56bv64), Gamma_R10); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000915"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); call rely(); assert (L(mem, bvadd64(R9, 60bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 60bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 60bv64), Gamma_R8); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%00000924"} true; return; } diff --git a/src/test/incorrect/basicassign/clang_pic/basicassign.expected b/src/test/incorrect/basicassign/clang_pic/basicassign.expected index b64b8edc6..90596d82e 100644 --- a/src/test/incorrect/basicassign/clang_pic/basicassign.expected +++ b/src/test/incorrect/basicassign/clang_pic/basicassign.expected @@ -1,56 +1,56 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R11: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R11: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69684bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69692bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R11: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R11: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69684bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69692bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else (if (index == $x_addr) then false else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -115,7 +115,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69566bv64) == 0bv8); free ensures (memory_load8_le(mem, 69567bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -123,12 +123,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -271,7 +271,7 @@ procedure main() free ensures (memory_load8_le(mem, 69567bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4032bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4032bv64)) || L(mem, bvadd64(R8, 4032bv64))); @@ -283,12 +283,12 @@ procedure main() call rely(); assert (L(mem, R8) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, R8, R9[32:0]), gamma_store32(Gamma_mem, R8, Gamma_R9); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000313"} true; R0, Gamma_R0 := 0bv64, true; call rely(); assert (L(mem, R8) ==> true); mem, Gamma_mem := memory_store32_le(mem, R8, 0bv32), gamma_store32(Gamma_mem, R8, true); - assume {:captureState "addr:0x770"}true; + assume {:captureState "%0000031f"} true; call rely(); R11, Gamma_R11 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); R9, Gamma_R9 := 65536bv64, true; @@ -297,18 +297,18 @@ procedure main() call rely(); assert (L(mem, R9) ==> Gamma_R11); mem, Gamma_mem := memory_store32_le(mem, R9, R11[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R11); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%0000033a"} true; call rely(); R10, Gamma_R10 := zero_extend32_32(memory_load32_le(mem, R10)), (gamma_load32(Gamma_mem, R10) || L(mem, R10)); call rely(); assert (L(mem, R8) ==> Gamma_R10); mem, Gamma_mem := memory_store32_le(mem, R8, R10[32:0]), gamma_store32(Gamma_mem, R8, Gamma_R10); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%00000349"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x790"}true; + assume {:captureState "%00000358"} true; return; } diff --git a/src/test/incorrect/basicassign/gcc/basicassign.expected b/src/test/incorrect/basicassign/gcc/basicassign.expected index d3c439a15..ac29f808a 100644 --- a/src/test/incorrect/basicassign/gcc/basicassign.expected +++ b/src/test/incorrect/basicassign/gcc/basicassign.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69660bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69660bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else (if (index == $x_addr) then false else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -185,7 +185,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 28bv64), Gamma_R0; call rely(); @@ -195,13 +195,13 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000341"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); assert (L(mem, R0) ==> true); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000353"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -211,7 +211,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%00000378"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 28bv64), Gamma_R0; call rely(); @@ -221,7 +221,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%0000039d"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -231,7 +231,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x77c"}true; + assume {:captureState "%000003c2"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/incorrect/basicassign/gcc_O2/basicassign.expected b/src/test/incorrect/basicassign/gcc_O2/basicassign.expected index ebd579c95..040eea589 100644 --- a/src/test/incorrect/basicassign/gcc_O2/basicassign.expected +++ b/src/test/incorrect/basicassign/gcc_O2/basicassign.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69652bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69656bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69660bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69652bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69656bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69660bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else (if (index == $x_addr) then false else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -87,12 +87,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -189,7 +189,7 @@ procedure main() var #1: bv64; var Gamma_#1: bool; lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R2, Gamma_R2 := 69632bv64, true; R1, Gamma_R1 := bvadd64(R2, 20bv64), Gamma_R2; R0, Gamma_R0 := 0bv64, true; @@ -199,10 +199,10 @@ procedure main() call rely(); assert (L(mem, #1) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, #1, R2[32:0]), gamma_store32(Gamma_mem, #1, Gamma_R2); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001c9"} true; call rely(); assert (L(mem, bvadd64(#1, 4bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, bvadd64(#1, 4bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(#1, 4bv64), Gamma_R2); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001cf"} true; return; } diff --git a/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign.expected b/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign.expected index d3c439a15..2889ce48f 100644 --- a/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign.expected +++ b/src/test/incorrect/basicassign/gcc_no_plt_no_pic/basicassign.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69660bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69660bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else (if (index == $x_addr) then false else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -85,12 +85,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -185,7 +185,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 28bv64), Gamma_R0; call rely(); @@ -195,13 +195,13 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%000009dc"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); assert (L(mem, R0) ==> true); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%000009ee"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -211,7 +211,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x74c"}true; + assume {:captureState "%00000a13"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 28bv64), Gamma_R0; call rely(); @@ -221,7 +221,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%00000a38"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -231,7 +231,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x77c"}true; + assume {:captureState "%00000a5d"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/incorrect/basicassign/gcc_pic/basicassign.expected b/src/test/incorrect/basicassign/gcc_pic/basicassign.expected index 2c96223f8..b79b6e403 100644 --- a/src/test/incorrect/basicassign/gcc_pic/basicassign.expected +++ b/src/test/incorrect/basicassign/gcc_pic/basicassign.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69660bv64); -const {:extern }$x_addr: bv64; -axiom {:extern }($x_addr == 69652bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69660bv64); +const {:extern } $x_addr: bv64; +axiom ($x_addr == 69652bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else (if (index == $x_addr) then false else false))) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (forall i: bv64 :: (((mem[i] == old(mem[i])) ==> (Gamma_mem[i] == old(Gamma_mem[i]))))); ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); @@ -109,7 +109,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 68998bv64) == 0bv8); free ensures (memory_load8_le(mem, 68999bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (memory_load32_le(mem, $x_addr) == old(memory_load32_le(mem, $x_addr))); { @@ -117,12 +117,12 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive() +procedure {:extern } rely_reflexive() { assert (memory_load32_le(mem, $x_addr) == memory_load32_le(mem, $x_addr)); } -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -265,7 +265,7 @@ procedure main() free ensures (memory_load8_le(mem, 68999bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); @@ -277,14 +277,14 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000343"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); call rely(); assert (L(mem, R0) ==> true); mem, Gamma_mem := memory_store32_le(mem, R0, 0bv32), gamma_store32(Gamma_mem, R0, true); - assume {:captureState "addr:0x774"}true; + assume {:captureState "%00000356"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -296,7 +296,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x78c"}true; + assume {:captureState "%0000037d"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); @@ -308,7 +308,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x7a4"}true; + assume {:captureState "%000003a4"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -320,7 +320,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x7bc"}true; + assume {:captureState "%000003cb"} true; R0, Gamma_R0 := 0bv64, true; return; } diff --git a/src/test/incorrect/basicassign1/clang/basicassign1.expected b/src/test/incorrect/basicassign1/clang/basicassign1.expected index 192f78118..697bdc1da 100644 --- a/src/test/incorrect/basicassign1/clang/basicassign1.expected +++ b/src/test/incorrect/basicassign1/clang/basicassign1.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -90,9 +90,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -189,31 +189,31 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 69632bv64, true; call rely(); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R9[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R9); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002fe"} true; R0, Gamma_R0 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000030a"} true; R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R10); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%0000031e"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%0000032d"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%0000033c"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/incorrect/basicassign1/clang_O2/basicassign1.expected b/src/test/incorrect/basicassign1/clang_O2/basicassign1.expected index e2752e088..4283ebc9c 100644 --- a/src/test/incorrect/basicassign1/clang_O2/basicassign1.expected +++ b/src/test/incorrect/basicassign1/clang_O2/basicassign1.expected @@ -1,40 +1,40 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -75,7 +75,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -84,9 +84,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -181,7 +181,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -190,6 +190,6 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000002de"} true; return; } diff --git a/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1.expected b/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1.expected index 192f78118..33b46e8d3 100644 --- a/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1.expected +++ b/src/test/incorrect/basicassign1/clang_no_plt_no_pic/basicassign1.expected @@ -1,46 +1,46 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -81,7 +81,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -90,9 +90,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -189,31 +189,31 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 69632bv64, true; call rely(); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R9[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R9); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000008f8"} true; R0, Gamma_R0 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000904"} true; R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R10[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R10); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000918"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x73c"}true; + assume {:captureState "%00000927"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R9, 56bv64), R8[32:0]), gamma_store32(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x744"}true; + assume {:captureState "%00000936"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/incorrect/basicassign1/clang_pic/basicassign1.expected b/src/test/incorrect/basicassign1/clang_pic/basicassign1.expected index aa368fb5d..89f18d503 100644 --- a/src/test/incorrect/basicassign1/clang_pic/basicassign1.expected +++ b/src/test/incorrect/basicassign1/clang_pic/basicassign1.expected @@ -1,54 +1,54 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -105,7 +105,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -114,9 +114,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -245,7 +245,7 @@ procedure main() free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 65536bv64, true; call rely(); @@ -253,10 +253,10 @@ procedure main() call rely(); R9, Gamma_R9 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R9[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R9); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%0000030d"} true; R0, Gamma_R0 := 0bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%00000319"} true; R10, Gamma_R10 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R9, Gamma_R9 := 65536bv64, true; call rely(); @@ -264,16 +264,16 @@ procedure main() call rely(); assert (L(mem, R9) ==> Gamma_R10); mem, Gamma_mem := memory_store32_le(mem, R9, R10[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R10); - assume {:captureState "addr:0x77c"}true; + assume {:captureState "%00000334"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R8); - assume {:captureState "addr:0x784"}true; + assume {:captureState "%00000343"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store32_le(mem, R9, R8[32:0]), gamma_store32(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x78c"}true; + assume {:captureState "%00000352"} true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; } diff --git a/src/test/incorrect/basicassign1/gcc/basicassign1.expected b/src/test/incorrect/basicassign1/gcc/basicassign1.expected index a51ad8781..f1b03dc62 100644 --- a/src/test/incorrect/basicassign1/gcc/basicassign1.expected +++ b/src/test/incorrect/basicassign1/gcc/basicassign1.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -86,9 +86,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -185,36 +185,36 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000031c"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000323"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000033d"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000357"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000371"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign1/gcc_O2/basicassign1.expected b/src/test/incorrect/basicassign1/gcc_O2/basicassign1.expected index 6b430f3a3..c6e1dfbe6 100644 --- a/src/test/incorrect/basicassign1/gcc_O2/basicassign1.expected +++ b/src/test/incorrect/basicassign1/gcc_O2/basicassign1.expected @@ -1,40 +1,40 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -75,7 +75,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -84,9 +84,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -181,7 +181,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := bvadd64(R1, 20bv64), Gamma_R1; R0, Gamma_R0 := 0bv64, true; @@ -190,6 +190,6 @@ procedure main() call rely(); assert (L(mem, bvadd64(R1, 20bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R1, 20bv64), R2[32:0]), gamma_store32(Gamma_mem, bvadd64(R1, 20bv64), Gamma_R2); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001c5"} true; return; } diff --git a/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1.expected b/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1.expected index a51ad8781..af62fee01 100644 --- a/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1.expected +++ b/src/test/incorrect/basicassign1/gcc_no_plt_no_pic/basicassign1.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -86,9 +86,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -185,36 +185,36 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000095c"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000963"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000097d"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000997"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000009b1"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign1/gcc_pic/basicassign1.expected b/src/test/incorrect/basicassign1/gcc_pic/basicassign1.expected index a2a6827aa..42e0ac655 100644 --- a/src/test/incorrect/basicassign1/gcc_pic/basicassign1.expected +++ b/src/test/incorrect/basicassign1/gcc_pic/basicassign1.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69652bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69652bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else false) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -101,7 +101,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -110,9 +110,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -241,7 +241,7 @@ procedure main() free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 65536bv64, true; call rely(); @@ -249,9 +249,9 @@ procedure main() call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%0000031d"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000324"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -259,14 +259,14 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%0000033f"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%0000035a"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -274,7 +274,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x798"}true; + assume {:captureState "%00000375"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign2/clang/basicassign2.expected b/src/test/incorrect/basicassign2/clang/basicassign2.expected index d35372932..b2abd3337 100644 --- a/src/test/incorrect/basicassign2/clang/basicassign2.expected +++ b/src/test/incorrect/basicassign2/clang/basicassign2.expected @@ -1,47 +1,47 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69696bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69696bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -82,7 +82,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -91,9 +91,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -190,30 +190,30 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 69632bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R8, 56bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R9), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R9); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002fe"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), 0bv64), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000305"} true; R10, Gamma_R10 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 64bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R9, 64bv64), R10), gamma_store64(Gamma_mem, bvadd64(R9, 64bv64), Gamma_R10); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%00000319"} true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 56bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R8), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000328"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); assert (L(mem, bvadd64(R9, 64bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R9, 64bv64), R8), gamma_store64(Gamma_mem, bvadd64(R9, 64bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000337"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign2/clang_O2/basicassign2.expected b/src/test/incorrect/basicassign2/clang_O2/basicassign2.expected index 3e8fe6723..0a90e7afd 100644 --- a/src/test/incorrect/basicassign2/clang_O2/basicassign2.expected +++ b/src/test/incorrect/basicassign2/clang_O2/basicassign2.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69696bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69696bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -85,9 +85,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -182,7 +182,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -191,6 +191,6 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 64bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R9, 64bv64), R8), gamma_store64(Gamma_mem, bvadd64(R9, 64bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000002de"} true; return; } diff --git a/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2.expected b/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2.expected index d35372932..cc84f3c7c 100644 --- a/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2.expected +++ b/src/test/incorrect/basicassign2/clang_no_plt_no_pic/basicassign2.expected @@ -1,47 +1,47 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69696bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69696bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -82,7 +82,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -91,9 +91,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -190,30 +190,30 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 69632bv64, true; call rely(); R9, Gamma_R9 := memory_load64_le(mem, bvadd64(R8, 56bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R9), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R9); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000008f8"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), 0bv64), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000008ff"} true; R10, Gamma_R10 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 64bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R9, 64bv64), R10), gamma_store64(Gamma_mem, bvadd64(R9, 64bv64), Gamma_R10); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%00000913"} true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 56bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R8), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000922"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); assert (L(mem, bvadd64(R9, 64bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R9, 64bv64), R8), gamma_store64(Gamma_mem, bvadd64(R9, 64bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000931"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign2/clang_pic/basicassign2.expected b/src/test/incorrect/basicassign2/clang_pic/basicassign2.expected index 308c39d3a..a0c12c266 100644 --- a/src/test/incorrect/basicassign2/clang_pic/basicassign2.expected +++ b/src/test/incorrect/basicassign2/clang_pic/basicassign2.expected @@ -1,47 +1,47 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69688bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69696bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69688bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69696bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -98,7 +98,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -107,9 +107,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -238,7 +238,7 @@ procedure main() free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 65536bv64, true; call rely(); @@ -246,9 +246,9 @@ procedure main() call rely(); R9, Gamma_R9 := memory_load64_le(mem, R8), (gamma_load64(Gamma_mem, R8) || L(mem, R8)); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R9), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R9); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%0000030d"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), 0bv64), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000314"} true; R10, Gamma_R10 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); R9, Gamma_R9 := 65536bv64, true; call rely(); @@ -256,16 +256,16 @@ procedure main() call rely(); assert (L(mem, R9) ==> Gamma_R10); mem, Gamma_mem := memory_store64_le(mem, R9, R10), gamma_store64(Gamma_mem, R9, Gamma_R10); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%0000032f"} true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, R8), (gamma_load64(Gamma_mem, R8) || L(mem, R8)); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R8), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%0000033e"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store64_le(mem, R9, R8), gamma_store64(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%0000034d"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign2/gcc/basicassign2.expected b/src/test/incorrect/basicassign2/gcc/basicassign2.expected index 296e49fcd..9fec06590 100644 --- a/src/test/incorrect/basicassign2/gcc/basicassign2.expected +++ b/src/test/incorrect/basicassign2/gcc/basicassign2.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69664bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69664bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -78,7 +78,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -87,9 +87,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -186,36 +186,36 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 32bv64), Gamma_R0; call rely(); R0, Gamma_R0 := memory_load64_le(mem, R0), (gamma_load64(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000031c"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), 0bv64), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000323"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store64_le(mem, R0, R1), gamma_store64(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000033d"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 32bv64), Gamma_R0; call rely(); R0, Gamma_R0 := memory_load64_le(mem, R0), (gamma_load64(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000357"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store64_le(mem, R0, R1), gamma_store64(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000371"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign2/gcc_O2/basicassign2.expected b/src/test/incorrect/basicassign2/gcc_O2/basicassign2.expected index b4a8ceb51..3176d2791 100644 --- a/src/test/incorrect/basicassign2/gcc_O2/basicassign2.expected +++ b/src/test/incorrect/basicassign2/gcc_O2/basicassign2.expected @@ -1,41 +1,41 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69664bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69664bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -76,7 +76,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -85,9 +85,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -182,7 +182,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := bvadd64(R1, 24bv64), Gamma_R1; R0, Gamma_R0 := 0bv64, true; @@ -191,6 +191,6 @@ procedure main() call rely(); assert (L(mem, bvadd64(R1, 24bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store64_le(mem, bvadd64(R1, 24bv64), R2), gamma_store64(Gamma_mem, bvadd64(R1, 24bv64), Gamma_R2); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001c5"} true; return; } diff --git a/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2.expected b/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2.expected index 296e49fcd..04e29dfc2 100644 --- a/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2.expected +++ b/src/test/incorrect/basicassign2/gcc_no_plt_no_pic/basicassign2.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69664bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69664bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -78,7 +78,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -87,9 +87,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -186,36 +186,36 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 32bv64), Gamma_R0; call rely(); R0, Gamma_R0 := memory_load64_le(mem, R0), (gamma_load64(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000095c"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), 0bv64), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000963"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store64_le(mem, R0, R1), gamma_store64(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000097d"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 32bv64), Gamma_R0; call rely(); R0, Gamma_R0 := memory_load64_le(mem, R0), (gamma_load64(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000997"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; R1, Gamma_R1 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store64_le(mem, R0, R1), gamma_store64(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000009b1"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign2/gcc_pic/basicassign2.expected b/src/test/incorrect/basicassign2/gcc_pic/basicassign2.expected index ad2d4daf3..202ea176e 100644 --- a/src/test/incorrect/basicassign2/gcc_pic/basicassign2.expected +++ b/src/test/incorrect/basicassign2/gcc_pic/basicassign2.expected @@ -1,43 +1,43 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69664bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69656bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69664bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69656bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $z_addr) then true else (if (index == $secret_addr) then false else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -procedure {:extern }rely(); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -94,7 +94,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -103,9 +103,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -234,7 +234,7 @@ procedure main() free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 65536bv64, true; call rely(); @@ -242,9 +242,9 @@ procedure main() call rely(); R0, Gamma_R0 := memory_load64_le(mem, R0), (gamma_load64(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%0000031d"} true; stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), 0bv64), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), true); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000324"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -252,14 +252,14 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store64_le(mem, R0, R1), gamma_store64(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%0000033f"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); call rely(); R0, Gamma_R0 := memory_load64_le(mem, R0), (gamma_load64(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R0), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%0000035a"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -267,7 +267,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store64_le(mem, R0, R1), gamma_store64(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x798"}true; + assume {:captureState "%00000375"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign3/clang/basicassign3.expected b/src/test/incorrect/basicassign3/clang/basicassign3.expected index 1f09e5048..49df57e92 100644 --- a/src/test/incorrect/basicassign3/clang/basicassign3.expected +++ b/src/test/incorrect/basicassign3/clang/basicassign3.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69681bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69682bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69681bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69682bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -187,30 +187,30 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 69632bv64, true; call rely(); R9, Gamma_R9 := zero_extend56_8(memory_load8_le(mem, bvadd64(R8, 49bv64))), (gamma_load8(Gamma_mem, bvadd64(R8, 49bv64)) || L(mem, bvadd64(R8, 49bv64))); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R9[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R9); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002fe"} true; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), 0bv8), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), true); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%00000305"} true; R10, Gamma_R10 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 50bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R9, 50bv64), R10[8:0]), gamma_store8(Gamma_mem, bvadd64(R9, 50bv64), Gamma_R10); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%00000319"} true; call rely(); R8, Gamma_R8 := zero_extend56_8(memory_load8_le(mem, bvadd64(R8, 49bv64))), (gamma_load8(Gamma_mem, bvadd64(R8, 49bv64)) || L(mem, bvadd64(R8, 49bv64))); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R8[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R8); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000328"} true; R8, Gamma_R8 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); call rely(); assert (L(mem, bvadd64(R9, 50bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R9, 50bv64), R8[8:0]), gamma_store8(Gamma_mem, bvadd64(R9, 50bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000337"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign3/clang_O2/basicassign3.expected b/src/test/incorrect/basicassign3/clang_O2/basicassign3.expected index 89a0e981b..b6396a8e4 100644 --- a/src/test/incorrect/basicassign3/clang_O2/basicassign3.expected +++ b/src/test/incorrect/basicassign3/clang_O2/basicassign3.expected @@ -1,38 +1,38 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69684bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69688bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69684bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69688bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -73,7 +73,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -82,9 +82,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -179,7 +179,7 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R8, Gamma_R8 := 69632bv64, true; R9, Gamma_R9 := 69632bv64, true; R0, Gamma_R0 := 0bv64, true; @@ -188,6 +188,6 @@ procedure main() call rely(); assert (L(mem, bvadd64(R9, 56bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R9, 56bv64), R8[8:0]), gamma_store8(Gamma_mem, bvadd64(R9, 56bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000002de"} true; return; } diff --git a/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3.expected b/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3.expected index 1f09e5048..bdad9f7d2 100644 --- a/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3.expected +++ b/src/test/incorrect/basicassign3/clang_no_plt_no_pic/basicassign3.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69681bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69682bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69681bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69682bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -187,30 +187,30 @@ procedure main() free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 69632bv64, true; call rely(); R9, Gamma_R9 := zero_extend56_8(memory_load8_le(mem, bvadd64(R8, 49bv64))), (gamma_load8(Gamma_mem, bvadd64(R8, 49bv64)) || L(mem, bvadd64(R8, 49bv64))); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R9[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R9); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000008f8"} true; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), 0bv8), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), true); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%000008ff"} true; R10, Gamma_R10 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); R9, Gamma_R9 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R9, 50bv64)) ==> Gamma_R10); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R9, 50bv64), R10[8:0]), gamma_store8(Gamma_mem, bvadd64(R9, 50bv64), Gamma_R10); - assume {:captureState "addr:0x730"}true; + assume {:captureState "%00000913"} true; call rely(); R8, Gamma_R8 := zero_extend56_8(memory_load8_le(mem, bvadd64(R8, 49bv64))), (gamma_load8(Gamma_mem, bvadd64(R8, 49bv64)) || L(mem, bvadd64(R8, 49bv64))); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R8[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R8); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%00000922"} true; R8, Gamma_R8 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); call rely(); assert (L(mem, bvadd64(R9, 50bv64)) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R9, 50bv64), R8[8:0]), gamma_store8(Gamma_mem, bvadd64(R9, 50bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000931"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign3/clang_pic/basicassign3.expected b/src/test/incorrect/basicassign3/clang_pic/basicassign3.expected index fde803357..ee84c2efe 100644 --- a/src/test/incorrect/basicassign3/clang_pic/basicassign3.expected +++ b/src/test/incorrect/basicassign3/clang_pic/basicassign3.expected @@ -1,52 +1,52 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R10: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R10: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69681bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69682bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R10: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R10: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69681bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69682bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -103,7 +103,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -112,9 +112,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -243,7 +243,7 @@ procedure main() free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R8, Gamma_R8 := 65536bv64, true; call rely(); @@ -251,9 +251,9 @@ procedure main() call rely(); R9, Gamma_R9 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R9[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R9); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%0000030d"} true; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), 0bv8), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), true); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000314"} true; R10, Gamma_R10 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); R9, Gamma_R9 := 65536bv64, true; call rely(); @@ -261,16 +261,16 @@ procedure main() call rely(); assert (L(mem, R9) ==> Gamma_R10); mem, Gamma_mem := memory_store8_le(mem, R9, R10[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R10); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%0000032f"} true; call rely(); R8, Gamma_R8 := zero_extend56_8(memory_load8_le(mem, R8)), (gamma_load8(Gamma_mem, R8) || L(mem, R8)); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R8[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R8); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%0000033e"} true; R8, Gamma_R8 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); call rely(); assert (L(mem, R9) ==> Gamma_R8); mem, Gamma_mem := memory_store8_le(mem, R9, R8[8:0]), gamma_store8(Gamma_mem, R9, Gamma_R8); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%0000034d"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign3/gcc/basicassign3.expected b/src/test/incorrect/basicassign3/gcc/basicassign3.expected index fcdcec215..fdda84a60 100644 --- a/src/test/incorrect/basicassign3/gcc/basicassign3.expected +++ b/src/test/incorrect/basicassign3/gcc/basicassign3.expected @@ -1,40 +1,40 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69650bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69649bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69650bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69649bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -75,7 +75,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -84,9 +84,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -183,36 +183,36 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 18bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000031c"} true; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), 0bv8), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), true); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000323"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 17bv64), Gamma_R0; R1, Gamma_R1 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000033d"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 18bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000357"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 17bv64), Gamma_R0; R1, Gamma_R1 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000371"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign3/gcc_O2/basicassign3.expected b/src/test/incorrect/basicassign3/gcc_O2/basicassign3.expected index 135aac2e1..9dff05b8e 100644 --- a/src/test/incorrect/basicassign3/gcc_O2/basicassign3.expected +++ b/src/test/incorrect/basicassign3/gcc_O2/basicassign3.expected @@ -1,38 +1,38 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R2: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R2: bv64; -var {:extern }mem: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69650bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69649bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R2: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R2: bv64; +var {:extern } mem: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69650bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69649bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -73,7 +73,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -82,9 +82,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -179,7 +179,7 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x600"}true; + assume {:captureState "addr:lmain"} true; R1, Gamma_R1 := 69632bv64, true; R2, Gamma_R2 := bvadd64(R1, 17bv64), Gamma_R1; R0, Gamma_R0 := 0bv64, true; @@ -188,6 +188,6 @@ procedure main() call rely(); assert (L(mem, bvadd64(R1, 17bv64)) ==> Gamma_R2); mem, Gamma_mem := memory_store8_le(mem, bvadd64(R1, 17bv64), R2[8:0]), gamma_store8(Gamma_mem, bvadd64(R1, 17bv64), Gamma_R2); - assume {:captureState "addr:0x610"}true; + assume {:captureState "%000001c5"} true; return; } diff --git a/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3.expected b/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3.expected index fcdcec215..acd543640 100644 --- a/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3.expected +++ b/src/test/incorrect/basicassign3/gcc_no_plt_no_pic/basicassign3.expected @@ -1,40 +1,40 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69650bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69649bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69650bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69649bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -75,7 +75,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -84,9 +84,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -183,36 +183,36 @@ procedure main() free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 18bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000095c"} true; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), 0bv8), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), true); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000963"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 17bv64), Gamma_R0; R1, Gamma_R1 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x738"}true; + assume {:captureState "%0000097d"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 18bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000997"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 17bv64), Gamma_R0; R1, Gamma_R1 := zero_extend56_8(memory_load8_le(stack, bvadd64(R31, 15bv64))), gamma_load8(Gamma_stack, bvadd64(R31, 15bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%000009b1"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/basicassign3/gcc_pic/basicassign3.expected b/src/test/incorrect/basicassign3/gcc_pic/basicassign3.expected index d9fd7da84..bdda92967 100644 --- a/src/test/incorrect/basicassign3/gcc_pic/basicassign3.expected +++ b/src/test/incorrect/basicassign3/gcc_pic/basicassign3.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -const {:extern }$secret_addr: bv64; -axiom {:extern }($secret_addr == 69650bv64); -const {:extern }$z_addr: bv64; -axiom {:extern }($z_addr == 69649bv64); -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +const {:extern } $secret_addr: bv64; +axiom ($secret_addr == 69650bv64); +const {:extern } $z_addr: bv64; +axiom ($z_addr == 69649bv64); +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { (if (index == $secret_addr) then false else (if (index == $z_addr) then true else false)) } -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load8(gammaMap: [bv64]bool, index: bv64) returns (bool) { gammaMap[index] } -function {:extern }gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store8(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value] } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { +function {:extern } memory_store8_le(memory: [bv64]bv8, index: bv64, value: bv8) returns ([bv64]bv8) { memory[index := value[8:0]] } -function {:extern } {:bvbuiltin "zero_extend 56"}zero_extend56_8(bv8) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "zero_extend 56"} zero_extend56_8(bv8) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -99,7 +99,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -108,9 +108,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -239,7 +239,7 @@ procedure main() free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); { lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; R0, Gamma_R0 := 65536bv64, true; call rely(); @@ -247,9 +247,9 @@ procedure main() call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%0000031d"} true; stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), 0bv8), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), true); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%00000324"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -257,14 +257,14 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x778"}true; + assume {:captureState "%0000033f"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4072bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4072bv64)) || L(mem, bvadd64(R0, 4072bv64))); call rely(); R0, Gamma_R0 := zero_extend56_8(memory_load8_le(mem, R0)), (gamma_load8(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store8_le(stack, bvadd64(R31, 15bv64), R0[8:0]), gamma_store8(Gamma_stack, bvadd64(R31, 15bv64), Gamma_R0); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%0000035a"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); @@ -272,7 +272,7 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store8_le(mem, R0, R1[8:0]), gamma_store8(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x798"}true; + assume {:captureState "%00000375"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/iflocal/clang/iflocal.expected b/src/test/incorrect/iflocal/clang/iflocal.expected index 5c063e7f9..3eb181939 100644 --- a/src/test/incorrect/iflocal/clang/iflocal.expected +++ b/src/test/incorrect/iflocal/clang/iflocal.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -197,15 +197,15 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002f5"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%000002fd"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000030c"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 0bv33))), (Gamma_R8 && Gamma_#4); @@ -231,16 +231,16 @@ procedure main() } goto l00000359; l00000359: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000359"} true; goto l0000035a; l0000035a: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l0000035a"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%00000368"} true; goto l00000342; l00000342: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000342"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal.expected b/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal.expected index 5f5666bf5..fd0978448 100644 --- a/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal.expected +++ b/src/test/incorrect/iflocal/clang_no_plt_no_pic/iflocal.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -197,15 +197,15 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000917"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000091f"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000092e"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 0bv33))), (Gamma_R8 && Gamma_#4); @@ -231,16 +231,16 @@ procedure main() } goto l0000097b; l0000097b: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l0000097b"} true; goto l0000097c; l0000097c: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l0000097c"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%0000098a"} true; goto l00000964; l00000964: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000964"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/iflocal/clang_pic/iflocal.expected b/src/test/incorrect/iflocal/clang_pic/iflocal.expected index 5f5666bf5..fd0978448 100644 --- a/src/test/incorrect/iflocal/clang_pic/iflocal.expected +++ b/src/test/incorrect/iflocal/clang_pic/iflocal.expected @@ -1,44 +1,44 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -79,7 +79,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -88,9 +88,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -197,15 +197,15 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000917"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000091f"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x724"}true; + assume {:captureState "%0000092e"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 0bv33))), (Gamma_R8 && Gamma_#4); @@ -231,16 +231,16 @@ procedure main() } goto l0000097b; l0000097b: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l0000097b"} true; goto l0000097c; l0000097c: - assume {:captureState "addr:0x73c"}true; + assume {:captureState "addr:l0000097c"} true; R8, Gamma_R8 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x740"}true; + assume {:captureState "%0000098a"} true; goto l00000964; l00000964: - assume {:captureState "addr:0x748"}true; + assume {:captureState "addr:l00000964"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/iflocal/gcc/iflocal.expected b/src/test/incorrect/iflocal/gcc/iflocal.expected index d43055f8c..77f4caea5 100644 --- a/src/test/incorrect/iflocal/gcc/iflocal.expected +++ b/src/test/incorrect/iflocal/gcc/iflocal.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -86,9 +86,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -195,13 +195,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000002e6"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000002f5"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#4); @@ -214,13 +214,13 @@ procedure main() } goto l0000032d; l0000032d: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l0000032d"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%00000338"} true; goto l00000318; l00000318: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l00000318"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal.expected b/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal.expected index 689afa450..d3414cf83 100644 --- a/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal.expected +++ b/src/test/incorrect/iflocal/gcc_no_plt_no_pic/iflocal.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -86,9 +86,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -195,13 +195,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000008cd"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000008dc"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#4); @@ -214,13 +214,13 @@ procedure main() } goto l00000914; l00000914: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000914"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%0000091f"} true; goto l000008ff; l000008ff: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l000008ff"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/incorrect/iflocal/gcc_pic/iflocal.expected b/src/test/incorrect/iflocal/gcc_pic/iflocal.expected index 689afa450..d3414cf83 100644 --- a/src/test/incorrect/iflocal/gcc_pic/iflocal.expected +++ b/src/test/incorrect/iflocal/gcc_pic/iflocal.expected @@ -1,42 +1,42 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -77,7 +77,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -86,9 +86,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -195,13 +195,13 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%000008cd"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x720"}true; + assume {:captureState "%000008dc"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #4, Gamma_#4 := bvadd32(R0[32:0], 4294967295bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#4, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 0bv33))), (Gamma_R0 && Gamma_#4); @@ -214,13 +214,13 @@ procedure main() } goto l00000914; l00000914: - assume {:captureState "addr:0x730"}true; + assume {:captureState "addr:l00000914"} true; R0, Gamma_R0 := 1bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x734"}true; + assume {:captureState "%0000091f"} true; goto l000008ff; l000008ff: - assume {:captureState "addr:0x738"}true; + assume {:captureState "addr:l000008ff"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/incorrect/nestedifglobal/clang/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/clang/nestedifglobal.expected index 21e0caf09..4077c58eb 100644 --- a/src/test/incorrect/nestedifglobal/clang/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/clang/nestedifglobal.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -85,7 +85,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -94,9 +94,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -207,20 +207,20 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000345"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%0000034d"} true; R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000361"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), true); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%00000368"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; @@ -247,16 +247,16 @@ procedure main() } goto l0000045d; l0000045d: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:l0000045d"} true; goto l0000045e; l0000045e: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l0000045e"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%0000046c"} true; goto l0000039e; l0000039e: - assume {:captureState "addr:0x750"}true; + assume {:captureState "addr:l0000039e"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -284,16 +284,16 @@ procedure main() } goto l00000448; l00000448: - assume {:captureState "addr:0x764"}true; + assume {:captureState "addr:l00000448"} true; goto l00000449; l00000449: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000449"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%00000457"} true; goto l000003dc; l000003dc: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:l000003dc"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); #6, Gamma_#6 := bvadd32(R8[32:0], 4294967292bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934589bv33))), (Gamma_R8 && Gamma_#6); @@ -319,18 +319,18 @@ procedure main() } goto l0000042c; l0000042c: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:l0000042c"} true; goto l0000042d; l0000042d: - assume {:captureState "addr:0x788"}true; + assume {:captureState "addr:l0000042d"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x790"}true; + assume {:captureState "%00000442"} true; goto l00000415; l00000415: - assume {:captureState "addr:0x798"}true; + assume {:captureState "addr:l00000415"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal.expected index caf8a93dd..4ea94364b 100644 --- a/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/clang_no_plt_no_pic/nestedifglobal.expected @@ -1,50 +1,50 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -85,7 +85,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69678bv64) == 0bv8); free ensures (memory_load8_le(mem, 69679bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -94,9 +94,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -207,20 +207,20 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551600bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), true); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000a95"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 8bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R0); - assume {:captureState "addr:0x71c"}true; + assume {:captureState "%00000a9d"} true; R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 8bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 8bv64)); R8, Gamma_R8 := 69632bv64, true; call rely(); assert (L(mem, bvadd64(R8, 52bv64)) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, bvadd64(R8, 52bv64), R9[32:0]), gamma_store32(Gamma_mem, bvadd64(R8, 52bv64), Gamma_R9); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000ab1"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), true); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%00000ab8"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; @@ -247,16 +247,16 @@ procedure main() } goto l00000bad; l00000bad: - assume {:captureState "addr:0x740"}true; + assume {:captureState "addr:l00000bad"} true; goto l00000bae; l00000bae: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000bae"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000bbc"} true; goto l00000aee; l00000aee: - assume {:captureState "addr:0x750"}true; + assume {:captureState "addr:l00000aee"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 52bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 52bv64)) || L(mem, bvadd64(R8, 52bv64))); @@ -284,16 +284,16 @@ procedure main() } goto l00000b98; l00000b98: - assume {:captureState "addr:0x764"}true; + assume {:captureState "addr:l00000b98"} true; goto l00000b99; l00000b99: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000b99"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%00000ba7"} true; goto l00000b2c; l00000b2c: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:l00000b2c"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 4bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 4bv64)); #6, Gamma_#6 := bvadd32(R8[32:0], 4294967292bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934589bv33))), (Gamma_R8 && Gamma_#6); @@ -319,18 +319,18 @@ procedure main() } goto l00000b7c; l00000b7c: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:l00000b7c"} true; goto l00000b7d; l00000b7d: - assume {:captureState "addr:0x788"}true; + assume {:captureState "addr:l00000b7d"} true; R8, Gamma_R8 := 69632bv64, true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, bvadd64(R8, 56bv64))), (gamma_load32(Gamma_mem, bvadd64(R8, 56bv64)) || L(mem, bvadd64(R8, 56bv64))); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 4bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 4bv64), Gamma_R8); - assume {:captureState "addr:0x790"}true; + assume {:captureState "%00000b92"} true; goto l00000b65; l00000b65: - assume {:captureState "addr:0x798"}true; + assume {:captureState "addr:l00000b65"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); R31, Gamma_R31 := bvadd64(R31, 16bv64), Gamma_R31; return; diff --git a/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal.expected index 27a6c476e..7f641b4cb 100644 --- a/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/clang_pic/nestedifglobal.expected @@ -1,66 +1,66 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_R8: bool; -var {:extern }Gamma_R9: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R31: bv64; -var {:extern }R8: bv64; -var {:extern }R9: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_R8: bool; +var {:extern } Gamma_R9: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R31: bv64; +var {:extern } R8: bv64; +var {:extern } R9: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store64(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value][bvadd64(index, 4bv64) := value][bvadd64(index, 5bv64) := value][bvadd64(index, 6bv64) := value][bvadd64(index, 7bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern }memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { +function {:extern } memory_store64_le(memory: [bv64]bv8, index: bv64, value: bv64) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]][bvadd64(index, 4bv64) := value[40:32]][bvadd64(index, 5bv64) := value[48:40]][bvadd64(index, 6bv64) := value[56:48]][bvadd64(index, 7bv64) := value[64:56]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -117,7 +117,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69062bv64) == 0bv8); free ensures (memory_load8_le(mem, 69063bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -126,9 +126,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -271,24 +271,24 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4040bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4040bv64)) || L(mem, bvadd64(R8, 4040bv64))); stack, Gamma_stack := memory_store64_le(stack, bvadd64(R31, 8bv64), R8), gamma_store64(Gamma_stack, bvadd64(R31, 8bv64), Gamma_R8); - assume {:captureState "addr:0x760"}true; + assume {:captureState "%0000035e"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), true); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%00000365"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 24bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 24bv64), Gamma_R0); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%0000036d"} true; R9, Gamma_R9 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 24bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 24bv64)); call rely(); assert (L(mem, R8) ==> Gamma_R9); mem, Gamma_mem := memory_store32_le(mem, R8, R9[32:0]), gamma_store32(Gamma_mem, R8, Gamma_R9); - assume {:captureState "addr:0x770"}true; + assume {:captureState "%0000037c"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), true); - assume {:captureState "addr:0x774"}true; + assume {:captureState "%00000383"} true; call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); #4, Gamma_#4 := bvadd32(R8[32:0], 4294967295bv32), Gamma_R8; @@ -315,16 +315,16 @@ procedure main() } goto l00000481; l00000481: - assume {:captureState "addr:0x788"}true; + assume {:captureState "addr:l00000481"} true; goto l00000482; l00000482: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l00000482"} true; R8, Gamma_R8 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R8); - assume {:captureState "addr:0x790"}true; + assume {:captureState "%00000490"} true; goto l000003b9; l000003b9: - assume {:captureState "addr:0x798"}true; + assume {:captureState "addr:l000003b9"} true; R8, Gamma_R8 := memory_load64_le(stack, bvadd64(R31, 8bv64)), gamma_load64(Gamma_stack, bvadd64(R31, 8bv64)); call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); @@ -352,16 +352,16 @@ procedure main() } goto l0000046c; l0000046c: - assume {:captureState "addr:0x7ac"}true; + assume {:captureState "addr:l0000046c"} true; goto l0000046d; l0000046d: - assume {:captureState "addr:0x7b0"}true; + assume {:captureState "addr:l0000046d"} true; R8, Gamma_R8 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R8); - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "%0000047b"} true; goto l000003f9; l000003f9: - assume {:captureState "addr:0x7bc"}true; + assume {:captureState "addr:l000003f9"} true; R8, Gamma_R8 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 20bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 20bv64)); #6, Gamma_#6 := bvadd32(R8[32:0], 4294967292bv32), Gamma_R8; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R8[32:0]), 8589934589bv33))), (Gamma_R8 && Gamma_#6); @@ -387,20 +387,20 @@ procedure main() } goto l00000449; l00000449: - assume {:captureState "addr:0x7cc"}true; + assume {:captureState "addr:l00000449"} true; goto l0000044a; l0000044a: - assume {:captureState "addr:0x7d0"}true; + assume {:captureState "addr:l0000044a"} true; R8, Gamma_R8 := 65536bv64, true; call rely(); R8, Gamma_R8 := memory_load64_le(mem, bvadd64(R8, 4032bv64)), (gamma_load64(Gamma_mem, bvadd64(R8, 4032bv64)) || L(mem, bvadd64(R8, 4032bv64))); call rely(); R8, Gamma_R8 := zero_extend32_32(memory_load32_le(mem, R8)), (gamma_load32(Gamma_mem, R8) || L(mem, R8)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 20bv64), R8[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 20bv64), Gamma_R8); - assume {:captureState "addr:0x7dc"}true; + assume {:captureState "%00000466"} true; goto l00000432; l00000432: - assume {:captureState "addr:0x7e4"}true; + assume {:captureState "addr:l00000432"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/incorrect/nestedifglobal/gcc/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/gcc/nestedifglobal.expected index 0401c2770..b5ba5f23b 100644 --- a/src/test/incorrect/nestedifglobal/gcc/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/gcc/nestedifglobal.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -92,9 +92,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -205,19 +205,19 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000332"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%0000034c"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), true); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%00000353"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -233,13 +233,13 @@ procedure main() } goto l00000414; l00000414: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000414"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%0000041f"} true; goto l00000381; l00000381: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l00000381"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -255,13 +255,13 @@ procedure main() } goto l00000407; l00000407: - assume {:captureState "addr:0x760"}true; + assume {:captureState "addr:l00000407"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%00000412"} true; goto l000003b2; l000003b2: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l000003b2"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#6); @@ -274,16 +274,16 @@ procedure main() } goto l000003ed; l000003ed: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:l000003ed"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000405"} true; goto l000003d8; l000003d8: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:l000003d8"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal.expected index 234bd851e..8a807f45e 100644 --- a/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/gcc_no_plt_no_pic/nestedifglobal.expected @@ -1,48 +1,48 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -83,7 +83,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69646bv64) == 0bv8); free ensures (memory_load8_le(mem, 69647bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -92,9 +92,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -205,19 +205,19 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x714"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x718"}true; + assume {:captureState "%00000a2a"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; R1, Gamma_R1 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 12bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 12bv64)); call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x728"}true; + assume {:captureState "%00000a44"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), true); - assume {:captureState "addr:0x72c"}true; + assume {:captureState "%00000a4b"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -233,13 +233,13 @@ procedure main() } goto l00000b0c; l00000b0c: - assume {:captureState "addr:0x744"}true; + assume {:captureState "addr:l00000b0c"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x748"}true; + assume {:captureState "%00000b17"} true; goto l00000a79; l00000a79: - assume {:captureState "addr:0x74c"}true; + assume {:captureState "addr:l00000a79"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 20bv64), Gamma_R0; call rely(); @@ -255,13 +255,13 @@ procedure main() } goto l00000aff; l00000aff: - assume {:captureState "addr:0x760"}true; + assume {:captureState "addr:l00000aff"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x764"}true; + assume {:captureState "%00000b0a"} true; goto l00000aaa; l00000aaa: - assume {:captureState "addr:0x768"}true; + assume {:captureState "addr:l00000aaa"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#6); @@ -274,16 +274,16 @@ procedure main() } goto l00000ae5; l00000ae5: - assume {:captureState "addr:0x774"}true; + assume {:captureState "addr:l00000ae5"} true; R0, Gamma_R0 := 69632bv64, true; R0, Gamma_R0 := bvadd64(R0, 24bv64), Gamma_R0; call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x780"}true; + assume {:captureState "%00000afd"} true; goto l00000ad0; l00000ad0: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:l00000ad0"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return; diff --git a/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal.expected b/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal.expected index 28dd0b805..d81d1a186 100644 --- a/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal.expected +++ b/src/test/incorrect/nestedifglobal/gcc_pic/nestedifglobal.expected @@ -1,56 +1,56 @@ -var {:extern }Gamma_R0: bool; -var {:extern }Gamma_R1: bool; -var {:extern }Gamma_R31: bool; -var {:extern }Gamma_mem: [bv64]bool; -var {:extern }Gamma_stack: [bv64]bool; -var {:extern }R0: bv64; -var {:extern }R1: bv64; -var {:extern }R31: bv64; -var {:extern }mem: [bv64]bv8; -var {:extern }stack: [bv64]bv8; -function {:extern }L(memory: [bv64]bv8, index: bv64) returns (bool) { +var {:extern } Gamma_R0: bool; +var {:extern } Gamma_R1: bool; +var {:extern } Gamma_R31: bool; +var {:extern } Gamma_mem: [bv64]bool; +var {:extern } Gamma_stack: [bv64]bool; +var {:extern } R0: bv64; +var {:extern } R1: bv64; +var {:extern } R31: bv64; +var {:extern } mem: [bv64]bv8; +var {:extern } stack: [bv64]bv8; +function {:extern } L(memory: [bv64]bv8, index: bv64) returns (bool) { false } -function {:extern } {:bvbuiltin "bvadd"}bvadd32(bv32, bv32) returns (bv32); -function {:extern } {:bvbuiltin "bvadd"}bvadd33(bv33, bv33) returns (bv33); -function {:extern } {:bvbuiltin "bvadd"}bvadd64(bv64, bv64) returns (bv64); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp1(bv1, bv1) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp32(bv32, bv32) returns (bv1); -function {:extern } {:bvbuiltin "bvcomp"}bvcomp33(bv33, bv33) returns (bv1); -function {:extern } {:bvbuiltin "bvnot"}bvnot1(bv1) returns (bv1); -function {:extern }gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } {:bvbuiltin "bvadd"} bvadd32(bv32, bv32) returns (bv32); +function {:extern } {:bvbuiltin "bvadd"} bvadd33(bv33, bv33) returns (bv33); +function {:extern } {:bvbuiltin "bvadd"} bvadd64(bv64, bv64) returns (bv64); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp1(bv1, bv1) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp32(bv32, bv32) returns (bv1); +function {:extern } {:bvbuiltin "bvcomp"} bvcomp33(bv33, bv33) returns (bv1); +function {:extern } {:bvbuiltin "bvnot"} bvnot1(bv1) returns (bv1); +function {:extern } gamma_load32(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))) } -function {:extern }gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { +function {:extern } gamma_load64(gammaMap: [bv64]bool, index: bv64) returns (bool) { (gammaMap[bvadd64(index, 7bv64)] && (gammaMap[bvadd64(index, 6bv64)] && (gammaMap[bvadd64(index, 5bv64)] && (gammaMap[bvadd64(index, 4bv64)] && (gammaMap[bvadd64(index, 3bv64)] && (gammaMap[bvadd64(index, 2bv64)] && (gammaMap[bvadd64(index, 1bv64)] && gammaMap[index]))))))) } -function {:extern }gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { +function {:extern } gamma_store32(gammaMap: [bv64]bool, index: bv64, value: bool) returns ([bv64]bool) { gammaMap[index := value][bvadd64(index, 1bv64) := value][bvadd64(index, 2bv64) := value][bvadd64(index, 3bv64) := value] } -function {:extern }memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { +function {:extern } memory_load32_le(memory: [bv64]bv8, index: bv64) returns (bv32) { (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))) } -function {:extern }memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { +function {:extern } memory_load64_le(memory: [bv64]bv8, index: bv64) returns (bv64) { (memory[bvadd64(index, 7bv64)] ++ (memory[bvadd64(index, 6bv64)] ++ (memory[bvadd64(index, 5bv64)] ++ (memory[bvadd64(index, 4bv64)] ++ (memory[bvadd64(index, 3bv64)] ++ (memory[bvadd64(index, 2bv64)] ++ (memory[bvadd64(index, 1bv64)] ++ memory[index]))))))) } -function {:extern }memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { +function {:extern } memory_load8_le(memory: [bv64]bv8, index: bv64) returns (bv8) { memory[index] } -function {:extern }memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { +function {:extern } memory_store32_le(memory: [bv64]bv8, index: bv64, value: bv32) returns ([bv64]bv8) { memory[index := value[8:0]][bvadd64(index, 1bv64) := value[16:8]][bvadd64(index, 2bv64) := value[24:16]][bvadd64(index, 3bv64) := value[32:24]] } -function {:extern } {:bvbuiltin "sign_extend 1"}sign_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 1"}zero_extend1_32(bv32) returns (bv33); -function {:extern } {:bvbuiltin "zero_extend 32"}zero_extend32_32(bv32) returns (bv64); -procedure {:extern }rely(); +function {:extern } {:bvbuiltin "sign_extend 1"} sign_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 1"} zero_extend1_32(bv32) returns (bv33); +function {:extern } {:bvbuiltin "zero_extend 32"} zero_extend32_32(bv32) returns (bv64); +procedure {:extern } rely(); modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -107,7 +107,7 @@ procedure {:extern }rely(); free ensures (memory_load8_le(mem, 69006bv64) == 0bv8); free ensures (memory_load8_le(mem, 69007bv64) == 0bv8); -procedure {:extern }rely_transitive() +procedure {:extern } rely_transitive() modifies Gamma_mem, mem; ensures (mem == old(mem)); ensures (Gamma_mem == old(Gamma_mem)); @@ -116,9 +116,9 @@ procedure {:extern }rely_transitive() call rely(); } -procedure {:extern }rely_reflexive(); +procedure {:extern } rely_reflexive(); -procedure {:extern }guarantee_reflexive(); +procedure {:extern } guarantee_reflexive(); modifies Gamma_mem, mem; procedure main() @@ -261,10 +261,10 @@ procedure main() var VF: bv1; var ZF: bv1; lmain: - assume {:captureState "addr:0x754"}true; + assume {:captureState "addr:lmain"} true; R31, Gamma_R31 := bvadd64(R31, 18446744073709551584bv64), Gamma_R31; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 12bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 12bv64), Gamma_R0); - assume {:captureState "addr:0x758"}true; + assume {:captureState "%00000332"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -272,9 +272,9 @@ procedure main() call rely(); assert (L(mem, R0) ==> Gamma_R1); mem, Gamma_mem := memory_store32_le(mem, R0, R1[32:0]), gamma_store32(Gamma_mem, R0, Gamma_R1); - assume {:captureState "addr:0x768"}true; + assume {:captureState "%0000034d"} true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), 0bv32), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), true); - assume {:captureState "addr:0x76c"}true; + assume {:captureState "%00000354"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -291,13 +291,13 @@ procedure main() } goto l00000418; l00000418: - assume {:captureState "addr:0x784"}true; + assume {:captureState "addr:l00000418"} true; R0, Gamma_R0 := 3bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x788"}true; + assume {:captureState "%00000423"} true; goto l00000383; l00000383: - assume {:captureState "addr:0x78c"}true; + assume {:captureState "addr:l00000383"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4064bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4064bv64)) || L(mem, bvadd64(R0, 4064bv64))); @@ -314,13 +314,13 @@ procedure main() } goto l0000040b; l0000040b: - assume {:captureState "addr:0x7a0"}true; + assume {:captureState "addr:l0000040b"} true; R0, Gamma_R0 := 5bv64, true; stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x7a4"}true; + assume {:captureState "%00000416"} true; goto l000003b5; l000003b5: - assume {:captureState "addr:0x7a8"}true; + assume {:captureState "addr:l000003b5"} true; R0, Gamma_R0 := zero_extend32_32(memory_load32_le(stack, bvadd64(R31, 28bv64))), gamma_load32(Gamma_stack, bvadd64(R31, 28bv64)); #6, Gamma_#6 := bvadd32(R0[32:0], 4294967292bv32), Gamma_R0; VF, Gamma_VF := bvnot1(bvcomp33(sign_extend1_32(bvadd32(#6, 1bv32)), bvadd33(sign_extend1_32(R0[32:0]), 8589934589bv33))), (Gamma_R0 && Gamma_#6); @@ -333,17 +333,17 @@ procedure main() } goto l000003f0; l000003f0: - assume {:captureState "addr:0x7b4"}true; + assume {:captureState "addr:l000003f0"} true; R0, Gamma_R0 := 65536bv64, true; call rely(); R0, Gamma_R0 := memory_load64_le(mem, bvadd64(R0, 4056bv64)), (gamma_load64(Gamma_mem, bvadd64(R0, 4056bv64)) || L(mem, bvadd64(R0, 4056bv64))); call rely(); R0, Gamma_R0 := zero_extend32_32(memory_load32_le(mem, R0)), (gamma_load32(Gamma_mem, R0) || L(mem, R0)); stack, Gamma_stack := memory_store32_le(stack, bvadd64(R31, 28bv64), R0[32:0]), gamma_store32(Gamma_stack, bvadd64(R31, 28bv64), Gamma_R0); - assume {:captureState "addr:0x7c0"}true; + assume {:captureState "%00000409"} true; goto l000003db; l000003db: - assume {:captureState "addr:0x7c4"}true; + assume {:captureState "addr:l000003db"} true; R0, Gamma_R0 := 0bv64, true; R31, Gamma_R31 := bvadd64(R31, 32bv64), Gamma_R31; return;