Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sequences as a new Suslik data type #42

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

abhishekc-sharma
Copy link

Adding a new IntSequence type to SuSLik.

  • Encoded to SMT using SMT Sequences
  • Some SSL rules were explicitly modified to allow synthesis with operations besides append. (d185b4b)

@ilyasergey
Copy link
Member

I didn't manage to get it past the parser phase:

./suslik src/test/resources/synthesis/sequences/llist/llist_insert_head.syn

resulted in

Synthesis failed:
Failed to parse the input:
[3.29] failure: '`;'' expected but `:' found

|  not (x == y)  => { s == v:s1 ; [x, 2] ** x :-> v ** (x + 1) :-> nxt ** lseg(nxt, y, s1) }

Please, supply the tests for features that work and mark those that don't as separate test files.

@abhishekc-sharma
Copy link
Author

abhishekc-sharma commented Apr 22, 2022

Whoops ! Sorry about that. Seems like some of the earlier test cases weren't updated after a minor syntax change. All the test cases under sequences should now either be marked or work.

@ilyasergey
Copy link
Member

ilyasergey commented Apr 22, 2022

Thanks! Which are the tests (i.e., ScalaTest implementations) covering the examples from the sequences folder? I don't think they are in the suite.

@abhishekc-sharma
Copy link
Author

Do you mean a file under src/test/scala/org/tygus/suslik/synthesis that runs those cases ? I always ended up testing it manually.. Although @aidandenlinger did generate the benchmark data for these sequence cases. Not sure if that required creating a test file in this directory. Either way will add in that file.

@nadia-polikarpova
Copy link
Member

Also, in addition to making a Test file for all the sequence benchmarks, can you please put all the changes you made to BranchAbduction etc under a flag, so that we can still run other benchmarks like before? Thanks!

abhishekc-sharma and others added 10 commits April 26, 2022 20:18
* ported common.def to use sequences, sll-singleton works

* ported dupleton, added README to clarify where these tests come from

* sll-free works without modification

* updated README

* sll-copy works

* sll-append works

* update README and tests that are currently failing
* Binary sequence remove (--) operations that removes the
  first occurance of a particular item.
* Unary length (slen) operation to get the length of a sequence.
* Binary indexing (@) operation to get a one element sequence at a
  particular index.
* Binary indexOf (!!) operation to find the index of the first occurence
  of an item from a seqquence.
* Branch Abduction - use the Integer Constant 0 as a candidate for
  branch conditions.
* Write - prevent writing sequence literals into program variables.
  Currently only Ghost Variables are filtered but not literals.
* SubstExist - prevent substituting variables assigned to expressions
  with sequence operations from being substituted in the post-condition.
  We prefer that these variables are given values using Unification or
  the Pick Exist rule.
* PickExist - consider the Integer Constant -1 and also the expressions
  <var> + 1 and <var> - 1 as candidates when instantiating existentials
  as these are common constants for "inductive" properties.
* src/test/resources/synthesis/sequences/llist/llist_ith.syn - returns a
  pointer to the ith node in a linked list known to have at least i nodes
* src/test/resources/synthesis/sequences/paper-benchmarks/sll/sll-length.syn
  - returns the length of an arbitrary linked list
* src/test/resources/synthesis/sequences/paper-benchmarks/sll/sll-ith.syn -
  the value at the ith node in a linked list known to have sufficient
  nodes
@abhishekc-sharma
Copy link
Author

Sorry for the delayed response. I have added a --sequenceRules flag to enable the various changes made to the rules along with a test suite file that runs the sequence tests. Unfortunately I hadn't run the test suite in a long time and it seems like some of the existing benchmarks break even when the flag is disabled. I am trying to debug and fix these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants