proving unrealizability for
play

Proving Unrealizability for Syntax-Guided Synthesis Qinheping Hu , - PowerPoint PPT Presentation

Proving Unrealizability for Syntax-Guided Synthesis Qinheping Hu , Jason Breck , John Cyphert , Loris D'Antoni , Thomas Reps Proving Unrealizability for Syntax-Guided Synthesis 1 Syntax-Guided Synthesis (SyGuS) Specification


  1. Proving Unrealizability for Syntax-Guided Synthesis Qinheping Hu , Jason Breck , John Cyphert , Loris D'Antoni , Thomas Reps

  2. Proving Unrealizability for Syntax-Guided Synthesis 1

  3. Syntax-Guided Synthesis (SyGuS) Specification πœ’ 𝑛𝑏𝑦(𝑦, 𝑧), 𝑦, 𝑧 : 𝑛𝑏𝑦 𝑦, 𝑧 β‰₯ 𝑦 Solution Program SyGuS ∧ 𝑛𝑏𝑦 𝑦, 𝑧 β‰₯ 𝑧 𝑓 ∈ 𝑀(𝐻) such that Solver ∧ (𝑛𝑏𝑦 𝑦, 𝑧 = 𝑦 ∨ 𝑛𝑏𝑦 𝑦, 𝑧 = 𝑧) βˆ€π‘¦, 𝑧. πœ’ 𝑓, 𝑦, 𝑧 Search space 𝐻 : max 𝑦, 𝑧 = π½π‘ˆπΉ(> (𝑦, 𝑧), 𝑦, 𝑧) Start β†’ +(Start, Start) | π½π‘ˆπΉ(BExpr, Start, Start) 𝑦 𝑧 0 1 BExpr β†’ 𝑂𝑝𝑒(BExpr ) | > (Start, Start) |π΅π‘œπ‘’(BExpr, BExpr)

  4. Syntax-Guided Synthesis (SyGuS) β€’ Goal: find a program 𝑓 ∈ 𝑀(𝐻) such that βˆ€π‘¦, 𝑧. πœ’ 𝑓, 𝑦, 𝑧 β€’ SyGuS-Competition β€’ SyGuS Solvers: CVC4, EUSolver, Euphony, DryadSynth, LoopInvGen, E3Solver, Esolver What if there doesn’t exist 𝑓 ∈ 𝑀(𝐻) such that βˆ€π‘¦, 𝑧. πœ’ 𝑓, 𝑦, 𝑧 (Unrealizable)

  5. 2 Proving Unrealizability for Syntax-Guided Synthesis 1

  6. Example of Unrealizable SyGuS Problems Specification βˆ€π‘¦, 𝑧. max 𝑦, 𝑧 β‰₯ 𝑦 ∧ max 𝑦, 𝑧 β‰₯ 𝑧 ∧ (max 𝑦, 𝑧 = 𝑦 ∨ max 𝑦, 𝑧 = 𝑧) Search space BExpr = 𝑂𝑝𝑒(BExpr ) Start = +(Start, Start) | π½π‘ˆπΉ(BExpr, Start, Start) | > (Start, Start) 𝑦 𝑧 0 1 |π΅π‘œπ‘’(BExpr, BExpr) max 𝑦, 𝑧 = π½π‘ˆπΉ(> (𝑦, 𝑧), 𝑦, 𝑧)

  7. Example of Unrealizable SyGuS Problems Specification βˆ€π‘¦, 𝑧. max 𝑦, 𝑧 β‰₯ 𝑦 ∧ max 𝑦, 𝑧 β‰₯ 𝑧 ∧ (max 𝑦, 𝑧 = 𝑦 ∨ max 𝑦, 𝑧 = 𝑧) Search space Start = +(Start, Start) 𝑦 𝑧 0 1 No Solution

  8. 3 2 Proving Unrealizability for Syntax-Guided Synthesis 1

  9. Ο†: 𝑔 𝑦, 𝑧 β‰₯ 𝑦 ∧ 𝑔 𝑦, 𝑧 β‰₯ 𝑧 ∧ (𝑔 𝑦, 𝑧 = 𝑦 ∨ 𝑔 𝑦, 𝑧 = 𝑧) 𝑇𝑧 ≔ G: Start = +(Start, Start) x 𝑧 0 1 CEGIS 𝑇𝑧 𝐹 Examples E: Synthesizer (x0,y0)=(0,0) Verifier

  10. 𝑇𝑧 𝐹 : ∧ 𝑦,𝑧 ∈𝐹 Ο†(𝑔, 𝑦, 𝑧) 𝑇𝑧 𝐹 Examples E: Synthesizer (x0,y0)=(0,0)

  11. Ο†: 𝑔 𝑦, 𝑧 β‰₯ 𝑦 ∧ 𝑔 𝑦, 𝑧 β‰₯ 𝑧 ∧ (𝑔 𝑦, 𝑧 = 𝑦 ∨ 𝑔 𝑦, 𝑧 = 𝑧) 𝑇𝑧 ≔ G: Start = +(Start, Start) x 𝑧 0 1 CEGIS 𝑇𝑧 𝐹 Examples E: Synthesizer (x0,y0)=(0,0) 𝑔 𝑦, 𝑧 = 0 Verifier new ce (0,1)

  12. Ο†: 𝑔 𝑦, 𝑧 β‰₯ 𝑦 ∧ 𝑔 𝑦, 𝑧 β‰₯ 𝑧 ∧ (𝑔 𝑦, 𝑧 = 𝑦 ∨ 𝑔 𝑦, 𝑧 = 𝑧) 𝑇𝑧 ≔ G: Start = +(Start, Start) x 𝑧 0 1 CEGIS 𝑇𝑧 𝐹 Examples E: Synthesizer (x0,y0)=(0,0) (x1,y1)=(0,1) 𝑔 𝑦, 𝑧 = 𝑧 Verifier new ce (1,0)

  13. Ο†: 𝑔 𝑦, 𝑧 β‰₯ 𝑦 ∧ 𝑔 𝑦, 𝑧 β‰₯ 𝑧 ∧ (𝑔 𝑦, 𝑧 = 𝑦 ∨ 𝑔 𝑦, 𝑧 = 𝑧) 𝑇𝑧 ≔ G: Start = +(Start, Start) x 𝑧 0 1 CEGIS 𝑇𝑧 𝐹 Examples E: Synthesizer (x0,y0)=(0,0) (x1,y1)=(0,1) 𝑔 𝑦, 𝑧 = 1 (x2,y2)=(1,0) Verifier new ce (2,0)

  14. Ο†: 𝑔 𝑦, 𝑧 β‰₯ 𝑦 ∧ 𝑔 𝑦, 𝑧 β‰₯ 𝑧 ∧ (𝑔 𝑦, 𝑧 = 𝑦 ∨ 𝑔 𝑦, 𝑧 = 𝑧) 𝑇𝑧 ≔ G: Start = +(Start, Start) x 𝑧 0 1 CEGIS 𝑇𝑧 𝐹 Examples E: Unrealizable ! Synthesizer (x0,y0)=(0,0) (x1,y1)=(0,1) (x2,y2)=(1,0) (x3,y3)=(2,0) Verifier

  15. 𝑑𝑧 𝐹 𝑑𝑧 is unrealizable is unrealizable No solution over all inputs No solution over 𝐹

  16. From SyGuS over Examples to a Reachability Problem

  17. Reachability Problem Non-deterministic choice void main(){ Reachability solver: int x = 0; CPA-checker while(nd()){ Uautomizer x++; Seahorn … } assert(x<0) } Goal : can the assert be falsified?

  18. Overview SyGuS over examples Reachability problem 𝑑𝑧 𝐹 𝑆𝑓 𝐹 void main(){ (Ο† 𝐹 , 𝐻) … assert (…)} 𝑑𝑧 𝐹 is unrealizable assert cannot be falsified

  19. 𝑇𝑧 𝐹 to 𝑆𝑓 𝐹 Set input to 𝐹 𝑦 ← 𝐹 Τ¦ 𝐻 is non-deterministically drawn from 𝑀(𝐻) 𝑔 𝑝 ← 𝑔 Τ¦ 𝐻 ( Τ¦ 𝑦) Check if Τ¦ 𝑝 doesn’t satisfy Ο† 𝑔 𝐻 ( Τ¦ 𝑦) satisfy Ο† on 𝐹 assert (Β¬ΩΏ 𝑦 𝑗 ∈ 𝐹. Ο†(𝑝 𝑗 , 𝑦 𝑗 )) 𝑇𝑧 𝐹 is unrealizable

  20. Set input to 𝐹 𝑦 ← 𝐹 Τ¦ Examples E: (x0,y0)=(0,0) x0 = 0; (x1,y1)=(0,1) y0 = 0; x1 = 0; y1 = 1;

  21. 𝑇𝑧 𝐹 to 𝑆𝑓 𝐹 Set input to 𝐹 𝑦 ← 𝐹 Τ¦ 𝐻 is non-deterministically drawn from 𝑀(𝐻) 𝑔 𝑝 ← 𝑔 Τ¦ 𝐻 ( Τ¦ 𝑦) Check if Τ¦ 𝑝 doesn’t satisfy Ο† assert (Β¬ΩΏ 𝑦 𝑗 ∈ 𝐹. Ο†(𝑝 𝑗 , 𝑦 𝑗 ))

  22. Check if Τ¦ 𝑝 doesn’t satisfy Ο† assert (Β¬ΩΏ 𝑦 𝑗 ∈ 𝐹. Ο†(𝑝 𝑗 , 𝑦 𝑗 )) void main(){ … assert(!(spec(x0,y0,o0)&&spec(x1,y1,o1))); } bool spec(x,y,o){ return (o>=x)&&(o>=y)&&(o==x||o==y); } Ο† 𝑔 𝑦, 𝑧 ≔ 𝑔 𝑦, 𝑧 β‰₯ 𝑦 ∧ 𝑔 𝑦, 𝑧 β‰₯ 𝑧 ∧ (𝑔 𝑦, 𝑧 = 𝑦 ∨ 𝑔 𝑦, 𝑧 = 𝑧)

  23. 𝑇𝑧 𝐹 to 𝑆𝑓 𝐹 Set input to 𝐹 𝑦 ← 𝐹 Τ¦ 𝐻 is non-deterministically drawn from 𝑀(𝐻) 𝑔 𝑝 ← 𝑔 Τ¦ 𝐻 ( Τ¦ 𝑦) Check if Τ¦ 𝑝 doesn’t satisfy Ο† assert (Β¬ΩΏ 𝑦 𝑗 ∈ 𝐹. Ο†(𝑝 𝑗 , 𝑦 𝑗 ))

  24. 𝐻 is non-deterministically drawn from 𝑀(𝐻) 𝑔 𝑝 ← 𝑔 Τ¦ 𝐻 ( Τ¦ 𝑦) o0 = fStart(x0,y0); int fStart(x0,y0){ \\ Start -> 0 if(nd()){ return 0;} \\ Start -> 1 if(nd()){ return 1;} \\ Start -> x if(nd()){ return x0;} \\ Start -> y if(nd()}{ return y0;} \\ Start -> +(Start,Start) if(nd()){ left = fStart(x0,y0); right = fStart(x0,y0); return left + right;} }

  25. o1=fStart(x1,y1); o1 is 𝑔 𝐻 x1,y1 for some 𝑔 𝐻 in 𝑀 𝐻 o0=fStart(x0,y0); o0 is 𝑔 𝐻 x0,y0 for some 𝑔 𝐻 in 𝑀 𝐻 Can be different

  26. 𝐻 is non-deterministically drawn from 𝑀(𝐻) 𝑔 𝑝 ← 𝑔 Τ¦ 𝐻 ( Τ¦ 𝑦) (o0,o1) = Start(x0,y0); <int,int> fStart(x0,y0,x1,y1){ if(nd()){ return (0,0);} \\ Start -> 0 if(nd()){ return (1,1);} \\ Start -> 1 if(nd()){ return (x0,x1);} \\ Start -> x if(nd()}{ return (y0,y1);} \\ Start -> y if(nd()){ \\ Start -> +(Start,Start) (a0,a1) = Start(x0,y0,x1,y1); (b0,b1) = Start(x0,y0,x1,y1); return (a0+b0,a1+b1);} }

  27. 𝑑𝑧 𝐹 assert cannot be falsified unrealizable 𝑑𝑧 unrealizable

  28. Evaluation

  29. The tool NOPE Nope 𝑆𝑓 𝐹 Unreachable Seahorn Reduction UNREALIZABLE ESolver 𝑇𝑧 𝐹 Example Set 𝑄 𝐹 UNSAT SAT 𝑄 is a solution Veifier Z3 new example e

  30. Application max 𝑦, 𝑧 = π½π‘ˆπΉ(> (𝑦, 𝑧), 𝑦, 𝑧) Optimal ? QSyGUS [cav18] SyGuS QSyGuS Solution Solution Weighted 𝑋 cost 𝐷 1 Cost 1 β‹― Specification 𝜚 𝜚, 𝐻 <𝑑 1 𝜚, 𝐻 𝜚, 𝐻 <1 Minimize 𝑑𝑝𝑑𝑒 π‘π‘—π‘œπ‘—π‘›π‘—π‘¨π‘“ # π½π‘ˆπΉ (πœ’, 𝐻 <1 ) is unrealizable

  31. Benchmarks 132 SyGuS benchmarks 60 SyGuS benchmarks QSyGuS which should be unrealizable

  32. Overall performance of NOPE 132 variants of benchmarks taken from SyGuS Solved 1. bounded number of if-operators 13/57 2. bounded number of plus-operators 1/30 3. restricted range of constants 45/45 59/132

  33. Limitation 1 of NOPE: number of examples

  34. Limitation 2 of NOPE: size of grammars Large sized reachability problem

  35. Open questions: Conclusion 1. reachability problem with large number of functions 2. beyond SyGuS Nope 𝑆𝑓 𝐹 Unreachable Seahorn Reudction UNREALIZABLE ESolver 𝑇𝑧 𝐹 Example Set 𝑄 𝐹 UNSAT SAT 𝑄 is a solution Verifier Z3 new example e

  36. CEGIS may not Terminate πœ’ 𝑔(𝑦), 𝑦 = 𝑔 𝑦 > 𝑦 Start β†’ +(Start, Start) 0 1 𝑔 𝑦 = max E + 1 Example Set 𝐹

  37. Non Single-invocation Specification

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend