Stefan Heule, Eric Schkufza, Rahul Sharma, Alex Aiken
PLDI, Santa Barbara, June 16, 2016
Stefan Heule, Eric Schkufza, Rahul Sharma, Alex Aiken PLDI, Santa - - PowerPoint PPT Presentation
Stefan Heule, Eric Schkufza, Rahul Sharma, Alex Aiken PLDI, Santa Barbara, June 16, 2016 Symbolic Execution Automatically Program Reason about Verification Programs Program Equivalence 2 Automatically reasoning about
PLDI, Santa Barbara, June 16, 2016
2
Symbolic Execution Program Verification Program Equivalence
Automatically reasoning about programs requires
3
testq %rdi, %rdi je .L1 xorq %rax, %rax .L0: movq %rdi, %rdx andq $0x1, %rdx addq %rdx, %rax shrq $0x1, %rdi jne .L0 cltq retq .L1: xorq %rax, %rax retq 4
5
addq $0x1, %rax rax β rax +64 164 64-bit bit-vector addition 64-bit constant previous value of rax
6
addq $0x1, %rax rax β rax +64 164 al β al +8 18 addb $0x1, %al
7
addq $0x1, %rax rax β rax +64 164 addb $0x1, %al
eax
32 bits
ax 16 bits al ah rax
al β al +8 18
8 bits 64 bits 8 bits
8
addq $0x1, %rax rax β rax +64 164 addb $0x1, %al
eax
32 bits
ax 16 bits al ah rax
al β al +8 18
8 bits 64 bits 8 bits
rax β rax 63: 8 β rax 7: 0 +8 18
9
rax β rax 63: 8 β rax 7: 0 +8 18 rax β rax[63: 32] β (rax[31: 0] +32 132) addw $0x1, %ax rax β rax 63: 16 β rax 15: 0 +16 116 addl $0x1, %eax addq $0x1, %rax rax β rax +64 164 addb $0x1, %al
10
rax β rax 63: 8 β rax 7: 0 +8 18 rax β 032 β (rax[31: 0] +32 132) addw $0x1, %ax rax β rax 63: 16 β rax 15: 0 +16 116 addl $0x1, %eax addq $0x1, %rax rax β rax +64 164 addb $0x1, %al
11
rax β rax 63: 8 β rax 7: 0 +8 18 rax β 032 β (rax[31: 0] +32 132) addw $0x1, %ax rax β rax 63: 16 β rax 15: 0 +16 116 addl $0x1, %eax addq $0x1, %rax rax β rax +64 164 addb $0x1, %al zf β 032 = (eax +32 132) cf β 01 β eax +33 133 [32,32] sf β eax +32 132 [31,31]
pf β (eax +32 132)[0,0] β (eax +32 132)[1,1] β (eax +32 132)[2,2] β (eax +32 132)[3,3] β (eax +32 132)[4,4] β (eax +32 132)[5,5] β (eax +32 132)[6,6] β (eax +32 132)[7,7]
13
14
15
Base set Specify manually Remaining Instructions Learn specification automatically All instructions
16
Instruction π Program π synthesize combine base formulas Formula π
17
Instruction π Program π synthesize combine base formulas Formula π
18
Instruction π Program π synthesize combine base formulas Formula π
19
Instruction π Program π synthesize combine base formulas Formula π
20
Instruction π Program π synthesize combine base formulas Candidate formula π
21
Instruction π Program π synthesize combine base formulas Program πβ² π Φ
? πβ²
yes no β increase confidence Add counter example, remove wrong program(s)
Candidate formula π Candidate formula πβ² Candidate formula πβ²β²
22
π Φ
? πβ²
Increase confidence Remove incorrect program(s) No information about equivalence
23
π Φ
? πβ²
Increase confidence Remove incorrect program(s) No information about equivalence
24
π Φ
? πβ²
Increase confidence Remove incorrect program(s) No information about equivalence Equivalence class 1 Equivalence class 2
25
Equivalence class 1 Equivalence class 2 Equivalence class 3
26
Equivalence class 1 Equivalence class 2 Equivalence class 3
27
synthesize
28
29
addw %ax, %dx dx β dx +16 ax addw %cx, %bx
Learn
bx β bx +16 cx
Rename
addw (%rsp), %dx dx β dx +16 M rsp addw $0x5, %dx dx β dx +16 516
β β β
30
31
shufps $0xb3, %xmm0, %xmm1
32
33
invpcid, jle aeskeygenassist fadd scasq
34
35
36
fadd π, π = fadd π, π
37
38
stratum π = ΰ΅ if π β baseset 1 + max
πβ²βπ(π) stratum iβ²
Stratum 0 Stratum 1 Stratum 2 Stratum 3 base set
39
stratum π = ΰ΅ if π β baseset 1 + max
πβ²βπ(π) stratum iβ²
40
100 200 300 400 500 600 700 800 50 100 150 200 250 Number of formulas learned Wall-clock time elapsed [hours] Stratification Without stratification
41
number of nodes in learned formula number of nodes in handwritten formula Fully inlined: 3526 instructions
42
43
Some integer and floating point operations are missing
Shortest known program is long and outside of reach e.g., byte-vectorized operation
For one bit of output, the cost function does not give enough signal
44
45
46
47
β‘ 864
48
49