Efficient Synthesis with Probabilistic Constraints Samuel Drews, - - PowerPoint PPT Presentation

efficient synthesis with probabilistic constraints
SMART_READER_LITE
LIVE PREVIEW

Efficient Synthesis with Probabilistic Constraints Samuel Drews, - - PowerPoint PPT Presentation

Efficient Synthesis with Probabilistic Constraints Samuel Drews, Aws Albarghouthi, Loris DAntoni Probabilistic Correctness Properties x ~ Uniform([0, 1]) post := Pr[ P ( x ) = 1] > 0 1 P ( x ) := 0 x 0.2 ] 0 0.2 1 P (


slide-1
SLIDE 1

Efficient Synthesis with Probabilistic Constraints

Samuel Drews, Aws Albarghouthi, Loris D’Antoni

slide-2
SLIDE 2

Probabilistic Correctness Properties

P(x) := 0 ≤ x ≤ 0.2 P(x) := 0 ≤ x ≤ 0.8

1 ] 0.2 1 ] 0.8

x ~ Uniform([0, 1])

1

post := Pr[P(x) = 1] > ⅓

✗ ✓

slide-3
SLIDE 3

Probabilistic Program Synthesis

Progs post Q P

Pr[Q(x) ≠ P(x)]

1 ⅓

Values of a: Decreasing “Error” Pr[Q(x) ≠ P(x)] Satisfy post Progs = {P(x) := 0 ≤ x ≤ a | a ∈ R} inputs ~ Uniform([0, 1]) post := Pr[P(x) = 1] > ⅓ Q(x) := constant-0 function

slide-4
SLIDE 4

DIGITS (CAV17)

Sample Set S {0.4, 0.6} Program Correct? Error [0, 0.3] ✗ 0.3 1 unsat

  • 1

[0, 0.5] ✓ 0.5 1 1 [0, 1] ✓ 1.0 Constraints f : S→{0,1} For each f : S → {0,1}, query a synthesis oracle Oracles compute post and Error Sample m inputs Progs = {P(x) := 0 ≤ x ≤ a | a ∈ R} inputs ~ Uniform([0, 1]) post := Pr[P(x) = 1] > ⅓ Q(x) := constant-0 function

slide-5
SLIDE 5

Progs post

DIGITS Convergence (CAV17)

Theorem (Convergence of DIGITS) (Under certain assumptions,) with high probability, DIGITS enumerates some correct, (near-)near-optimal program P.

𝜁 P Q P*

Pr[Q(x) ≠ P*(x)]

slide-6
SLIDE 6

Which Begs the Questions:

Do we really need to make exponentially many queries? How high is the “high probability” of optimal convergence? No! Depends on the number of samples.

slide-7
SLIDE 7

DIGITS Trie Implementation (CAV17)

unsat

Sample Set S {0.4, 0.6} Program Correct? Error [0, 0.3] ✗ 0.3 1 unsat

  • 1

[0, 0.5] ✓ 0.5 1 1 [0, 1] ✓ 1.0 Constraints f : S→{0,1}

slide-8
SLIDE 8

Efficiency of the Trie “Heuristic”

5050 <<< 2100 Polynomial Trendline: f(x) = ½ x2 + ½ x R2 = 1

slide-9
SLIDE 9

Polynomial?

Two equivalent ways of thinking:

  • The trie avoids unsatisfiable parts of the search space
  • The trie stays close to satisfiable parts of the search space

# Queries @ next depth = O(# Satisfiable @ current depth)

slide-10
SLIDE 10

For [0, a] intervals and m points, # Satisfiable Queries (m) = m + 1

1

3 samples

] ] ] ]

4 choices of right endpoint [0, a] Search Trie, depth m: O(m+1) m O(m2)

slide-11
SLIDE 11

Progs post

Finite VC Dimension → Polynomial Bound

slide-12
SLIDE 12

Progs post

Finite VC Dimension → Polynomial Bound

slide-13
SLIDE 13

Progs post

Finite VC Dimension → Polynomial Bound

slide-14
SLIDE 14

Progs post

Finite VC Dimension → Polynomial Bound

unsat

slide-15
SLIDE 15

Progs post

Finite VC Dimension → Polynomial Bound

unsat unsat unsat

slide-16
SLIDE 16

Progs post

Finite VC Dimension → Polynomial Bound

unsat unsat unsat

“Sauer-Shelah Lemma”: Only O(md) are satisfiable!

slide-17
SLIDE 17

Finite VC Dimension → Polynomial Bound

Theorem: If DIGITS runs on Progs using m samples, it performs O(md+1) synthesis queries. Progs Search Trie, |S| = m: O(md) m O(md+1)

slide-18
SLIDE 18

Which Begs the Questions:

Do we really need to make exponentially many queries? How high is the “high probability” of optimal convergence? No!---In fact, we only make O(md+1) Depends on the number of samples.

slide-19
SLIDE 19

𝜐-DIGITS

Use the constraint set to estimate the error Pr[Q(x) ≠ P(x)]: Fix threshold 𝜐 ∈ (0,1] and skip any f : S → {0,1} such that |{x ∈ S : Q(x) ≠ f(x)}| > 𝜐|S|

𝜐 Q P4 P2 P3 Progs post Q P4 P2 P3 P1 Progs post

slide-20
SLIDE 20

Progs post Q

Choosing 𝜐

𝜐 Progs post Q 𝜐

slide-21
SLIDE 21

Progs post Q

Adaptive 𝜐-DIGITS

slide-22
SLIDE 22

Progs post Q

Adaptive 𝜐-DIGITS

P1

slide-23
SLIDE 23

𝜐 Progs post Q

Adaptive 𝜐-DIGITS

P1

slide-24
SLIDE 24

𝜐 Progs post Q

Adaptive 𝜐-DIGITS

P1 P2

slide-25
SLIDE 25

𝜐 Progs post Q

Adaptive 𝜐-DIGITS

P1 P2

slide-26
SLIDE 26

Adaptive 𝜐-DIGITS Efficacy (Fairness Benchmarks)

slide-27
SLIDE 27

Which Begs the Questions:

Do we really need to make exponentially many queries? How high is the “high probability” of optimal convergence? No!---in fact, we only make O(md+1) Depends on the number of samples.

  • --and we can do better with 𝜐-DIGITS
slide-28
SLIDE 28

Thanks!

Progs Search Trie, |S| = m: O(md) m O(md+1)

𝜐 Q P4 P2 P3 Progs post Q P4 P2 P3 P1 Progs post