+ All Categories
Home > Documents > Abstraction-Based Interaction Model for Synthesishpeleg/formalmodel.pdfSynthesis user โ€ขThe user is...

Abstraction-Based Interaction Model for Synthesishpeleg/formalmodel.pdfSynthesis user โ€ขThe user is...

Date post: 26-Jan-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
66
Abstraction-Based Interaction Model for Synthesis Hila Peleg, Technion Shachar Itzhaky, Technion Sharon Shoham, Tel Aviv University The research leading to these results has received funding from the European Union's - Seventh Framework Programme (FP7) under grant agreement nยฐ 615688 โ€“ ERC- COG-PRIME.
Transcript
  • Abstraction-Based Interaction Model for

    SynthesisHila Peleg, Technion

    Shachar Itzhaky, TechnionSharon Shoham, Tel Aviv University

    The research leading to these results has received funding from the European Union's - Seventh Framework Programme (FP7) under grant agreement nยฐ 615688 โ€“ ERC- COG-PRIME.

  • Programming by Example

    Task: find the most frequent bigram in a string.

    2Lieberman, H. (2000). Programming by example. Communications of the ACM, 43(3), 72-72.

  • Programming by Example

    Task: find the most frequent bigram in a string."abdfibfcfdebdfdebdihgfkjfdebd"

    โ‡“"bd"

    2Lieberman, H. (2000). Programming by example. Communications of the ACM, 43(3), 72-72.

  • Programming by Example

    Task: find the most frequent bigram in a string."abdfibfcfdebdfdebdihgfkjfdebd"

    โ‡“"bd"

    input.takeRight(2)

    2Lieberman, H. (2000). Programming by example. Communications of the ACM, 43(3), 72-72.

  • Programming by Example

    Task: find the most frequent bigram in a string."abdfibfcfdebdfdebdihgfkjfdebd"

    โ‡“"bd"

    input.takeRight(2)

    2Lieberman, H. (2000). Programming by example. Communications of the ACM, 43(3), 72-72.

  • Programming by Example

    Task: find the most frequent bigram in a string."abdfibfcfdebdfdebdihgfkjfdebd"

    โ‡“"bd"

    input.takeRight(2)

    "abbba"

    โ‡“"bb"

    2Lieberman, H. (2000). Programming by example. Communications of the ACM, 43(3), 72-72.

  • Programming by Example

    Task: find the most frequent bigram in a string."abdfibfcfdebdfdebdihgfkjfdebd"

    โ‡“"bd"

    input.takeRight(2)

    "abbba"

    โ‡“"bb"

    2

    input.substring(1,3)

    Lieberman, H. (2000). Programming by example. Communications of the ACM, 43(3), 72-72.

  • Programming Not Only by Example

    Inputโ‡“

    Output

    3Peleg, H., Shoham, S., & Yahav, E. (2017). Programming Not Only by Example. ICSE 2018 (Upcoming).

  • Programming Not Only by Example

    Inputโ‡“

    Output๐‘š โˆˆ ๐‘€ ๐‘š (๐‘–๐‘›๐‘๐‘ข๐‘ก) = ๐‘œ๐‘ข๐‘ก๐‘๐‘ข๐‘ก

    3Peleg, H., Shoham, S., & Yahav, E. (2017). Programming Not Only by Example. ICSE 2018 (Upcoming).

  • Programming Not Only by Example

    Inputโ‡“

    Output๐‘š โˆˆ ๐‘€ ๐‘š (๐‘–๐‘›๐‘๐‘ข๐‘ก) = ๐‘œ๐‘ข๐‘ก๐‘๐‘ข๐‘ก

    input.takeRight(2)

    3Peleg, H., Shoham, S., & Yahav, E. (2017). Programming Not Only by Example. ICSE 2018 (Upcoming).

  • Programming Not Only by Example

    Inputโ‡“

    Output๐‘š โˆˆ ๐‘€ ๐‘š (๐‘–๐‘›๐‘๐‘ข๐‘ก) = ๐‘œ๐‘ข๐‘ก๐‘๐‘ข๐‘ก

    input.takeRight(2)

    Exclude programs with takeRight

    3Peleg, H., Shoham, S., & Yahav, E. (2017). Programming Not Only by Example. ICSE 2018 (Upcoming).

  • Programming Not Only by Example

    Inputโ‡“

    Output๐‘š โˆˆ ๐‘€ ๐‘š (๐‘–๐‘›๐‘๐‘ข๐‘ก) = ๐‘œ๐‘ข๐‘ก๐‘๐‘ข๐‘ก

    input.takeRight(2)

    Exclude programs with takeRight

    ๐‘š โˆˆ ๐‘€ ๐’‘(๐‘š)

    3Peleg, H., Shoham, S., & Yahav, E. (2017). Programming Not Only by Example. ICSE 2018 (Upcoming).

  • Our Goal

    โ€ข To model user-driven synthesisโ€ข Works in practice but we do not understand its

    limitations

    โ€ข Propertiesโ€ข Of the synthesizer

    โ€ข Of the user

    โ€ข Guaranteesโ€ข Termination (in paper)

    โ€ข Are โ€œbad sessionsโ€ recoverable

    4

  • Iterative, interactive synthesis

    ๐‘ผโˆ—

    ๐‘บ๐’Š

    ๐ด๐‘– โˆˆ 2๐’ซ

    ๐‘ž๐‘– โˆˆ ๐‘€

    Partial specificationAvailable predicatesIdeal target set

    Candidate programSearch space

    State

    5

  • Select

    ๐‘บ๐’Š

    ๐‘ž๐‘– โˆˆ ๐‘€

    ?

    6

    โ€ข Candidate program is selected via someselection criterion: ๐‘†๐‘’๐‘™๐‘’๐‘๐‘ก

    โ€ข ๐‘†๐‘’๐‘™๐‘’๐‘๐‘ก usually designed to return a program from ๐‘ˆโˆ— ASAP (in 1-2 iterations)

    โ€ข There is little theoretical work about the long run

  • Predicates

    Programs

    2๐‘€

    2๐’ซ

    ๐›ผ ๐ถ = ๐‘ โˆˆ ๐’ซ โˆ€๐‘š โˆˆ ๐ถ.๐‘š โŠจ ๐‘

    ๐›พ ๐ด = ๐‘š โˆˆ ๐‘€ โˆ€๐‘ โˆˆ ๐ด.๐‘š โŠจ ๐‘

    An abstract domain

    7

  • Predicates

    Programs

    2๐‘€

    2๐’ซ

    ๐›ผ ๐ถ = ๐‘ โˆˆ ๐’ซ โˆ€๐‘š โˆˆ ๐ถ.๐‘š โŠจ ๐‘

    ๐›พ ๐ด = ๐‘š โˆˆ ๐‘€ โˆ€๐‘ โˆˆ ๐ด.๐‘š โŠจ ๐‘

    An abstract domain

    7

    ๐‘†๐‘’๐‘™๐‘’๐‘๐‘ก

  • Predicates

    Programs

    2๐‘€

    2๐’ซ

    ๐›ผ ๐ถ = ๐‘ โˆˆ ๐’ซ โˆ€๐‘š โˆˆ ๐ถ.๐‘š โŠจ ๐‘

    ๐›พ ๐ด = ๐‘š โˆˆ ๐‘€ โˆ€๐‘ โˆˆ ๐ด.๐‘š โŠจ ๐‘

    An abstract domain

    7

    ๐‘†๐‘’๐‘™๐‘’๐‘๐‘ก

  • Synthesis Session

    โ€ข A synthesis session:

    ๐’ฎ = ๐ด0, ๐‘ž1 ๐ด1, ๐‘ž2 โ€ฆ

    โ€ข Synthesizer state: ๐‘†๐‘– = ๐‘†๐‘–โˆ’1 โŠ“ ๐ด๐‘–โ€ข ๐‘ž๐‘– = ๐‘†๐‘’๐‘™๐‘’๐‘๐‘ก ๐‘†๐‘–โˆ’1 , or ๐‘ž๐‘– โˆˆ ๐›พ(๐‘†๐‘–โˆ’1) โˆช {โŠฅ}

    โ€ข If qi โˆˆ ๐‘ˆโˆ— โˆช {โŠฅ}, the session terminates

    Initial specifications

    Candidate program

    User answer

    8

  • Synthesis user

    โ€ข The user is aiming for some ideal set of programs ๐‘ˆโˆ— โŠ† ๐‘ˆ (where ๐‘ˆ is the universe of all programs)

    โ€ข The realizable target set is ๐‘€โˆ— = ๐‘€ โˆฉ ๐‘ˆโˆ—

    โ€ข Correctness: A user step is correct when ๐ด๐‘– โŠ† ๐‘ โˆˆ ๐’ซ โˆฃ โˆƒ๐‘š โˆˆ ๐‘ˆ

    โˆ—. ๐‘š โŠจ ๐‘

    9

  • Synthesis user

    โ€ข The user is aiming for some ideal set of programs ๐‘ˆโˆ— โŠ† ๐‘ˆ (where ๐‘ˆ is the universe of all programs)

    โ€ข The realizable target set is ๐‘€โˆ— = ๐‘€ โˆฉ ๐‘ˆโˆ—

    โ€ข Correctness: A user step is correct when ๐ด๐‘– โŠ† ๐‘ โˆˆ ๐’ซ โˆฃ โˆƒ๐‘š โˆˆ ๐‘ˆ

    โˆ—. ๐‘š โŠจ ๐‘

    9

    (1 until n).fold((x,z)=>x+z)

    sum(range(1,n+1))

    var sum=0

    for(int i = 1; i

  • Synthesis user

    โ€ข The user is aiming for some ideal set of programs ๐‘ˆโˆ— โŠ† ๐‘ˆ (where ๐‘ˆ is the universe of all programs)

    โ€ข The realizable target set is ๐‘€โˆ— = ๐‘€ โˆฉ ๐‘ˆโˆ—

    โ€ข Correctness: A user step is correct when ๐ด๐‘– โŠ† ๐‘ โˆˆ ๐’ซ โˆฃ โˆƒ๐‘š โˆˆ ๐‘ˆ

    โˆ—. ๐‘š โŠจ ๐‘

    9

    (1 until n).fold((x,z)=>x+z)

    sum(range(1,n+1))

    var sum=0

    for(int i = 1; i

  • Synthesis user

    โ€ข The user is aiming for some ideal set of programs ๐‘ˆโˆ— โŠ† ๐‘ˆ (where ๐‘ˆ is the universe of all programs)

    โ€ข The realizable target set is ๐‘€โˆ— = ๐‘€ โˆฉ ๐‘ˆโˆ—

    โ€ข Correctness: A user step is correct when ๐ด๐‘– โŠ† ๐‘ โˆˆ ๐’ซ โˆฃ โˆƒ๐‘š โˆˆ ๐‘ˆ

    โˆ—. ๐‘š โŠจ ๐‘

    9

    (1 until n).fold((x,z)=>x+z)

    sum(range(1,n+1))

    var sum=0

    for(int i = 1; i

  • Synthesis user

    โ€ข The user is aiming for some ideal set of programs ๐‘ˆโˆ— โŠ† ๐‘ˆ (where ๐‘ˆ is the universe of all programs)

    โ€ข The realizable target set is ๐‘€โˆ— = ๐‘€ โˆฉ ๐‘ˆโˆ—

    โ€ข Correctness: A user step is correct when ๐ด๐‘– โŠ† ๐‘ โˆˆ ๐’ซ โˆฃ โˆƒ๐‘š โˆˆ ๐‘ˆ

    โˆ—. ๐‘š โŠจ ๐‘

    9

    (1 until n).fold((x,z)=>x+z)

    sum(range(1,n+1))

    var sum=0

    for(int i = 1; i

  • Synthesis user

    โ€ข The user is aiming for some ideal set of programs ๐‘ˆโˆ— โŠ† ๐‘ˆ (where ๐‘ˆ is the universe of all programs)

    โ€ข The realizable target set is ๐‘€โˆ— = ๐‘€ โˆฉ ๐‘ˆโˆ—

    โ€ข Correctness: A user step is correct when ๐ด๐‘– โŠ† ๐‘ โˆˆ ๐’ซ โˆฃ โˆƒ๐‘š โˆˆ ๐‘ˆ

    โˆ—. ๐‘š โŠจ ๐‘

    9

    (1 until n).fold((x,z)=>x+z)

    sum(range(1,n+1))

    var sum=0

    for(int i = 1; i x+z) + 1

  • Synthesis user

    โ€ข The user is aiming for some ideal set of programs ๐‘ˆโˆ— โŠ† ๐‘ˆ (where ๐‘ˆ is the universe of all programs)

    โ€ข The realizable target set is ๐‘€โˆ— = ๐‘€ โˆฉ ๐‘ˆโˆ—

    โ€ข Correctness: A user step is correct when ๐ด๐‘– โŠ† ๐‘ โˆˆ ๐’ซ โˆฃ โˆƒ๐‘š โˆˆ ๐‘ˆ

    โˆ—. ๐‘š โŠจ ๐‘

    9

    (1 until n).fold((x,z)=>x+z)

    sum(range(1,n+1))

    var sum=0

    for(int i = 1; i x+z) + 1

  • User guarantees

    โ€ข In a synthesis session:1. The user is correct for as long as possible.

    When not possible, ๐ด๐‘– =โŠฅ

    2. The user will always accept a program from ๐‘€โˆ—

    10

  • Progress

    โ€ข Adding new predicate doesnโ€™t guarantee that the session is progressing

    โ€ข ๐‘†๐‘›โˆ’1 โŠ ๐‘†๐‘› could still mean that ๐›พ ๐‘†๐‘› = ๐›พ(๐‘†๐‘›โˆ’1)

    โ€ข Synthesizers usually donโ€™t check

    11

    ๐‘ดโˆ—

    ๐œธ(๐‘บ๐ŸŽ)๐œธ(๐‘บ๐Ÿ)๐‘†1

    ๐‘†0

    ๐‘†2

  • Easiest way to make progress

    12

    ๐‘š

    ๐ด๐‘– s.t. โˆƒ๐‘ โˆˆ ๐ด๐‘– . ๐‘š โŠญ ๐‘

  • Easiest way to make progress

    12

    ๐‘š

    ๐ด๐‘– s.t. โˆƒ๐‘ โˆˆ ๐ด๐‘– . ๐‘š โŠญ ๐‘

    โ€ข In other words: something thatโ€™s wrong with the current program

    โ€ข Rule out at least the current program

  • Easiest way to make progress

    12

    ๐‘š

    ๐ด๐‘– s.t. โˆƒ๐‘ โˆˆ ๐ด๐‘– . ๐‘š โŠญ ๐‘

    โ€ข In other words: something thatโ€™s wrong with the current program

    โ€ข Rule out at least the current programโ€ข Important when ๐‘ž๐‘– โˆˆ ๐›พ(๐‘†๐‘–+1) โ‡’ ๐‘†๐‘’๐‘™๐‘’๐‘๐‘ก ๐‘†๐‘–+1 = ๐‘ž๐‘–โ€ข Easy to check, but too strong

  • A Different Model of Progress

    โ€ข ๐ด๐‘– makes weak progress if ๐›พ ๐‘†๐‘›โˆ’1 โŠ“ ๐ด๐‘– = ๐›พ ๐‘†๐‘› โŠŠ ๐›พ ๐‘†๐‘›โˆ’1

    โ€ข We can provide positive reinforcement

    13

  • A Different Model of Progress

    โ€ข ๐ด๐‘– makes weak progress if ๐›พ ๐‘†๐‘›โˆ’1 โŠ“ ๐ด๐‘– = ๐›พ ๐‘†๐‘› โŠŠ ๐›พ ๐‘†๐‘›โˆ’1

    โ€ข We can provide positive reinforcement

    13

    (1 to n).fold((x,z)=>x+z) + 1

  • A Different Model of Progress

    โ€ข ๐ด๐‘– makes weak progress if ๐›พ ๐‘†๐‘›โˆ’1 โŠ“ ๐ด๐‘– = ๐›พ ๐‘†๐‘› โŠŠ ๐›พ ๐‘†๐‘›โˆ’1

    โ€ข We can provide positive reinforcement

    13

    (1 to n).fold((x,z)=>x+z) + 1

  • A Different Model of Progress

    โ€ข ๐ด๐‘– makes weak progress if ๐›พ ๐‘†๐‘›โˆ’1 โŠ“ ๐ด๐‘– = ๐›พ ๐‘†๐‘› โŠŠ ๐›พ ๐‘†๐‘›โˆ’1

    โ€ข We can provide positive reinforcement

    โ€ข Harder to check: ๐‘†๐‘– โ‡ ๐ด๐‘–โ€ข Once we know there is progress, we know

    some things about termination (see paper)

    13

    (1 to n).fold((x,z)=>x+z) + 1

  • Convergence

    โ€ข A session converges if ๐›พ(๐‘†๐‘›) โŠ† ๐‘€โˆ—

    โ€ข User correctness means the session ends at state ๐‘›

    โ€ข Converges successfully: โˆ… โ‰  ๐›พ ๐‘†๐‘› โŠ† ๐‘€โˆ—

    14

    ๐‘ดโˆ—

    ๐œธ(๐‘บ๐’)

  • Core set

    โ€ข Core set: the set of finiteunderapproximations of ๐‘€โˆ—

    โ„ฌ = ๐ต โŠ† ๐’ซ0 โ‰  ๐›พ ๐ต โŠ† ๐‘€โˆ—

    โˆง ๐ต โˆˆ โ„•

    ๐‘ผโˆ—

    ๐‘ดโˆ—

    15

  • Core set

    โ€ข Core set: the set of finiteunderapproximations of ๐‘€โˆ—

    โ„ฌ = ๐ต โŠ† ๐’ซ0 โ‰  ๐›พ ๐ต โŠ† ๐‘€โˆ—

    โˆง ๐ต โˆˆ โ„•

    ๐‘ผโˆ—

    ๐‘ดโˆ—

    ๐‘ฉ๐Ÿ๐‘ฉ๐Ÿ

    ๐‘ฉ๐Ÿ‘

    15

  • Core set

    ๐‘ผโˆ—

    ๐‘ดโˆ—

    ๐‘ฉ๐Ÿ๐‘ฉ๐Ÿ

    ๐‘ฉ๐Ÿ‘

    15

    โ€ข Core set: the set of finiteunderapproximations of ๐‘€โˆ—

    โ„ฌ = ๐ต โŠ† ๐’ซ0 โ‰  ๐›พ ๐ต โŠ† ๐‘€โˆ—

    โˆง ๐ต โˆˆ โ„•

    โ€ข User intention is realizable if ๐‘€โˆ— โ‰  โˆ…

    โ€ข ๐“Ÿ-realizability: can converge under ๐’ซ

  • Core set

    ๐‘ผโˆ—

    ๐‘ดโˆ—

    ๐‘ฉ๐Ÿ๐‘ฉ๐Ÿ

    ๐‘ฉ๐Ÿ‘๐‘€โˆ— is ๐’ซ-realizable if โ„ฌ โ‰  โˆ…

    15

    โ€ข Core set: the set of finiteunderapproximations of ๐‘€โˆ—

    โ„ฌ = ๐ต โŠ† ๐’ซ0 โ‰  ๐›พ ๐ต โŠ† ๐‘€โˆ—

    โˆง ๐ต โˆˆ โ„•

    โ€ข User intention is realizable if ๐‘€โˆ— โ‰  โˆ…

    โ€ข ๐“Ÿ-realizability: can converge under ๐’ซ

  • Infeasible point

    โ€ข A state where ๐›พ ๐‘†๐‘– โˆฉ๐‘€

    โˆ— = โˆ…

    โ€ข ๐‘†๐‘’๐‘™๐‘’๐‘๐‘ก canโ€™t succeed, even in best case

    โ€ข The First Infeasible Pointis the first point of failure

    โ€ข Can we backtrack before an infeasible point?

    16

    ๐‘ดโˆ—

    ๐‘ฉ๐Ÿ๐‘ฉ๐Ÿ

    ๐‘ฉ๐Ÿ‘

    ๐‘บ๐’Š

  • Point of inevitable failureโ€ข State ๐‘†๐‘– is an POIF if โˆ€๐ต โˆˆ โ„ฌ. ๐›พ ๐‘†๐‘– โˆฉ ๐›พ ๐ต = โˆ…

    โ€ข Specifically, ๐‘†๐‘– is an POIF if ๐›พ ๐‘†๐‘– โˆฉ๐‘€

    โˆ— = โˆ…๐‘ดโˆ—

    ๐‘ฉ๐Ÿ๐‘ฉ๐Ÿ

    ๐‘ฉ๐Ÿ‘

    ๐‘บ๐ŸŽ๐‘บ๐Ÿ

    ๐‘บ๐Ÿ

    17

  • Point of inevitable failureโ€ข State ๐‘†๐‘– is an POIF if โˆ€๐ต โˆˆ โ„ฌ. ๐›พ ๐‘†๐‘– โˆฉ ๐›พ ๐ต = โˆ…

    โ€ข Specifically, ๐‘†๐‘– is an POIF if ๐›พ ๐‘†๐‘– โˆฉ๐‘€

    โˆ— = โˆ…

    โ€ข But not necessarily ๐‘ดโˆ—

    ๐‘ฉ๐Ÿ๐‘ฉ๐Ÿ

    ๐‘ฉ๐Ÿ‘

    ๐‘บ๐ŸŽ๐‘บ๐Ÿ

    ๐‘บ๐Ÿ

    17

    ๐‘บ๐’Š

  • Point of inevitable failure

    ๐‘ดโˆ—

    ๐‘ฉ๐Ÿ๐‘ฉ๐Ÿ

    ๐‘ฉ๐Ÿ‘

    ๐‘บ๐ŸŽ๐‘บ๐Ÿ

    ๐‘บ๐Ÿ

    ๐‘บ๐’Š

    17

    โ€ข State ๐‘†๐‘– is an POIF if โˆ€๐ต โˆˆ โ„ฌ. ๐›พ ๐‘†๐‘– โˆฉ ๐›พ ๐ต = โˆ…

    โ€ข Specifically, ๐‘†๐‘– is an POIF if ๐›พ ๐‘†๐‘– โˆฉ๐‘€

    โˆ— = โˆ…

    โ€ข But not necessarily

    โ€ข As long as ๐‘†๐‘– is not an POIF we can still converge

    โ€ข Can we backtrack before an inevitable point of failure?

  • Backtracking from failure

    Theorem: for any ๐‘˜ โˆˆ โ„• there exists a session ๐’ฎ where state ๐‘†๐‘– is an point of inevitable failure and only state ๐‘†๐‘˜+๐‘– is the first infeasible point.

    18

  • Backtracking from failure

    Essentially: there is no bound on the number of steps to backtrack once failure is apparent.

    Proof: by construction

    Theorem: for any ๐‘˜ โˆˆ โ„• there exists a session ๐’ฎ where state ๐‘†๐‘– is an point of inevitable failure and only state ๐‘†๐‘˜+๐‘– is the first infeasible point.

    18

  • An unbounded session

    19

    Point of inevitable failure

    1st infeasible point

    Of length any ๐‘˜ โˆˆ โ„•

    ๐›พ ๐‘†๐‘– โˆฉ๐‘€โˆ— = โˆ…

    โˆ€๐ต โˆˆ โ„ฌ. ๐›พ ๐ต โˆฉ ๐›พ(๐‘†๐‘–) = โˆ…

  • Construction

    โ€ข Candidate program space ๐‘€ is spanned by:โ€ข if-elseโ€ข ==โ€ข lists of ints ([],[1,2], etc.)โ€ข recursive call fโ€ข the input variable iโ€ข consโ€ข maxโ€ข removeโ€ข sortโ€ข reverse

    20

  • Construction

    โ€ข Candidate program space ๐‘€ is spanned by:โ€ข if-elseโ€ข ==โ€ข lists of ints ([],[1,2], etc.)โ€ข recursive call fโ€ข the input variable iโ€ข consโ€ข maxโ€ข removeโ€ข sortโ€ข reverse

    Example candidate:if (i==[]) []

    else cons(max(i),

    f(remove(i,max(i))

    20

  • Construction

    โ€ข Candidate program space ๐‘€ is spanned by:โ€ข if-elseโ€ข ==โ€ข lists of ints ([],[1,2], etc.)โ€ข recursive call fโ€ข the input variable iโ€ข consโ€ข maxโ€ข removeโ€ข sortโ€ข reverse

    Example candidate:if (i==[]) []

    else cons(max(i),

    f(remove(i,max(i))

    20

    Example candidate:reverse(sort(i))

  • Construction

    โ€ข Candidate program space ๐‘€ is spanned by:โ€ข if-elseโ€ข ==โ€ข lists of ints ([],[1,2], etc.)โ€ข recursive call fโ€ข the input variable iโ€ข consโ€ข maxโ€ข removeโ€ข sortโ€ข reverse

    Example candidate:if (i==[]) []

    else cons(max(i),

    f(remove(i,max(i))

    20

    Example candidate:reverse(sort(i))

    โ€ข Available predicates in ๐’ซ:โ€ข Input-output examples

    โ€ข ๐‘’๐‘ฅ๐‘๐‘™๐‘ข๐‘‘๐‘’(๐‘’), for any program element e

  • Construction

    Task: sort a list in descending order.

    21

  • Construction

    Input: [], Output: []Input: [1,2], Output: [2,1]

    Task: sort a list in descending order.

    21

  • Construction

    Input: [], Output: []Input: [1,2], Output: [2,1]

    reverse(i)

    Task: sort a list in descending order.

    21

  • Construction

    Input: [], Output: []Input: [1,2], Output: [2,1]

    reverse(i)

    Task: sort a list in descending order.

    exclude(reverse)

    21

  • Construction

    Input: [], Output: []Input: [1,2], Output: [2,1]

    reverse(i)

    Task: sort a list in descending order.

    exclude(reverse) Point of Inevitable Failure

    21

  • Construction

    Input: [], Output: []Input: [1,2], Output: [2,1]

    reverse(i)

    Task: sort a list in descending order.

    exclude(reverse)

    if (i==[1,2])[2,1]

    else i

    Point of Inevitable Failure

    21

  • Construction

    if (i==[1,2])[2,1]

    else i

    22

  • Construction

    Input: [1,3], Output: [3,1]

    if (i==[1,2])[2,1]

    else i

    22

  • Construction

    Input: [1,3], Output: [3,1]

    if (i==[1,2]) [2,1]

    else if (i==[1,3]) [3,1]

    else i

    if (i==[1,2])[2,1]

    else i

    22

  • Construction

    Input: [1,3], Output: [3,1]

    if (i==[1,2]) [2,1]

    else if (i==[1,3]) [3,1]

    else i

    if (i==[1,2])[2,1]

    else i

    โ‹ฎ

    22

  • Construction

    Input: [1,3], Output: [3,1]

    if (i==[1,2]) [2,1]

    else if (i==[1,3]) [3,1]

    else i

    if (i==[1,2])[2,1]

    else i

    โ‹ฎ

    22

    Example candidate:if (i==[]) []

    else cons(max(i),

    f(remove(i,max(i))

  • Construction

    Input: [1,3], Output: [3,1]

    if (i==[1,2]) [2,1]

    else if (i==[1,3]) [3,1]

    else i

    if (i==[1,2])[2,1]

    else i

    โ‹ฎ

    22

  • Construction

    Input: [1,3], Output: [3,1]

    if (i==[1,2]) [2,1]

    else if (i==[1,3]) [3,1]

    else i

    exclude(==)

    if (i==[1,2])[2,1]

    else i

    โ‹ฎ

    22

  • Construction

    Input: [1,3], Output: [3,1]

    if (i==[1,2]) [2,1]

    else if (i==[1,3]) [3,1]

    else i

    exclude(==)

    โŠฅ

    if (i==[1,2])[2,1]

    else i

    โ‹ฎ

    22

  • Conclusion

    โ€ข An iterative, interactive model of synthesis

    โ€ข An abstract domain of predicates

    โ€ข Progress

    โ€ข Convergence

    โ€ข The unboundedness of backtracking

    โ€ข We hope these results help future synthesizer designers

    23


Recommended