A Testable Abstract Data Type of Outer and Inner Real Approximations - - PowerPoint PPT Presentation

a testable abstract data type of outer and inner real
SMART_READER_LITE
LIVE PREVIEW

A Testable Abstract Data Type of Outer and Inner Real Approximations - - PowerPoint PPT Presentation

A Testable Abstract Data Type of Outer and Inner Real Approximations Michal Kone cn y m.konecny@aston.ac.uk School of Engineering and Applied Science Aston University Birmingham, UK Mon, June 25 th , 2012 CCA 2012 Cambridge, UK


slide-1
SLIDE 1

aston-logo

A Testable Abstract Data Type of Outer and Inner Real Approximations

Michal Koneˇ cn´ y

m.konecny@aston.ac.uk School of Engineering and Applied Science Aston University Birmingham, UK

Mon, June 25th, 2012 CCA 2012 Cambridge, UK

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 1/21

slide-2
SLIDE 2

aston-logo Introduction

Outline

1

Introduction Exact real arithmetic in practice Exact real arithmetic available today Goals Contribution to theory

2

Approximate ordered fields Approximate equalities Exact, consistent and anti-consistent approximations Numerical order ADT overview

3

Convergence Precision of approximate equalities Convergent families of approximate ordered fields

4

Conclusion Summary Remains to be done

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 2/21

slide-3
SLIDE 3

aston-logo Introduction

Exact real arithmetic in practice

exact real arithmetic has potential to be useful in practice, eg in: reliable hybrid system simulation and verification (eg in robotics)

0/8 1/8 2/8 1 2 1 2 3 1 2 1 2 3 1 2

theorem proving (eg in verification of FP programs)

  • g

g f f g ⊑ f =⇒ g ⊑ f f f f ⊤ ⊥ IL(D → R) g g g

even better: exact arithmetic of continuous real functions (Rm → Rn) including: pointwise operations, integration, composition, projections

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 3/21

3()ΩΣΠΖΜΡΚΜΡΞΙςΖΕΠ4ΜΓΕςΗ ΙΡΓΠΣΩΜΡΚ>ΙΡΣΕΡΗΦΙ]ΣΡΗ %ΕςΣΡ %ΘΙΩ ΗΣΘΕΜΡ ΠΕΞΞΜΓΙ ΜΡΞΙςΘΙΗ ΖΕΠΨΙΩ

slide-4
SLIDE 4

aston-logo Introduction

Exact real arithmetic available today

incremental precision improvement approaches eg IC-Reals, D. Lester’s package built on a very simple core easy to specify and check/verify not the most efficient arbitrarily high fixed precision interval methods eg iRRAM (N. M¨ uller), RealLib (B. Lambov) ODE solving: VNODE (Nedialkov et al), COSY (Berz & Makino) AFAIK fastest to date (CCA 2000) but a lot more complex hard to specify and very hard to verify

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 4/21

slide-5
SLIDE 5

aston-logo Introduction

Goals

(distant) goals: verified efficient exact real algorithms developed cost-effectively exact real arithmetic. . . fully specified and verified easy to use with clear semantics fast (near iRRAM, VNODE. . . ) types: real, interval, cont. fn., . . . (nearer) goals: manually verified exact real algorithms developed cost-effectively fully algebraically specified and well tested AP interval arithmetic here and now (and in this talk): algebraic ADT separating interval arithmetic from exact real computation in iRRAM style partially algebraically specified well-tested interval arithmetic

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 5/21

slide-6
SLIDE 6

aston-logo Introduction

Goals — overview

in/out-rounded aproximate reals up/down-rounded approximate reals

arbitrary-precision floating-point arithmetic rational arithmetic generalised interval arithmetic (data type) polynomial interval arithmetic (data type)

in/out-rounded aproximate continuous functions

functional exact real algorithms

endpoints coefficients B coefficients A

continuous lattice

  • f generalised

intervals continuous lattice with real numbers CC category with real numbers

uses uses contains

in

  • ut

down

up ℝ

semantics in

(ADT) (ADT) (ADT)

