Focus Slide . p.1 . p.2 CONTINUITY . p.2 CONTINUITY . - - PowerPoint PPT Presentation

focus slide
SMART_READER_LITE
LIVE PREVIEW

Focus Slide . p.1 . p.2 CONTINUITY . p.2 CONTINUITY . - - PowerPoint PPT Presentation

Focus Slide . p.1 . p.2 CONTINUITY . p.2 CONTINUITY . p.2 CONTINUITY IN SOFTWARE SYSTEMS . p.2 CONTINUITY IN SOFTWARE SYSTEMS Dick Hamlet Portland State University Portland, OR, USA .


slide-1
SLIDE 1

Focus Slide

. – p.1

slide-2
SLIDE 2

. – p.2

slide-3
SLIDE 3

CONTINUITY

. – p.2

slide-4
SLIDE 4

ε δ

CONTINUITY

. – p.2

slide-5
SLIDE 5

ε δ

CONTINUITY IN SOFTWARE SYSTEMS

. – p.2

slide-6
SLIDE 6

ε δ

CONTINUITY IN SOFTWARE SYSTEMS

Dick Hamlet Portland State University Portland, OR, USA

. – p.2

slide-7
SLIDE 7

Outline of the Talk

  • I. Continuity in the Real World
  • II. Defining Continuity
  • III. Testing and Analyzing ‘Continuity’

. – p.3

slide-8
SLIDE 8

Outline of the Talk

  • I. Continuity in the Real World
  • II. Defining Continuity
  • III. Testing and Analyzing ‘Continuity’

. – p.3

slide-9
SLIDE 9

The Trustworthy Lever

F

. – p.4

slide-10
SLIDE 10

The Trustworthy Lever

F

Maximum stress T

. – p.4

slide-11
SLIDE 11

The Trustworthy Lever

F

Maximum stress T

T F

failure limit

. – p.4

slide-12
SLIDE 12

Untrustworthy Behavior

F

. – p.5

slide-13
SLIDE 13

Untrustworthy Behavior

F0

. – p.5

slide-14
SLIDE 14

Untrustworthy Behavior

F0 F0

failure limit

. – p.5

slide-15
SLIDE 15

Testing a System for Trustworthiness

Sample the behavior often enough that continuity covers the space between samples

  • utput values

input conditions safety limit ++ + + + + +

. – p.6

slide-16
SLIDE 16

Testing a System for Trustworthiness

Sample the behavior often enough that continuity covers the space between samples

  • utput values

input conditions safety limit ++ + + + + +

. – p.6

slide-17
SLIDE 17

Safety Factors

Continuity isn’t enough – something needed like a Lipschitz condition + + +

. – p.7

slide-18
SLIDE 18

Safety Factors

Continuity isn’t enough – something needed like a Lipschitz condition + + +

. – p.7

slide-19
SLIDE 19

Outline of the Talk

  • I. Continuity in the Real World
  • II. Defining Continuity
  • III. Testing and Analyzing ‘Continuity’

. – p.8

slide-20
SLIDE 20

The Real-analysis Definition

The famous ‘ε − δ’ version: DEFINITION: A real function f is continuous at

x0 iff: Given any ǫ > 0, ∃δ > 0 such that ∀x (|x − x0| < δ = ⇒ |f(x) − f(x0)| < ǫ)

. – p.9

slide-21
SLIDE 21

The Real-analysis Definition

The famous ‘ε − δ’ version: DEFINITION: A real function f is continuous at

x0 iff: Given any ǫ > 0, ∃δ > 0 such that ∀x (|x − x0| < δ = ⇒ |f(x) − f(x0)| < ǫ) x0

. – p.9

slide-22
SLIDE 22

The Real-analysis Definition

The famous ‘ε − δ’ version: DEFINITION: A real function f is continuous at

x0 iff: Given any ǫ > 0, ∃δ > 0 such that ∀x (|x − x0| < δ = ⇒ |f(x) − f(x0)| < ǫ) x0

ε δ

. – p.9

slide-23
SLIDE 23

The Real-analysis Definition

The famous ‘ε − δ’ version: DEFINITION: A real function f is continuous at

x0 iff: Given any ǫ > 0, ∃δ > 0 such that ∀x (|x − x0| < δ = ⇒ |f(x) − f(x0)| < ǫ) x0

ε

. – p.9

slide-24
SLIDE 24

Discrete Functions

Approximating a function f ( )

. – p.10

slide-25
SLIDE 25

Discrete Functions

Approximating a function f ( )with a discrete approximation fd (

  • ), fd(x) = rnd(f(x)), integer x
✁ ✁ ✁ ✁ ✁ ✁ ✁

. – p.10

slide-26
SLIDE 26

Rosenfeld’s Definition

DEFINITION: An integer function f defined on a finite interval of the integers is discretely continuous iff: Given any ǫ ≥ 1, ∃δ ≥ 1 such that

∀x (|x − x0| ≤ δ = ⇒ |f(x) − f(x0)| ≤ ǫ)

. – p.11

slide-27
SLIDE 27

Rosenfeld’s Definition

DEFINITION: An integer function f defined on a finite interval of the integers is discretely continuous iff: Given any ǫ ≥ 1, ∃δ ≥ 1 such that

∀x (|x − x0| ≤ δ = ⇒ |f(x) − f(x0)| ≤ ǫ)

  • . – p.11
slide-28
SLIDE 28

Rosenfeld’s Definition

DEFINITION: An integer function f defined on a finite interval of the integers is discretely continuous iff: Given any ǫ ≥ 1, ∃δ ≥ 1 such that

∀x (|x − x0| ≤ δ = ⇒ |f(x) − f(x0)| ≤ ǫ)

  • ε

x0

. – p.11

slide-29
SLIDE 29

Rosenfeld’s Definition

DEFINITION: An integer function f defined on a finite interval of the integers is discretely continuous iff: Given any ǫ ≥ 1, ∃δ ≥ 1 such that

∀x (|x − x0| ≤ δ = ⇒ |f(x) − f(x0)| ≤ ǫ)

  • ε

δ

x0

. – p.11

slide-30
SLIDE 30

Surprises?

The discretely continuous functions:

◮ have the intermediate value property:

if f(x) < m < f(y), ∃z such that f(z) = m

. – p.12

slide-31
SLIDE 31

Surprises?

The discretely continuous functions:

◮ have the intermediate value property:

if f(x) < m < f(y), ∃z such that f(z) = m

◮ are closed under composition

. – p.12

slide-32
SLIDE 32

Surprises?

The discretely continuous functions:

◮ have the intermediate value property:

if f(x) < m < f(y), ∃z such that f(z) = m

◮ are closed under composition ◮ are not closed under arithmetic operations

. – p.12

slide-33
SLIDE 33

Surprises?

The discretely continuous functions:

◮ have the intermediate value property:

if f(x) < m < f(y), ∃z such that f(z) = m

◮ are closed under composition ◮ are not closed under arithmetic operations ⊲ Let f(x) = x, for which fd is discretely

continuous everywhere. But fd + fd is nowhere discretely continuous.

. – p.12

slide-34
SLIDE 34

Floating-point Continuity

A program “computes f to within 1%”:

◮ For all real x, program inputs will approximate x with error at most δx, and for all input values t such that |x − t| < δx the program output vt

at t will satisfy |(f(x) − vt)/f(x)| < .01 DEFINITION: The function F computed by a program is floating-point continuous iff it approximates a continuous function to the accuracy of the program’s specification.

◮ Floating-point continuity: almost discrete

continuity ‘scaled’ by floating-point granularity

. – p.13

slide-35
SLIDE 35

Failure Continuity

DEFINITION: Program P has specification S. P is failure continuous at x0 iff ∃b > 0 such that:

P(x0) = S(x0) = ⇒ ∀t, |x0 − t| < b (P(t) = S(t))

. – p.14

slide-36
SLIDE 36

Failure Continuity

DEFINITION: Program P has specification S. P is failure continuous at x0 iff ∃b > 0 such that:

P(x0) = S(x0) = ⇒ ∀t, |x0 − t| < b (P(t) = S(t))

S(x) = sin(x) ± 5%

1 00

π

. – p.14

slide-37
SLIDE 37

Failure Continuity

