Professional Documents
Culture Documents
Mikael Mayer Alex Polozov Rishabh Singh Gustavo Soares Ben Zorn
Reference
3
Deductive Synthesis vs Inductive Synthesis
Deductive Synthesis
• Refers to synthesis using deductive methods.
• Has traditionally been applied to synthesis in the
presence of logical specifications.
Inductive Synthesis
• Refers to synthesis from inductive (example-based)
specifications.
• Various kinds of techniques have been applied including
constraint solving, stochastic, and enumerative search.
Example-based Ordered
Program set of
specification Programs
Ranking
Function Search Algorithm
5
Challenge 2: Efficient search strategy
Key Ideas
• Restrict search to an appropriately designed domain-
specific language (DSL) specified as a grammar.
– Expressive enough to cover wide range of tasks
– Restricted enough to enable efficient search
input string X := x1 | x2 | …
position expression P := …
Boolean expression B := …
“Automating string processing in spreadsheets using input-output examples”;
7
POPL 2011; Gulwani
FlashExtract DSL
•
Seq expr E := Map(N, z: S[z])
| Merge(T1, T2)
∧
10
Problem Reduction
Redmond, WA Redmond, WA
11
Programming by Examples
Example-based
Program
specification
Search Algorithm
Example-based
Program
specification
Search Algorithm
DSL
Challenge 1: Ambiguous/under-specified intent may result
in unintended programs.
Challenge 2: Designing efficient search strategy.
Challenge 3: Lowering the barrier to design & development. 14
Search Strategy
•Goal:
Set of expr of kind that satisfies spec
[denoted ]
: DSL (top-level) expression
example-based inductive specification
15
Output properties
Task
16
Output properties
Task
17
Search Strategy
•Goal:
Set of expr of kind that satisfies spec
[denoted ]
: DSL (top-level) expression
example-based inductive specification
18
Search Strategy
•Goal:
Set of expr of kind that satisfies spec
[denoted ]
: DSL (top-level) expression
example-based inductive specification
20
VSA Operations
•
• Union:
• Intersect:
• Cluster:
– The output is a smallest partitioning of the input VSA s.t. all
programs in any output VSA produce the same output on .
• Filter:
– Filter the input VSA to the subset that satisfies spec
21
Problem Reduction Rules
•
Unio n( [ 𝑒1 ⊨ 𝜙 ] , [ 𝑒2⊨ 𝜙] )
where is a non-terminal defined as
𝐼𝑛𝑡𝑒𝑟𝑠𝑒𝑐𝑡 ( [ 𝑒 ⊨ 𝜙1 ] , [ 𝑒 ⊨𝜙 2 ])
22
Intersect Operation
• Intersect:
The output VSA represents the intersection of the sets of
programs represented by the input VSAs.
𝐿𝑒𝑎𝑓 (~
𝑒 1 ∩~
𝑒2 )
{𝑒 ∈ ~
𝑒∨𝑒 ∈ [ 𝑁 ]}
23
Problem Reduction Rules
•
Unio n( [ 𝑒1 ⊨ 𝜙 ] , [ 𝑒2⊨ 𝜙] )
where is a non-terminal defined as
𝐼𝑛𝑡𝑒𝑟𝑠𝑒𝑐𝑡 ( [ 𝑒 ⊨ 𝜙1 ] , [ 𝑒 ⊨𝜙 2 ])
𝐹𝑖𝑙𝑡𝑒𝑟 ( [ 𝑒 ⊨𝜙1 ] , 𝜙2 )
24
Problem Reduction Rules
•
Unio n( [ 𝑒1 ⊨ 𝜙 ] , [ 𝑒2⊨ 𝜙] )
where is a non-terminal defined as
𝐼𝑛𝑡𝑒𝑟𝑠𝑒𝑐𝑡 ( [ 𝑒 ⊨ 𝜙1 ] , [ 𝑒 ⊨𝜙 2 ])
𝐹𝑖𝑙𝑡𝑒𝑟 ( [ 𝑒 ⊨𝜙1 ] , 𝜙2 )
27
Problem Reduction Rules
•Let F be a binary operator.
Inverse set:
{
𝐶𝑜𝑛𝑐𝑎 𝑡 ( ( Abc
−1
Abc, ϵ))=¿
,¿
,
28
Problem Reduction Rules
•Let F be an n-ary binary operator.
Dependent Inverse Set:
𝑆𝑢𝑏𝑆𝑡 { ( 0,2
𝑟 −1 ( Ab | Ab cd ) ,(6,8)}
Ab ¿= ¿
30
FlashMeta Framework
• Provides efficient implementations of VSA operations
• Provides a library of witness functions
31
Comparison of FlashMeta with hand-tuned implementations
32