Download presentation
Presentation is loading. Please wait.
Published byCorey Goodman Modified over 9 years ago
2
Floating-point arithmetic
3
FPA semantics
4
FPA representation sign
5
SMT floating-point arithmetic
8
double Kp=1.0, Ki=0.25; double set_point=20.0, integral=0.0; double error, in, out; for (int i=0; i < N; i++) { in = read_input(); error = set_point – in; integral = integral + error; out = Kp*error + Ki*integral; set_output(out); } An example
9
Example strategy
10
(declare-fun Kp () (_ FloatingPoint 5 11)) (declare-fun … (define-fun rm () RoundingMode RNE) (assert (= c18 (fp #b0 #b10011 #b0010000000))) ;; = 18.0 (assert (= c22 (fp #b0 #b10011 #b0110000000))) ;; = 22.0 (assert (= cp3 (fp #b0 #b10000 #b1000000000))) ;; = +3.0 (assert (= cn3 (fp #b1 #b10000 #b1000000000))) ;; = -3.0 (assert (= Kp (fp #b0 #b01111 #b0000000000))) ;; = 1.0 (assert (= Ki (fp #b0 #b01101 #b0000000000))) ;; = 0.25 (assert (= set_point (fp #b0 #b10011 #b0100000000))) ;; = 20.0 (assert (= integral (_ +zero 5 11))) ;; = +0.0 An example in SMT2
11
(assert (not (=> (and (fp.leq c18 in) (fp.leq in c22) (fp.eq error_post (fp.sub rm set_point in)) (fp.eq integral_post (fp.add rm integral error_post)) (fp.eq out (fp.add rm (fp.mul rm Kp error_post) (fp.mul rm Ki integral_post)))) (and (fp.leq cn3 out) (fp.leq out cp3)) ))) > z3 pi_controller_1.smt2 unsat An example in SMT2
12
Checking properties
13
Related techniques
14
1. Translate to QF_BV (build circuits) 2. Translate to SAT (e.g., Tseitin translation, bit-blasting) 3. Run SAT Solver 4. Translate models/proofs (back to QF_BV, then QF_FP) Solving QF_FP via SAT Circuit for and method of providing a floating-point adder US 8463835 B1 (Xilinx)
15
Conversion QF_FP -> QF_BV -> SAT Example performance Bad
16
1. Mixed abstractions (CBMC) 2. Non-conservative approximations (Z3) 3. Abstraction into interval arithmetic (MathSAT) 4. Translation into non-linear reals (Realizer) Advanced QF_FP solving
17
Abstraction refinement Model sat Proof unsat no refinement possible failed
18
Mixed abstractions Brillout, Kroening, Wahl: Mixed Abstractions for Floating-Point Arithmetic. FMCAD 2009
19
Mixed abstractions Brillout, Kroening, Wahl: Mixed Abstractions for Floating-Point Arithmetic. FMCAD 2009 sign ORM URM RM
20
Small-float approximation sign RM Zeljic, Wintersteiger, Rümmer: Approximations for Model Construction. IJCAR 2014
21
For the theory of floating-point numbers: Small-floats inclusion Zeljic, Wintersteiger, Rümmer: Approximations for Model Construction. IJCAR 2014
22
Approximation framework lift reconstruct Zeljic, Wintersteiger, Rümmer: Approximations for Model Construction. IJCAR 2014
23
Lifting
24
Example precision terms
25
Refinement scheme Model sat Proof unsat no refinement possible failed
26
Approximate model construction
27
Model-guided refinement Model sat Proof unsat no refinement possible failed
28
Precise model reconstruction
29
Model-guided refinement
30
Proof-guided refinement Model sat Proof unsat no refinement possible failed
31
Proof-guided refinement
32
Algorithm properties
33
Fröhlich, Kovásznai, Biere: More on the Complexity of Quantifier-Free Fixed-Size Bit-Vector Logics with Binary Encoding. CSR 2013 Kovásznai, Fröhlich, Biere: On the Complexity of Fixed-Size Bit-Vector Logics with Binary Encoded Bit-Width. SMT 2012 A note on complexity
34
Non-conservative approximation Fröhlich, Biere, Wintersteiger, Hamadi: Stochastic Local Search for Satisfiability Modulo Theories. AAAI 2015
35
Abstract CDCL Brain, D’Silva, Griggio, Haller, Kroening: Interpolation-Based Verification of Floating-Point Programs with Abstract CDCL. SAS 2013 Brain, D’Silva, Griggio, Haller, Kroening: Deciding floating-point logic with abstract conflict driven clause learning. FMSD 45(2) 2014
36
FP-ACDCL
37
Realizer Leeser, Mukherjee, Ramachandran, Wahl: Make it real: Effective floating-point reasoning via exact arithmetic. DATE 2014
38
Mixed abstraction performance Brillout, Kroening, Wahl: Mixed Abstractions for Floating-Point Arithmetic. FMCAD 2009
39
FP-ACDCL performance Brain, D’Silva, Griggio, Haller, Kroening: Interpolation-Based Verification of Floating-Point Programs with Abstract CDCL. SAS 2013 Brain, D’Silva, Griggio, Haller, Kroening: Deciding floating-point logic with abstract conflict driven clause learning. FMSD 45(2) 2014
40
Experimental evaluation SATUNSAT Z37656 MathSAT76 Ours8646
41
Data (SAT)
42
Data (UNSAT)
43
Complexity of operations 5.3 Homogeneous general-computational operations 5.3.0 5.3.1 General operations 5.3.1.0 Implementations shall provide the following homogeneous general- computational operations for all supported arithmetic formats; … ― sourceFormat remainder(source, source) When y ≠ 0, the remainder r = remainder(x, y) is defined for finite x and y regardless of the … … FPREM1 … can reduce the exponent of ST(0) by no more than 63 in one execution of the instruction … Software can re-execute the instruction (using the partial remainder in ST(0) as the dividend) until … IEEE 754-2008, Sec 5.3. Intel® 64 and IA-32 Architectures Software Developer’s Manual. May 2012
44
Conclusion
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.