DEFINITION: Program P has specification S. P is failure continuous at x0 iff ∃b > 0 such that:

P(x0) = S(x0) = ⇒ ∀t, |x0 − t| < b (P(t) = S(t))

S(x) = sin(x) ± 5%

1 00

π

P(x) = 1

x0

. – p.14

slide-38
SLIDE 38

Failure Continuity

DEFINITION: Program P has specification S. P is failure continuous at x0 iff ∃b > 0 such that:

P(x0) = S(x0) = ⇒ ∀t, |x0 − t| < b (P(t) = S(t))

S(x) = sin(x) ± 5%

1 00

π

P(x) = 1

x0 ◮ Failure continuity is what Howden’s ‘reliable’

subdomains have

. – p.14

slide-39
SLIDE 39

Program Analysis with Reals Justified

◮ Program variables are not the real variables

we pretend they are CONJECTURE: If a program computes by symbolic execution a continuous real-valued function, then: (1) The program is discretely continuous over a suitable interval, and (2) There is a specification accuracy for which the program is floating-point continuous. Proof? Choose the interval or the required accuracy to be as poor as necessary.

. – p.15

slide-40
SLIDE 40

Program Analysis with Reals Justified

◮ Program variables are not the real variables

we pretend they are CONJECTURE: If a program computes by symbolic execution a continuous real-valued function, then: (1) The program is discretely continuous over a suitable interval, and (2) There is a specification accuracy for which the program is floating-point continuous. Proof? Choose the interval or the required accuracy to be as poor as necessary.

◮ The converse is false

. – p.15

slide-41
SLIDE 41

Outline of the Talk

  • I. Continuity in the Real World
  • II. Defining Continuity
  • III. Testing and Analyzing ‘Continuity’

. – p.16

slide-42
SLIDE 42

Testing a Program for Continuity

◮ Imperative conditional statements are the

source of discontinuity

◮ On each path subdomain, programs compute

a real-variable polynomial

⊲ Potential discontinuities can occur only on

path-subdomain boundaries

⊲ Testing for continuity across a boundary

requires no oracle

. – p.17

slide-43
SLIDE 43

Testing a Program for Continuity

◮ Imperative conditional statements are the

source of discontinuity

◮ On each path subdomain, programs compute

a real-variable polynomial

⊲ Potential discontinuities can occur only on

path-subdomain boundaries

⊲ Testing for continuity across a boundary

requires no oracle

◮ Functional languages might be better –

program continuities are closed under composition

. – p.17

slide-44
SLIDE 44

Ideas to Explore in Continuity Analysis

Suppose a program for a continuous specification is continuous. What new kinds of analysis are possible?

◮ With Lipschitz conditions, good behavior on

test points spaced at some ∆ guarantees correctness

. – p.18

slide-45
SLIDE 45

Ideas to Explore in Continuity Analysis

Suppose a program for a continuous specification is continuous. What new kinds of analysis are possible?

◮ With Lipschitz conditions, good behavior on

test points spaced at some ∆ guarantees correctness

◮ “Random structural testing” is a name for

using a uniform profile on each Lipschitz neighborhood – it may not be intractable in the ultrareliable region

. – p.18

slide-46
SLIDE 46

Ideas to Explore in Continuity Analysis

Suppose a program for a continuous specification is continuous. What new kinds of analysis are possible?

◮ With Lipschitz conditions, good behavior on

test points spaced at some ∆ guarantees correctness

◮ “Random structural testing” is a name for

using a uniform profile on each Lipschitz neighborhood – it may not be intractable in the ultrareliable region

◮ Exploit continuity in the self-testing/correcting

methods of Blum and Ammann

. – p.18

slide-47
SLIDE 47

Inherent Discontinuity

◮ Continuous specifications are important ⊲ Flight- and process-control software ⊲ Simulations of natural systems ⊲ Regulatory-agency problems with software

replacing hardware

◮ But software’s forté is discontinuous

specifications that no other technology can handle

⊲ Chess-playing robots ⊲ Compilers and other character-based

processors

. – p.19

slide-48
SLIDE 48

QUESTIONS?

x0

ε δ

. – p.20

slide-49
SLIDE 49

QUESTIONS?

x0

ε δ

What is that?

. – p.20