semantics in semantics in

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 6/21

%)62 14∗6

slide-7
SLIDE 7

aston-logo Introduction

Contribution to theory

real numbers = Cauchy-closed Archimedean-ordered field a non-constructive definition laws such as x + (y + z) = (x + y) + z do not hold for floating point numbers, intervals with FP endpoints real number approximations = approximate A- ordered field weaker form of our ADT of real approximations implemented in current version of the AERN library real numbers = convergent family of appr. C-closed A-ordered fields an alternative constructive definition of the real numbers specification of AP interval arithmetic suitable for formalisation in theorem provers

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 7/21

slide-8
SLIDE 8

aston-logo Approximate ordered fields

Approximate ordered fields

1

Introduction

2

Approximate ordered fields Approximate equalities Exact, consistent and anti-consistent approximations Numerical order ADT overview

3

Convergence

4

Conclusion

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 8/21

slide-9
SLIDE 9

aston-logo Approximate ordered fields

Approximate equalities — easy ones

? approximate version of x + (y + z) = (x + y) + z rounding consistently with numerical order on reals: x +↓(y +↓ z)

≤ (x +↑ y) +↑ z

x +↑(y +↑ z)

≥ (x +↓ y) +↓ z

rounding consistently with refinement order on real intervals/sets/?: x +(y + z)

⊑ (x + y) + z

x +(y + z)

⊒ (x + y) + z

distance measure d(lhs, rhs): “how far it is from being equality”

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 9/21

slide-10
SLIDE 10

aston-logo Approximate ordered fields

Approximate equalities — hard ones

hardest: x · (y + z) = x · y + x · z with numerical order rounding: multiplication is not monotone −→ many cases applies to all laws involving multiplication with refinement order rounding: does not hold for non-exact elements. . . but for consistent approximations we have: x · (y + z) ⊒ x · y + x · z and for anti-consistent approximations we have: x · (y + z) ⊑ x · y + x · z

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 10/21

slide-11
SLIDE 11

aston-logo Approximate ordered fields

Exact, consistent and anti-consistent approximations

an imprecision measure µ(x) x is exact iff µ(x) = 0 x is consistent iff µ(x) ≥ 0 x is anti-consistent iff µ(x) ≤ 0 numeric order must be also defined — see next slide approximate distance measure for x ⊑ y: d(x, y) def

= µ(x) − µ(y)

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 11/21

slide-12
SLIDE 12

aston-logo Approximate ordered fields

Numerical order

how to semi-decide the numerical order (≤)? with refinement ordered elements: numerical order is a pre-order defined only for consistent elements (transitivity does not hold for anti-consistent intervals) for exact elements the order is total in ≤-laws both sides must be outer rounded expressions

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 12/21

slide-13
SLIDE 13

aston-logo Approximate ordered fields

ADT overview— signature

⊓, ⊔ : refinement meet and join : R × R → R ≤ : numeric order : R × R → B (partial order) µ : imprecision measure : R → R

0, 1 : zero and one : R

+, + : outer and inner rounded addition : R × R → R −, − : outer and inner rounded negation : R → R ∗, ∗ : outer and inner rounded multiplication : R × R → R

1/, 1/ : outer and inner rounded reciprocal : R → R

refinement: a ⊑ b

def

⇐⇒ a ⊓ b = a

notation for “≤ if comparable”: a ≤⊥ b

def

⇐⇒ a b

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 13/21

slide-14
SLIDE 14

aston-logo Approximate ordered fields

ADT overview— order laws

lattice laws for ⊔, ⊓ . . . imprecision laws: 0 ≤ µ(µ(a))

µ(0) = µ(1) = 0

a ⊑ b

=⇒ µ(b) ≤⊥ µ(a)

a ⊑ b ∧ µ(a) = µ(b)

=⇒

a = b numerical order on consistent/exact elements: 0 ≤ µ(a) ∧ 0 ≤ µ(b) ∧ 0 ≤ µ(c) =⇒ a ≤ b ∧ b ≤ a =⇒ a = b a ≤ b ∧ b ≤ c =⇒ a ≤ c . . . ditto . . . ∧ µ(a ⊔ b) ≤ 0 =⇒ a ≤ b ∨ b ≤ a (optional) 0 = µ(a) =⇒ a ≤ a refinement isotonicity: a ⊑ a′ ∧ b ⊑ b′

=⇒

a ≤ b =⇒ a′ ≤ b′

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 14/21

slide-15
SLIDE 15

aston-logo Approximate ordered fields

ADT overview— arithmetic laws

commutative monoidal properties. . . refinement isotonicity of operations, eg: a ⊑ a′, b ⊑ b′ =⇒ a ∗ b ⊑ a′ ∗ b′

  • rder compatibility:

a ≤ b

=⇒

a + c ≤⊥ b + c 0 ≤ a, 0 ≤ b

=⇒

0 ≤⊥ a ∗ b sub-inverses and sub-distributivity: 0 ≤ µ(a), 0 ≤ µ(b), 0 ≤ µ(c)

µ(a) ≤ 0, µ(b) ≤ 0, µ(c) ≤ 0 ⇓ ⇓

a ∗(1/ a) ⊑ 1 1 ⊑ a ∗(1/ a) a +(− a) ⊑ 0 0 ⊑ a +(− a)

(a ∗ b) +(a ∗ c) ⊑ a ∗(b + c)

a ∗(b + c)

⊑ (a ∗ b) +(a ∗ c)

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 15/21

slide-16
SLIDE 16

aston-logo Convergence

Convergence

1

Introduction

2

Approximate ordered fields

3

Convergence Precision of approximate equalities Convergent families of approximate ordered fields

4

Conclusion

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 16/21

slide-17
SLIDE 17

aston-logo Convergence

Precision of approximate equalities

general form of approximate equality: f1 ⊑ f2 f1 ⊒ f2 where f1, f1, f2, f2: Rm → R the equality holds with precision r ∈ R, 0 ≤ r iff: d

  • f1(

a), f2( a)

  • ∗ r ≤ 1

d

  • f2(

a), f1( a)

  • ∗ r ≤ 1

(algebraic laws) for sub-identity and sub-distributivity, add the premises: 0 ≤ r ∗ r ∗ µ(ai) ≤ 1

(−1) ≤ r ∗ r ∗ µ(ai) ≤ 0

ADT approximate ordered field with precision r: add the above inequalities for all approximate equalities in the ADT

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 17/21

slide-18
SLIDE 18

aston-logo Convergence

Convergent families of approximate ordered fields

approximate ordered field R′ refines R — defined algebraically, eg:

∀a, b ∈ R ⊆ R′

a + b

⊑′

a +′ b a + b

⊒′

a +′ b a convergent family: a refinement sequence R1, R2, . . . with precisions r1, r2, . . . → ∞ its limit: elements: refinement equivalence classes of fast convergent Cauchy sequences ai ∈ Ri

  • perations element wise, ≤ decided on finite prefix

Theorem (Convergent family defines the real numbers) The limit of a convergent family is an ordered field. Its subfield of exact elements forms a C-complete A-ordered field.

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 18/21

slide-19
SLIDE 19

aston-logo Conclusion

Conclusion

1

Introduction

2

Approximate ordered fields

3

Convergence

4

Conclusion Summary Remains to be done

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 19/21

slide-20
SLIDE 20

aston-logo Conclusion

Summary

algebraic formalisation of a convergent family of ordered fields provides abstract specification of interval arithmetic — hides endpoints provides abstract specification for pointwise function arithmetic testable using QuickCheck for easy debugging and high reliability without verification constructively defines the real numbers

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 20/21

slide-21
SLIDE 21

aston-logo Conclusion

Remains to be done

complete the AERN implementation specified and tested most of the approximate equalities not yet specified and tested the precision axioms specify, analyse and implement a more complete ADT of continuous real functions consider using the specification for a formally verified interval arithmetic

Michal Koneˇ cn´ y ADT of Inner and Outer Real Approximations 21/21