Multi-Objective Parameter Fitting in Parametric Probabilistic Hybrid - - PowerPoint PPT Presentation

multi objective parameter fitting in parametric
SMART_READER_LITE
LIVE PREVIEW

Multi-Objective Parameter Fitting in Parametric Probabilistic Hybrid - - PowerPoint PPT Presentation

Multi-Objective Parameter Fitting in Parametric Probabilistic Hybrid Automata Learning to Mine and Exploit PAC Formal Models Martin Frnzle 1 joint work with Alessandro Abate (Oxford University, UK), Sebastian Gerwinn (OFFIS e.V.,


slide-1
SLIDE 1

Multi-Objective Parameter Fitting in Parametric Probabilistic Hybrid Automata — Learning to Mine and Exploit PAC Formal Models —

Martin Fränzle1

joint work with

Alessandro Abate (Oxford University, UK), Sebastian Gerwinn (OFFIS e.V., FRG), Joost-Pieter Katoen (RWTH Aachen, FRG), Paul Kröger (CvOU Oldenburg, FRG)

1 Dpt. of Computing Science

· Carl von Ossietzky Universität · Oldenburg, Germany

slide-2
SLIDE 2

The traditional formal verification cycle

Verdict Object under Investigation

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 2 / 35

slide-3
SLIDE 3

The traditional formal verification cycle

Verdict Object under Investigation

proof assistance translation extraction manual encoding interpretation

Formal Model Formal Verdict Encoding of Semantics Proof

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 2 / 35

slide-4
SLIDE 4

The traditional formal verification cycle

Verdict Object under Investigation proof assistance translation extraction manual encoding interpretation Formal Model Formal Verdict Encoding of Semantics Proof

But what if

  • faithful formal modeling is too complex

to be feasible?

  • object under investigation is an

embedded system that learns part of its behavior only after deployment (and thus, after verification time)?

  • object under investigation is an

autonomous system which may eventually enter unknown (and thus, impossible to model a priori) environments & unpredictable system configurations?

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 2 / 35

slide-5
SLIDE 5

The traditional formal verification cycle

Verdict Object under Investigation proof assistance translation extraction manual encoding interpretation Formal Model Formal Verdict Encoding of Semantics Proof

But what if

  • faithful formal modeling is too complex

to be feasible?

  • object under investigation is an

embedded system that learns part of its behavior only after deployment (and thus, after verification time)?

  • object under investigation is an

autonomous system which may eventually enter unknown (and thus, impossible to model a priori) environments & unpredictable system configurations? Such applications become increasingly relevant, challenging our approaches to verification.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 2 / 35

slide-6
SLIDE 6

Example: Safety-critical learning in situ

Predicting direction of driving requires

  • detailed knowledge of factual tracks,
  • which may not coincide with marked lanes,
  • and which may change unexpectedly due

to, e.g., construction works.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 3 / 35

slide-7
SLIDE 7

Example: Safety-critical learning in situ

Predicting direction of driving requires

  • detailed knowledge of factual tracks,
  • which may not coincide with marked lanes,
  • and which may change unexpectedly due

to, e.g., construction works. Industry wants to counter these problems by

  • use of high-resolution digital maps, plus
  • machine learning for (temporarily) adapting

the map in situ.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 3 / 35

slide-8
SLIDE 8

Example: Safety-critical learning in situ

Predicting direction of driving requires

  • detailed knowledge of factual tracks,
  • which may not coincide with marked lanes,
  • and which may change unexpectedly due

to, e.g., construction works. Industry wants to counter these problems by

  • use of high-resolution digital maps, plus
  • machine learning for (temporarily) adapting

the map in situ. How to make sure that machine learning

  • doesn’t err in interpreting observations and

in learning?

  • actually learns relevant facts?
  • invalidates them when no longer factual?
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 3 / 35

slide-9
SLIDE 9

Example: Unpredictable system configurations

Future cyber-physical systems will be long-term autonomous:

  • sustain unattended operation for orders of

magnitude longer duration than the typical inter-maintenance period of systems in the respective class,

  • thereby have to be guaranteed to stay safe,

reliable, operational, . . .

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 4 / 35

slide-10
SLIDE 10

Example: Unpredictable system configurations

Future cyber-physical systems will be long-term autonomous:

  • sustain unattended operation for orders of

magnitude longer duration than the typical inter-maintenance period of systems in the respective class,

  • thereby have to be guaranteed to stay safe,

reliable, operational, . . . which implies that they

  • have to survive arbitrary combinations of multi-point failures, component

degradations, component losses, . . . , as well as unpredicted environments

  • employing behavioral adaptation (e.g., multi-objective parameter fitting),

reconfiguration, function substitution, . . . spanning a configuration space

  • too large to be verified in advance,
  • such that adaptation has to be safeguarded and guided by verification.
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 4 / 35

slide-11
SLIDE 11

The mission:

Applications increasingly call for bridging the gap betw. AI techniques and FMs, e.g.:

Machine learning Symbolic verification

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 5 / 35

slide-12
SLIDE 12

The mission:

Applications increasingly call for bridging the gap betw. AI techniques and FMs, e.g.:

Machine learning Symbolic verification safety verification

  • f machine learning
  • Need for mechanically supplying safety certificates for machine learning and

similar AI techniques (statically and/or run-time verification)

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 5 / 35

slide-13
SLIDE 13

The mission:

Applications increasingly call for bridging the gap betw. AI techniques and FMs, e.g.:

Machine learning Symbolic verification safety verification

  • f machine learning

generation of formal models for verification

  • Need for mechanically supplying safety certificates for machine learning and

similar AI techniques (statically and/or run-time verification)

  • May want to exploit AI techniques to bridge the modeling gap
  • when entering unknown / partially known environments, unpredicted

system configuration, . . .

  • when faced with overly complex modeling task.
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 5 / 35

slide-14
SLIDE 14

The mission: overall and today

Applications increasingly call for bridging the gap betw. AI techniques and FMs, e.g.:

Machine learning Symbolic verification safety verification

  • f machine learning

generation of formal models for verification

  • Need for mechanically supplying safety certificates for machine learning and

similar AI techniques (statically and/or run-time verification)

  • May want to exploit AI techniques to bridge the modeling gap
  • when entering unknown / partially known environments, unpredicted

system configuration, . . .

  • when faced with overly complex modeling task.
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 5 / 35

slide-15
SLIDE 15

A bird’s eye view of what we’ll achieve today

Traditional symbolic analysis assumes a well-understood, closed-form symbolic representation facilitating constraint-based analysis:

Verdict Solving Constraint Translation Verification Problem System

Preoccupation to a fixed representation may prevent some fruitful applications:

  • What happens, e.g., if the constraint representation is learnt from samples,

thus blending machine learning with constraint solving?

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 6 / 35

slide-16
SLIDE 16

A bird’s eye view of what we’ll achieve today

Traditional symbolic analysis assumes a well-understood, closed-form symbolic representation facilitating constraint-based analysis:

Verdict Solving Constraint Translation Verification Problem System

Preoccupation to a fixed representation may prevent some fruitful applications:

  • What happens, e.g., if the constraint representation is learnt from samples,

thus blending machine learning with constraint solving?

  • Could we perhaps automatically generate/mine PAC formalizations?
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 6 / 35

slide-17
SLIDE 17

Example: Demand-Response Schemes in Smart Grids A Practical Problem Featuring Hybrid Dynamics

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 7 / 35

slide-18
SLIDE 18

Demand Response: Supplying Reserve Power by Thermostatically Ctrl.ed Loads (TCLs) [Callaway 2009]

balance

Idea: Control power demand by (marginally) modifying switching thresholds of AC systems.

  • On power shortage, provide reserve power by switching off early /

switching on late.

  • On excess power, consume reserve power by switching off late /

switching on early.

  • Unnoticeable to residents due to marginal adjustments to switching

thresholds.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 8 / 35

slide-19
SLIDE 19

Dynamics of a Single Household — Simulation

2 4 6 8 10 time [hrs] 19.4 19.6 19.8 20.0 20.2 20.4 20.6 temperature [◦C]

Dashed lines indicate window opening / closing events.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 9 / 35

slide-20
SLIDE 20

Multiple Similar TCLs (N = 50) — Simulation

Externally controlled (power target 55 kW) vs. uncontrolled ensemble. Control strategy: switch off coldest households if power target exceeded.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 10 / 35

slide-21
SLIDE 21

Multiple Similar TCLs (N = 50) — Simulation

Externally controlled (power target 55 kW) vs. uncontrolled ensemble. Control strategy: switch off coldest households if power target exceeded.

Randomization would help! But how to dimension it? – Short average random retreat problem persists. – Long average random retreat loss of control.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 10 / 35

slide-22
SLIDE 22

The Formal Model Parametric Probabilistic HA

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 11 / 35

slide-23
SLIDE 23

A (discrete time) Parametric Probabilistic HA

fail 1.0: correct safe? 0.5: 0.5: go x:=x+cos h, y:=y+sin h x:=x+cos h, y:=y+sin h, h:=h+0.1 x:=x+cos h, y:=y+sin h, h:=h−0.1 0.05: 0.9: 0.05: 1.0: |y| ≥ 1 x = 0, y = 0, h = 0, S = 1, C = 0 |y| < 1 α: 1 − α: S := 0 C := C +

  • −y

3 − h

  • , h := −y

3

Car maneuvre: Keep lane while driving along a road.

  • Measurement of position in lane fails with probability 0.5.
  • Upon success, do occasional (due to cost associated) corrections of heading

angle h by proportional control.

  • Parameter α controls frequency of these corrective actions.
  • Two reward / cost variables:
  • C records accumulated cost of corrective steering actions,
  • S records successful stay in lane.
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 12 / 35

slide-24
SLIDE 24

A (discrete time) Parametric Probabilistic HA

fail 1.0: correct safe? 0.5: 0.5: go x:=x+cos h, y:=y+sin h x:=x+cos h, y:=y+sin h, h:=h+0.1 x:=x+cos h, y:=y+sin h, h:=h−0.1 0.05: 0.9: 0.05: 1.0: |y| ≥ 1 x = 0, y = 0, h = 0, S = 1, C = 0 |y| < 1 α: 1 − α: S := 0 C := C +

  • −y

3 − h

  • , h := −y

3

Model + method also support continu-

  • us time PPHA w. ODEs in locations.

Car maneuvre: Keep lane while driving along a road.

  • Measurement of position in lane fails with probability 0.5.
  • Upon success, do occasional (due to cost associated) corrections of heading

angle h by proportional control.

  • Parameter α controls frequency of these corrective actions.
  • Two reward / cost variables:
  • C records accumulated cost of corrective steering actions,
  • S records successful stay in lane.
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 12 / 35

slide-25
SLIDE 25

A multi-objective design problem

fail 1.0: correct safe? 0.5: 0.5: go x:=x+cos h, y:=y+sin h x:=x+cos h, y:=y+sin h, h:=h+0.1 x:=x+cos h, y:=y+sin h, h:=h−0.1 0.05: 0.9: 0.05: 1.0: |y| ≥ 1 x = 0, y = 0, h = 0, S = 1, C = 0 |y| < 1 α: 1 − α: S := 0 C := C +

  • −y

3 − h

  • , h := −y

3

Find parameterization α∗ such that

  • the system is sufficiently safe: P(safe) = E(S, α∗) ≥ θ1,

where θ1 is the safety target;

  • at acceptable cost: E(C, α∗) ≤ θ2,

where θ2 is a cost bound.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 13 / 35

slide-26
SLIDE 26

The design problem, abstractly

Given

1 a PPHA A, featuring

  • a vector

α = (α1, . . . , αk) of parameters,

  • a vector

f = (f1, . . . , fn) of reward (or cost) functions,

2 a constraint φ over

α specifying the possible parameter instances, and

3 a constraint C over E f specifying the (multi-objective) design goal,

find (or prove non-existence of) a parameter instance α∗ ∈ Rk that

1 satisfies φ and 2 yields expected time-bounded rewards E[

f, α∗] satisfying C.

Parameterizations Design Objectives

Expectations

α2 Ef2 | = φ | = φ | = C α1 Ef1 | = C

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 14 / 35

slide-27
SLIDE 27

Approach

[F., Gerwinn, Kröger, Abate, Katoen, FORMATS ’15]

1 Substitution of parametric probabilities in the system model by fixed

substitute probabilities;

2 Introduction of counters into the model counting how frequently such

substitutes have been chosen along a simulation run;

3 Statistical model checking of the modified model, yielding estimates of

the expected costs/rewards in the non-parametric substitute model;

4 Exploitation of the re-normalization equations of importance sampling

for obtaining a symbolic expression of the (estimated) parameter dependency of the costs/rewards;

5 Simplification of that expression by means of merging terms; 6 Use of SMT solving over, a.o., higher-order polynomials for

determining suitable parameters.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 15 / 35

slide-28
SLIDE 28

Estimating (Parametric) Expectations by Random Sampling

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 16 / 35

slide-29
SLIDE 29

Sampling as in traditional SMC [Younes, Simmons 2002–]

p(·; α) be the parameter-dependent distribution of random variable x ∈ X; let α∗ | = φ be a fixed parameter instance; let f : X → [a, b] be a bounded reward function. Expectation of f depending on α: E[f; α] =

  • x∈X

f(x)p(x; α) (1)

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 17 / 35

slide-30
SLIDE 30

Sampling as in traditional SMC [Younes, Simmons 2002–]

p(·; α) be the parameter-dependent distribution of random variable x ∈ X; let α∗ | = φ be a fixed parameter instance; let f : X → [a, b] be a bounded reward function. Expectation of f depending on α: E[f; α] =

  • x∈X

f(x)p(x; α) (1) Estimated expectation of f in α∗:

1 Use randomized simulation faithfully representing p(·, α∗) to

generate n samples x1, . . . , xm ∈ X.

2 Compute the empirical mean

˜ E[f; α∗] = 1 N

N

  • i=1

f(xi) (2)

  • f the sampled f values.
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 17 / 35

slide-31
SLIDE 31

Quality of the estimate

For large numbers of samples N, grossly outlying estimates are unlikely.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 18 / 35

slide-32
SLIDE 32

Quality of the estimate

For large numbers of samples N, grossly outlying estimates are unlikely. Hoeffding’s inequality [Hoeffding, 1963] yields P

  • ˜

E[f; α∗] − E[f; α∗] ≥ +ε

  • ≤ exp
  • −2

ε2N (bf − af)2

  • ,

(3a) P

  • ˜

E[f; α∗] − E[f; α∗] ≤ −ε

  • ≤ exp
  • −2

ε2N (bf − af)2

  • .

(3b)

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 18 / 35

slide-33
SLIDE 33

Quality of the estimate

For large numbers of samples N, grossly outlying estimates are unlikely. Hoeffding’s inequality [Hoeffding, 1963] yields P

  • ˜

E[f; α∗] − E[f; α∗] ≥ +ε

  • ≤ exp
  • −2

ε2N (bf − af)2

  • ,

(3a) P

  • ˜

E[f; α∗] − E[f; α∗] ≤ −ε

  • ≤ exp
  • −2

ε2N (bf − af)2

  • .

(3b)

  • Thus, SMC can be used for determining (with confidence) whether an

instance of a PPHA, i.e., a PHA, satisfies design objective C.

  • Build a formula determining whether all the ε neighbourhood of the

empirical mean satisfies C; check by SMT solving. E.g., unsat? Ef ∈ Bε( ˜ E[f, α∗]) ∧ ¬C

  • The multi-objective parameter fitting problem can then in principle be

solved by sampling the parameter space.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 18 / 35

slide-34
SLIDE 34

Quality of the estimate

For large numbers of samples N, grossly outlying estimates are unlikely. Hoeffding’s inequality [Hoeffding, 1963] yields P

  • ˜

E[f; α∗] − E[f; α∗] ≥ +ε

  • ≤ exp
  • −2

ε2N (bf − af)2

  • ,

(3a) P

  • ˜

E[f; α∗] − E[f; α∗] ≤ −ε

  • ≤ exp
  • −2

ε2N (bf − af)2

  • .

(3b)

  • Thus, SMC can be used for determining (with confidence) whether an

instance of a PPHA, i.e., a PHA, satisfies design objective C.

  • Build a formula determining whether all the ε neighbourhood of the

empirical mean satisfies C; check by SMT solving. E.g., unsat? Ef ∈ Bε( ˜ E[f, α∗]) ∧ ¬C

  • The multi-objective parameter fitting problem can then in principle be

solved by sampling the parameter space.

  • But this approach is plagued by the curse of dimensionality;

instead need a constructive form of generalizing from samples.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 18 / 35

slide-35
SLIDE 35

Importance Sampling The classical, non-symbolic version

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 19 / 35

slide-36
SLIDE 36

Importance sampling

[Hammersley, 1954]

An estimate for the expectation of f wrt. distribution p(·, α) can be

  • btained by sampling X wrt. a different (“proposal”) distribution q:

E[f; α] =

  • x∈X

f(x)p(x; α) =

  • x∈X

f(x)p(x; α) q(x)

  • g(x,α)

q(x) ≈ 1 N

N

  • i=1
  • f(xi)p(xi; α)

q(xi) where xi ∼ q (4a) =: ˆ E[f; α] (4b)

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 20 / 35

slide-37
SLIDE 37

Importance sampling

[Hammersley, 1954]

An estimate for the expectation of f wrt. distribution p(·, α) can be

  • btained by sampling X wrt. a different (“proposal”) distribution q:

E[f; α] =

  • x∈X

f(x)p(x; α) =

  • x∈X

f(x)p(x; α) q(x)

  • g(x,α)

q(x) ≈ 1 N

N

  • i=1
  • f(xi)p(xi; α)

q(xi) where xi ∼ q (4a) =: ˆ E[f; α] (4b) Note that samples {x1, . . . , xN} are drawn according to the substitute distribution q; nevertheless, (4a–4b) permits to compute estimates ˆ E[f; α] for arbitrary values of α.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 20 / 35

slide-38
SLIDE 38

Symbolic Importance Sampling Mining (not yet PAC) Formal Models

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 21 / 35

slide-39
SLIDE 39

Importance sampling in a PPHA

fail 1.0: correct safe? 0.5: 0.5: go x:=x+cos h, y:=y+sin h x:=x+cos h, y:=y+sin h, h:=h+0.1 x:=x+cos h, y:=y+sin h, h:=h−0.1 0.05: 0.9: 0.05: 1.0: |y| ≥ 1 x = 0, y = 0, h = 0, S = 1, C = 0 |y| < 1 α: 1 − α: S := 0 C := C +

  • −y

3 − h

  • , h := −y

3

Pursue a simulation with a concrete substitute probability q replacing α.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 22 / 35

slide-40
SLIDE 40

Importance sampling in a PPHA

fail 1.0: correct safe? 0.5: 0.5: go x:=x+cos h, y:=y+sin h x:=x+cos h, y:=y+sin h, h:=h+0.1 x:=x+cos h, y:=y+sin h, h:=h−0.1 0.05: 0.9: 0.05: 1.0: |y| ≥ 1 x = 0, y = 0, h = 0, S = 1, C = 0 |y| < 1 α: 1 − α: S := 0 C := C +

  • −y

3 − h

  • , h := −y

3

Pursue a simulation with a concrete substitute probability q replacing α. Assume simulation yields a run taking the α branch n times and the (1 − α) branch m times. Then

  • the probability of this run is c · qn · (1 − q)m in the simulation,
  • the probability of this run is c · αn · (1 − α)m in the PPHA, for arbitrary α.

Here, c denotes the accumulated probability of all other choices along the run.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 22 / 35

slide-41
SLIDE 41

Symbolic importance sampling

t1, . . . , tl be the parameter-dependent probability terms in the PPHA A. Let #itj denote the number of times the tj branch was taken in run xi when simulating A with the substitute parameterization q.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 23 / 35

slide-42
SLIDE 42

Symbolic importance sampling

t1, . . . , tl be the parameter-dependent probability terms in the PPHA A. Let #itj denote the number of times the tj branch was taken in run xi when simulating A with the substitute parameterization q. A symbolic representation of the parameter dependency of ˆ E[f; α] can be

  • btained from importance sampling (4a–4b):

ˆ E[f; α] = 1 N

N

  • i=1

f(xi)

l

  • j=1
  • tj

tj[q/α] #itj

  • ηf

(5)

Note that f(xi), tj[q/α] and #itj are constants s.t. the only free variables

  • ccurring in ηf are the parameters α1, . . . , αk within terms t1, . . . , tl.
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 23 / 35

slide-43
SLIDE 43

Parameterization

  • Term ηf in (5) is a large sum of products with multiple occurrences of

parameters αi within different instances of sub-terms tj.

  • Let C be a constraint over Ef1, . . . , Efn formalizing the design
  • bjective.
  • Let φ be the constraint on admissible parameterizations α.
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 24 / 35

slide-44
SLIDE 44

Parameterization

  • Term ηf in (5) is a large sum of products with multiple occurrences of

parameters αi within different instances of sub-terms tj.

  • Let C be a constraint over Ef1, . . . , Efn formalizing the design
  • bjective.
  • Let φ be the constraint on admissible parameterizations α.

A parameter instance α | = φ guaranteeing C can now in principle be found — or conversely, the infeasibility of C over φ be established — by solving the constraint system φ

  • parameter

range

∧ n

  • i=1

Efi = ηfi

  • parameter dependency of expectations

∧ C

  • design
  • bjective

(6) using an appropriate constraint solver.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 24 / 35

slide-45
SLIDE 45

Parameterization

  • Term ηf in (5) is a large sum of products with multiple occurrences of

parameters αi within different instances of sub-terms tj.

  • Let C be a constraint over Ef1, . . . , Efn formalizing the design
  • bjective.
  • Let φ be the constraint on admissible parameterizations α.

A parameter instance α | = φ guaranteeing C can now in principle be found — or conversely, the infeasibility of C over φ be established — by solving the constraint system φ

  • parameter

range

∧ n

  • i=1

Efi ∈ Bε(|

|α−q| |,N)(ηfi)

  • parameter dependency of expectations

∧ C

  • design
  • bjective

(6) using an appropriate constraint solver.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 24 / 35

slide-46
SLIDE 46

Parameterization

  • Term ηf in (5) is a large sum of products with multiple occurrences of

parameters αi within different instances of sub-terms tj.

  • Let C be a constraint over Ef1, . . . , Efn formalizing the design
  • bjective.
  • Let φ be the constraint on admissible parameterizations α.

A parameter instance α | = φ guaranteeing C can now in principle be found — or conversely, the infeasibility of C over φ be established — by solving the constraint system φ

  • parameter

range

∧ n

  • i=1

Efi ∈ Bε(|

|α−q| |,N)(ηfi)

  • parameter dependency of expectations

∧ C

  • design
  • bjective

(6) using an appropriate constraint solver.

Caveat: Existence of α satisfying (6) is a necessary, though not sufficient condition for it satisfying the design goal with confidence.

(Will deal with that issue later.)

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 24 / 35

slide-47
SLIDE 47

Finding Feasible Parameter Instances Polynomial constraint solving of very high order

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 25 / 35

slide-48
SLIDE 48

The shape of the constraint formulae

  • Constraint (6), i.e., φ ∧

n

i=1 Efi ∈ Bε(| |α−q| |,N)(ηfi)

  • ∧ C, is an

arithmetic constraint involving

1 addition, multiplication, exponentiation by (large!) integer constants, 2 the operations found in the terms t1, . . . , tl defining the parameter

dependency p(α) of the Markov chain,

3 the operations occurring in the parameter domain constraint φ and in

the design goal C,

  • it can be solved by SMT solvers addressing the corresponding subset
  • f arithmetic, e.g. iSAT.1 2

1iSAT [F., Herde, Ratschan, Schubert, Teige, 2007–] is an algorithms integrating

interval constraint propagation and SAT modulo theory for solving constraint systems

  • ver R, +, ∗, sin, exp, . . .

2You ought to refine iSAT’s standard settings for accuracy, though.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 26 / 35

slide-49
SLIDE 49

A simple instance of the constraint formulae

EXPR ...

  • - X236 represents 23 sample(s) of average reward -0.434783

X236 = -28493.9 * alpha**6 * (1-alpha)**10;

  • - X235 represents 12 sample(s) of average reward -0.666667

X235 = -21845.3 * alpha**6 * (1-alpha)**9;

  • - X234 represents 35 sample(s) of average reward -0.2

X234 = -13107.2 * alpha**9 * (1-alpha)**7;

  • - X233 represents 39 sample(s) of average reward -0.0512821

X233 = -13443.3 * alpha**7 * (1-alpha)**11; ...

  • - Computing empirical expectation E.

E = 0.00025 * (X1 + X2 + X3 + ... + X236 + X237 + X238 + X239);

  • - Optimization target is

(-0.01 <= E) and (E <= 0.0);

  • - Parameter constraint is

(alpha < 0.0125) or (alpha > 0.99);

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 27 / 35

slide-50
SLIDE 50

A simple instance of the constraint formulae

EXPR ...

  • - X236 represents 23 sample(s) of average reward -0.434783

X236 = -28493.9 * alpha**6 * (1-alpha)**10;

  • - X235 represents 12 sample(s) of average reward -0.666667

X235 = -21845.3 * alpha**6 * (1-alpha)**9;

  • - X234 represents 35 sample(s) of average reward -0.2

X234 = -13107.2 * alpha**9 * (1-alpha)**7;

  • - X233 represents 39 sample(s) of average reward -0.0512821

X233 = -13443.3 * alpha**7 * (1-alpha)**11; ...

  • - Computing empirical expectation E.

E = 0.00025 * (X1 + X2 + X3 + ... + X236 + X237 + X238 + X239);

  • - Optimization target is

(-0.01 <= E) and (E <= 0.0);

  • - Parameter constraint is

(alpha < 0.0125) or (alpha > 0.99); T e r m s

  • v

e r p a r a m e t e r s c a n – i n v

  • l

v e m u l t i p l e d i ff e r e n t p a r a m e t e r s , – i n v

  • l

v e l i n e a r , p

  • l

y n

  • m

i a l , a n d t r a n s c e n d e n t a l a r i t h m e t i c . E x p e c t a t i

  • n

s a n d p a r a m e t e r s m a y b e – m u l t i

  • d

i m e n s i

  • n

a l , – s u b j e c t t

  • a

r b i t r a r y B

  • l

e a n c

  • m

b i n a t i

  • n

s

  • f

c

  • n

s t r a i n t s , – s u b j e c t t

  • n
  • n
  • p
  • l

y n

  • m

i a l a r i t h m e t i c c

  • n

s t r a i n t s .

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 27 / 35

slide-51
SLIDE 51

How iSAT works

[Herde, 2010]

h3 = h1 + h2 ∧ c8 : h2 = −2 · y ∧ c7 : h1 = x2 ∧ c6 : (x ≥ 4 ∨ y ≤ 0 ∨ h3 ≥ 6.2) ∧ c5 : ∧ (b ∨ x ≥ −2) c4 : ∧ (¬c ∨ ¬d) c3 : ∧ (¬a ∨ ¬b ∨ c) c2 : (¬a ∨ ¬c ∨ d) c1 :

rewrite input formula into a conjunction of constraints: ⊲ n-ary disjunctions of bounds ⊲ arithmetic constraints having at most one operation symbol

  • Boolean variables are regarded as 0-1 integer variables.

Allows identification of literals with bounds on Booleans: ≡ b ≥ 1 b ¬b ≡ b ≤ 0

  • Float variables h1, h2, h3 are used for decomposition
  • f complex constraint x2 − 2y ≥ 6.2.
  • Use Tseitin-style (i.e. definitional) transformation to
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 28 / 35

slide-52
SLIDE 52

How iSAT works

[Herde, 2010]

a ≥ 1 h3 = h1 + h2 ∧ c8 : h2 = −2 · y ∧ c7 : h1 = x2 ∧ c6 : (x ≥ 4 ∨ y ≤ 0 ∨ h3 ≥ 6.2) ∧ c5 : ∧ (b ∨ x ≥ −2) c4 : ∧ (¬c ∨ ¬d) c3 : ∧ (¬a ∨ ¬b ∨ c) c2 : (¬a ∨ ¬c ∨ d) c1 : DL 1:

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 28 / 35

slide-53
SLIDE 53

How iSAT works

[Herde, 2010]

c2 c3 c1 a ≥ 1 b ≥ 1 h3 = h1 + h2 ∧ c8 : h2 = −2 · y ∧ c7 : h1 = x2 ∧ c6 : (x ≥ 4 ∨ y ≤ 0 ∨ h3 ≥ 6.2) ∧ c5 : ∧ (b ∨ x ≥ −2) c4 : ∧ (¬c ∨ ¬d) c3 : ∧ (¬a ∨ ¬b ∨ c) c2 : (¬a ∨ ¬c ∨ d) c1 : c ≥ 1 d ≥ 1 d ≤ 0 DL 1: DL 2:

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 28 / 35

slide-54
SLIDE 54

How iSAT works

[Herde, 2010]

c3 c2 c1 b ≥ 1 h3 = h1 + h2 ∧ c8 : h2 = −2 · y ∧ c7 : h1 = x2 ∧ c6 : (x ≥ 4 ∨ y ≤ 0 ∨ h3 ≥ 6.2) ∧ c5 : ∧ (b ∨ x ≥ −2) c4 : ∧ (¬c ∨ ¬d) c3 : ∧ (¬a ∨ ¬b ∨ c) c2 : (¬a ∨ ¬c ∨ d) c1 : ∧ (¬a ∨ ¬c) c9 : d ≥ 1 d ≤ 0 c ≥ 1 a ≥ 1 DL 1: DL 2:

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 28 / 35

slide-55
SLIDE 55

How iSAT works

[Herde, 2010]

c9 c2 c4 a ≥ 1 c ≤ 0 b ≤ 0 x ≥ −2 h3 = h1 + h2 ∧ c8 : h2 = −2 · y ∧ c7 : h1 = x2 ∧ c6 : (x ≥ 4 ∨ y ≤ 0 ∨ h3 ≥ 6.2) ∧ c5 : ∧ (b ∨ x ≥ −2) c4 : ∧ (¬c ∨ ¬d) c3 : ∧ (¬a ∨ ¬b ∨ c) c2 : (¬a ∨ ¬c ∨ d) c1 : ∧ (¬a ∨ ¬c) c9 : DL 1:

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 28 / 35

slide-56
SLIDE 56

How iSAT works

[Herde, 2010]

c9 c2 c4 c7 a ≥ 1 c ≤ 0 b ≤ 0 y ≥ 4 x ≥ −2 h3 = h1 + h2 ∧ c8 : h2 = −2 · y ∧ c7 : h1 = x2 ∧ c6 : (x ≥ 4 ∨ y ≤ 0 ∨ h3 ≥ 6.2) ∧ c5 : ∧ (b ∨ x ≥ −2) c4 : ∧ (¬c ∨ ¬d) c3 : ∧ (¬a ∨ ¬b ∨ c) c2 : (¬a ∨ ¬c ∨ d) c1 : ∧ (¬a ∨ ¬c) c9 : DL 1: DL 2: h2 ≤ −8

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 28 / 35

slide-57
SLIDE 57

How iSAT works

[Herde, 2010]

c9 c2 c4 c7 c8 c6 c5 a ≥ 1 c ≤ 0 b ≤ 0 y ≥ 4 x ≤ 3 h3 ≥ 6.2 h1 ≤ 9 h2 ≥ −2.8 x ≥ −2 h3 = h1 + h2 ∧ c8 : h2 = −2 · y ∧ c7 : h1 = x2 ∧ c6 : (x ≥ 4 ∨ y ≤ 0 ∨ h3 ≥ 6.2) ∧ c5 : ∧ (b ∨ x ≥ −2) c4 : ∧ (¬c ∨ ¬d) c3 : ∧ (¬a ∨ ¬b ∨ c) c2 : (¬a ∨ ¬c ∨ d) c1 : ∧ (¬a ∨ ¬c) c9 : DL 1: DL 2: h2 ≤ −8 DL 3:

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 28 / 35

slide-58
SLIDE 58

How iSAT works

[Herde, 2010]

c9 c2 c4 c7 c8 c6 c5 a ≥ 1 c ≤ 0 b ≤ 0 y ≥ 4 x ≤ 3 h3 ≥ 6.2 h1 ≤ 9 h2 ≥ −2.8 x ≥ −2 ∧ (x < −2 ∨ y < 3 ∨ x > 3) c10 : ∧ (¬a ∨ ¬c) c9 : h3 = h1 + h2 ∧ c8 : h2 = −2 · y ∧ c7 : h1 = x2 ∧ c6 : (x ≥ 4 ∨ y ≤ 0 ∨ h3 ≥ 6.2) ∧ c5 : ∧ (b ∨ x ≥ −2) c4 : ∧ (¬c ∨ ¬d) c3 : ∧ (¬a ∨ ¬b ∨ c) c2 : (¬a ∨ ¬c ∨ d) c1 :

← conflict clause = symbolic description

  • f a rectangular region of the search space

which is excluded from future search

DL 1: DL 2: h2 ≤ −8 DL 3:

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 28 / 35

slide-59
SLIDE 59

How iSAT works

[Herde, 2010]

c9 c2 c4 c7 c6 c10 a ≥ 1 c ≤ 0 b ≤ 0 ∧ (x < −2 ∨ y < 3 ∨ x > 3) c10 : ∧ (¬a ∨ ¬c) c9 : h3 = h1 + h2 ∧ c8 : h2 = −2 · y ∧ c7 : h1 = x2 ∧ c6 : (x ≥ 4 ∨ y ≤ 0 ∨ h3 ≥ 6.2) ∧ c5 : ∧ (b ∨ x ≥ −2) c4 : ∧ (¬c ∨ ¬d) c3 : ∧ (¬a ∨ ¬b ∨ c) c2 : (¬a ∨ ¬c ∨ d) c1 : y ≥ 4 x ≥ −2 x > 3 h2 ≤ −8 h1 > 9 DL 1: DL 2:

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 28 / 35

slide-60
SLIDE 60

How iSAT works

[Herde, 2010]

c9 c2 c4 c7 c6 c10 a ≥ 1 c ≤ 0 b ≤ 0 (x ≥ 4 ∨ y ≤ 0 ∨ h3 ≥ 6.2) ∧ c5 : ∧ (b ∨ x ≥ −2) c4 : ∧ (¬c ∨ ¬d) c3 : ∧ (¬a ∨ ¬b ∨ c) c2 : (¬a ∨ ¬c ∨ d) c1 : y ≥ 4 x ≥ −2 x > 3 h2 ≤ −8 h1 > 9 ∧ (x < −2 ∨ y < 3 ∨ x > 3) c10 : ∧ (¬a ∨ ¬c) c9 : h2 = −2 · y ∧ c7 : h1 = x2 ∧ c6 : h3 = h1 + h2 c8 : ∧ DL 1: DL 2:

  • Continue do split and deduce until either
  • Avoid infinite splitting and deduction:

⊲ discard a deduced bound if it yields small progress only ⊲ solver is left with ‘sufficiently small’ portion of the search space for which it cannot derive any contradiction ⊲ formula turns out to be UNSAT (unresolvable conflict) ⊲ minimal splitting width

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 28 / 35

slide-61
SLIDE 61

Becoming PAC: Iterative Refinement of the Encoding Dealing with the approximation error incurred by importance sampling

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 29 / 35

slide-62
SLIDE 62

Learning from Counterexamples

Generate Check Learn Feasible Infeasible

Parameterizat. PPHA

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 30 / 35

slide-63
SLIDE 63

Learning from Counterexamples

Generate Check Learn Feasible Infeasible

Parameterizat. PPHA Candidate Parameterizat. Substitute Parameterizat. Randomized Sampling iSAT

  • Symb. Imp.−Sampling Formula
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 30 / 35

slide-64
SLIDE 64

Learning from Counterexamples

PPHA Randomized Sampling iSAT Robustness−Check Formula

Generate Check Learn Feasible Infeasible

Parameterizat. PPHA Candidate Parameterizat. Substitute Parameterizat. Randomized Sampling iSAT

  • Symb. Imp.−Sampling Formula
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 30 / 35

slide-65
SLIDE 65

Learning from Counterexamples

  • Symb. Imp.−Sampling Formula

Conjoin PPHA Randomized Sampling iSAT Robustness−Check Formula

Generate Check Learn Feasible Infeasible

Parameterizat. PPHA Candidate Parameterizat. Substitute Parameterizat. Randomized Sampling iSAT

  • Symb. Imp.−Sampling Formula
  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 30 / 35

slide-66
SLIDE 66

Algorithm Properties

Let P be the user-required confidence and let the number N of samples drawn in each round be selected according to the Hoeffding bound (3). Correctness If the algorithm terminates, the following properties hold with confidence ≥ P:

1 If it reports “Feasible” then the parameter instance provided yields

expectations satisfying C.

2 If it reports “Infeasible” then for any parameter instance satisfying φ,

the associated expectations violate C.

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 31 / 35

slide-67
SLIDE 67

Discussion

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 32 / 35

slide-68
SLIDE 68

What we did

Solved a complex design-space exploration problem by (iterative) automated learning of a tractable, PAC formal model.

  • Approach is based on an alternation of sampling, generalization, constraint

generation, SMT solving

5 10 15 20 25 unrolling depth (complexity) 10-5 10-4 10-3 10-2 10-1 100 101 102 relative performance factor

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 33 / 35

slide-69
SLIDE 69

What we did

Solved a complex design-space exploration problem by (iterative) automated learning of a tractable, PAC formal model.

  • Approach is based on an alternation of sampling, generalization, constraint

generation, SMT solving

  • Closed-form representation based on

SMT formulae well exists, but

  • exponentially sized formulae,
  • thus not scalable.

5 10 15 20 25 unrolling depth (complexity) 10-5 10-4 10-3 10-2 10-1 100 101 102 relative performance factor

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 33 / 35

slide-70
SLIDE 70

What we did

Solved a complex design-space exploration problem by (iterative) automated learning of a tractable, PAC formal model.

  • Approach is based on an alternation of sampling, generalization, constraint

generation, SMT solving

  • Closed-form representation based on

SMT formulae well exists, but

  • exponentially sized formulae,
  • thus not scalable.

5 10 15 20 25 unrolling depth (complexity) 10-5 10-4 10-3 10-2 10-1 100 101 102 relative performance factor

  • A prototype implementation of our approach exists

(result of an excellent BSc thesis — thank you, Paul).

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 33 / 35

slide-71
SLIDE 71

The major ingredients

Fitting Parameter Multi−Objective Machine Learning Model Statistical Checking Modulo Theory SAT

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 34 / 35

slide-72
SLIDE 72

The major ingredients

Fitting Parameter Multi−Objective Machine Learning Model Statistical Checking Modulo Theory SAT

Many more such combinations wait to be explored!

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 34 / 35

slide-73
SLIDE 73

Let us go beyond...

  • M. Fränzle

· TCQV, Mysore Park, 2016/02/04 · Constraint-Based Parameter Fitting in PPHA · 35 / 35