Accurate ICP-based Floating-Point Reasoning Albert-Ludwigs-Universität Freiburg Karsten Scheibler, Felix Neubauer, Ahmed Mahdi, Martin Fränzle, Tino Teige, Tom Bienmüller, Detlef Fehrer, Bernd Becker Chair of Computer Architecture FMCAD 2016
Context of this Work FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 2 / 67
Context of this Work (1) Cooperation with Industrypartners (AVACS Transfer Project 1): “Accurate Dead Code Detection in Embedded C Code by Arithmetic Constraint Solving” University of Oldenburg: BTC-ES (Oldenburg): Ahmed Mahdi Tino Teige Martin Fränzle Tom Bienmüller University of Freiburg: SICK (Waldkirch): Felix Neubauer Detlef Fehrer Karsten Scheibler Bernd Becker FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 3 / 67
Context of this Work (2) C SMI HYS BTC-Toolchain SMI2iSAT iSAT3 Scripts FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 4 / 67
Context of this Work (3) C SMI HYS BTC-Toolchain SMI2iSAT iSAT3 annotate with coverage goal cone of influence reduction Scripts resolve loops and functions flatten data types static single assignment form BMC problem FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 5 / 67
Context of this Work (4) C SMI HYS BTC-Toolchain SMI2iSAT iSAT3 This presentation: Scripts accurate reasoning for floating-point arithmetic support for bitwise integer operations FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 6 / 67
How does iSAT3 Work FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 7 / 67
iSAT3 = CDCL + ICP CDCL: conflict-driven clause learning ICP: interval constaint propagation FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 8 / 67
CDCL (1) CNF ( ¬ b ∨¬ h 1 ) ∧ ( c ∨¬ h 1 ) ∧ ( b ∨¬ c ∨ h 1 ) ∧ ( a ∨ h 1 ∨¬ h 2 ) ∧ ( a ∨¬ h 1 ∨ h 2 ) ∧ ( ¬ a ∨ h 1 ∨ h 2 ) ∧ ( ¬ a ∨¬ h 1 ∨¬ h 2 ) ∧ ( h 2 ) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 9 / 67
CDCL (1) CNF ( ¬ b ∨¬ h 1 ) ∧ Tseitin- ( c ∨¬ h 1 ) ∧ Boolean Formula Transformation ( b ∨¬ c ∨ h 1 ) ∧ ( a ∨ h 1 ∨¬ h 2 ) ∧ ( a ⊕ ( ¬ b ∧ c )) ( h 1 ⇔ ( ¬ b ∧ c )) ( a ∨¬ h 1 ∨ h 2 ) ∧ ( h 2 ⇔ ( a ⊕ h 1 )) ( ¬ a ∨ h 1 ∨ h 2 ) ∧ ( ¬ a ∨¬ h 1 ∨¬ h 2 ) ∧ ( h 2 ) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 10 / 67
CDCL (2) CNF ( ¬ b ∨¬ h 1 ) ∧ ( c ∨¬ h 1 ) ∧ ( b ∨¬ c ∨ h 1 ) ∧ ( a ∨ h 1 ∨¬ h 2 ) ∧ ( a ∨¬ h 1 ∨ h 2 ) ∧ ( ¬ a ∨ h 1 ∨ h 2 ) ∧ ( ¬ a ∨¬ h 1 ∨¬ h 2 ) ∧ ( h 2 ) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 11 / 67
CDCL (3) CNF BCP ( ¬ b ∨¬ h 1 ) ∧ ( c ∨¬ h 1 ) ∧ ( b ∨¬ c ∨ h 1 ) ∧ ( a ∨ h 1 ∨¬ h 2 ) ∧ ( a ∨¬ h 1 ∨ h 2 ) ∧ ( ¬ a ∨ h 1 ∨ h 2 ) ∧ ( ¬ a ∨¬ h 1 ∨¬ h 2 ) ∧ ( h 2 ) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 12 / 67
CDCL (4) CNF BCP ( ¬ b ∨¬ h 1 ) ∧ ( c ∨¬ h 1 ) ∧ no conflict ( b ∨¬ c ∨ h 1 ) ∧ ( a ∨ h 1 ∨¬ h 2 ) ∧ ( a ∨¬ h 1 ∨ h 2 ) ∧ ( ¬ a ∨ h 1 ∨ h 2 ) ∧ ( ¬ a ∨¬ h 1 ∨¬ h 2 ) ∧ ( h 2 ) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 13 / 67
CDCL (4) CNF BCP ( ¬ b ∨¬ h 1 ) ∧ ( c ∨¬ h 1 ) ∧ no conflict ( b ∨¬ c ∨ h 1 ) ∧ ( a ∨ h 1 ∨¬ h 2 ) ∧ ( a ∨¬ h 1 ∨ h 2 ) ∧ ( ¬ a ∨ h 1 ∨ h 2 ) ∧ ( ¬ a ∨¬ h 1 ∨¬ h 2 ) ∧ Decision ( h 2 ) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 14 / 67
CDCL (4) CNF BCP ( ¬ b ∨¬ h 1 ) ∧ ( c ∨¬ h 1 ) ∧ no conflict ( b ∨¬ c ∨ h 1 ) ∧ ( a ∨ h 1 ∨¬ h 2 ) ∧ ( a ∨¬ h 1 ∨ h 2 ) ∧ ( ¬ a ∨ h 1 ∨ h 2 ) ∧ ( ¬ a ∨¬ h 1 ∨¬ h 2 ) ∧ Decision ( h 2 ) (or SAT) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 15 / 67
CDCL (5) CNF BCP ( ¬ b ∨¬ h 1 ) ∧ ( c ∨¬ h 1 ) ∧ no conflict conflict ( b ∨¬ c ∨ h 1 ) ∧ ( a ∨ h 1 ∨¬ h 2 ) ∧ ( a ∨¬ h 1 ∨ h 2 ) ∧ ( ¬ a ∨ h 1 ∨ h 2 ) ∧ ( ¬ a ∨¬ h 1 ∨¬ h 2 ) ∧ Decision ( h 2 ) (or SAT) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 16 / 67
CDCL (5) CNF BCP ( ¬ b ∨¬ h 1 ) ∧ ( c ∨¬ h 1 ) ∧ no conflict conflict ( b ∨¬ c ∨ h 1 ) ∧ ( a ∨ h 1 ∨¬ h 2 ) ∧ ( a ∨¬ h 1 ∨ h 2 ) ∧ ( ¬ a ∨ h 1 ∨ h 2 ) ∧ ( ¬ a ∨¬ h 1 ∨¬ h 2 ) ∧ Decision Conflict Analysis ( h 2 ) (or SAT) and Backtrack FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 17 / 67
CDCL (5) CNF BCP ( ¬ b ∨¬ h 1 ) ∧ ( c ∨¬ h 1 ) ∧ no conflict conflict ( b ∨¬ c ∨ h 1 ) ∧ ( a ∨ h 1 ∨¬ h 2 ) ∧ ( a ∨¬ h 1 ∨ h 2 ) ∧ ( ¬ a ∨ h 1 ∨ h 2 ) ∧ ( ¬ a ∨¬ h 1 ∨¬ h 2 ) ∧ Decision Conflict Analysis ( h 2 ) (SAT) and Backtrack (or UNSAT) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 18 / 67
iSAT3 (1) PC + MAP + CNF ( h 1 = y 2 ) ∧ ( h 2 = x + h 1 ) ∧ ( h 3 ⇔ ( h 2 < 5)) ∧ ( a ∨ h 3 ∨¬ h 4 ) ∧ ( a ∨¬ h 3 ∨ h 4 ) ∧ ( ¬ a ∨ h 3 ∨ h 4 ) ∧ ( ¬ a ∨¬ h 3 ∨¬ h 4 ) ∧ ( h 4 ) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 19 / 67
iSAT3 (1) PC + MAP + CNF ( h 1 = y 2 ) ∧ SMT Formula Tseitin-like ( h 2 = x + h 1 ) ∧ Transformation ( h 3 ⇔ ( h 2 < 5)) ∧ ( a ⊕ ( x + y 2 < 5)) ( a ∨ h 3 ∨¬ h 4 ) ∧ ( h 1 = y 2 ) ( a ∨¬ h 3 ∨ h 4 ) ∧ linear and nonlinear real arithmetic ( h 2 = x + h 1 ) ( ¬ a ∨ h 3 ∨ h 4 ) ∧ with transcendental functions ( h 3 ⇔ ( h 2 < 5)) ( ¬ a ∨¬ h 3 ∨¬ h 4 ) ∧ ( h 4 ⇔ ( a ⊕ h 3 )) ( h 4 ) • maintain interval for every real- or integer-valued variable • PC: primitive constraints: ( h 1 = y 2 ), ( h 2 = x + h 1 ) • MAP: map literals to simple bounds: ( h 3 ⇔ ( h 2 < 5)) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 20 / 67
iSAT3 (1) PC + MAP + CNF Assignment Variable Type Value ( h 1 = y 2 ) ∧ SMT Formula a bool false Tseitin-like ( h 2 = x + h 1 ) ∧ x real ... Transformation ( h 3 ⇔ ( h 2 < 5)) ∧ ( a ⊕ ( x + y 2 < 5)) y real ... ( a ∨ h 3 ∨¬ h 4 ) ∧ ( h 1 = y 2 ) h 1 real ... ( a ∨¬ h 3 ∨ h 4 ) ∧ linear and nonlinear real arithmetic ( h 2 = x + h 1 ) h 2 real h 3 ( ¬ a ∨ h 3 ∨ h 4 ) ∧ with transcendental functions ( h 3 ⇔ ( h 2 < 5)) h 3 bool true ( ¬ a ∨¬ h 3 ∨¬ h 4 ) ∧ ( h 4 ⇔ ( a ⊕ h 3 )) simple bound ( h 4 ) ( h 2 < 5) • maintain interval for every real- or integer-valued variable h 4 bool true • PC: primitive constraints: ( h 1 = y 2 ), ( h 2 = x + h 1 ) • MAP: map literals to simple bounds: ( h 3 ⇔ ( h 2 < 5)) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 21 / 67
iSAT3 (2) PC + MAP + CNF ( h 1 = y 2 ) ∧ ( h 2 = x + h 1 ) ∧ ( h 3 ⇔ ( h 2 < 5)) ∧ ( a ∨ h 3 ∨¬ h 4 ) ∧ ( a ∨¬ h 3 ∨ h 4 ) ∧ ( ¬ a ∨ h 3 ∨ h 4 ) ∧ ( ¬ a ∨¬ h 3 ∨¬ h 4 ) ∧ ( h 4 ) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 22 / 67
iSAT3 (3) PC + MAP + CNF BCP, ICP ( h 1 = y 2 ) ∧ ( h 2 = x + h 1 ) ∧ ( h 3 ⇔ ( h 2 < 5)) ∧ ( a ∨ h 3 ∨¬ h 4 ) ∧ ( a ∨¬ h 3 ∨ h 4 ) ∧ ( ¬ a ∨ h 3 ∨ h 4 ) ∧ ( ¬ a ∨¬ h 3 ∨¬ h 4 ) ∧ ( h 4 ) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 23 / 67
iSAT3 (4) PC + MAP + CNF BCP, ICP ( h 1 = y 2 ) ∧ ( h 2 = x + h 1 ) ∧ no conflict ( h 3 ⇔ ( h 2 < 5)) ∧ ( a ∨ h 3 ∨¬ h 4 ) ∧ ( a ∨¬ h 3 ∨ h 4 ) ∧ ( ¬ a ∨ h 3 ∨ h 4 ) ∧ ( ¬ a ∨¬ h 3 ∨¬ h 4 ) ∧ Decision, ( h 4 ) Split (or SAT) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 24 / 67
iSAT3 (5) PC + MAP + CNF BCP, ICP ( h 1 = y 2 ) ∧ ( h 2 = x + h 1 ) ∧ no conflict conflict ( h 3 ⇔ ( h 2 < 5)) ∧ ( a ∨ h 3 ∨¬ h 4 ) ∧ ( a ∨¬ h 3 ∨ h 4 ) ∧ ( ¬ a ∨ h 3 ∨ h 4 ) ∧ ( ¬ a ∨¬ h 3 ∨¬ h 4 ) ∧ Decision, Conflict Analysis ( h 4 ) Split and Backtrack (or SAT) (or UNSAT) FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 25 / 67
iSAT3 (6) SAT iSAT3 Deductions • BCP for clauses • BCP for clauses evaluate simple bound literals � implication clauses • ICP for PC � arithmetic clauses Decisions • decide literals • decide literals • generate new simple bound literals and decide them Conflict Analyses • traverse implication • traverse implication graph (1UIP) graph (1UIP) � conflict clauses � conflict clauses FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 26 / 67
iSAT3 (6) SAT iSAT3 Deductions • BCP for clauses • BCP for clauses evaluate simple bound literals � implication clauses • ICP for PC � arithmetic clauses Decisions • decide literals • decide literals • generate new simple bound literals and decide them Conflict Analyses • traverse implication • traverse implication graph (1UIP) graph (1UIP) � conflict clauses � conflict clauses FMCAD 2016 Karsten Scheibler – Accurate ICP-based FP Reasoning 27 / 67
Recommend
More recommend