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

Proving formulas with no singleton Strings #88

Open
daniel-raffler opened this issue Sep 9, 2024 · 2 comments
Open

Proving formulas with no singleton Strings #88

daniel-raffler opened this issue Sep 9, 2024 · 2 comments

Comments

@daniel-raffler
Copy link

Hello
Ostrich seems to struggle with Formulas that don't contain a singleton String. Here is an example:

import ap.theories.strings.StringTheory
import ap.SimpleAPI
import SimpleAPI.ProverStatus
import ap.parser._
import ap.theories.strings.SeqStringTheory
import ap.util.Debug
import ostrich.{OstrichStringTheory, OFlags}

import org.scalacheck.{Arbitrary, Gen, Properties}
import org.scalacheck.Prop._

object Bug2 extends Properties("Bug2") {
  Debug enableAllAssertions true

  val stringTheory = new OstrichStringTheory(List(), OFlags())
  import stringTheory._
  import IExpression._

  property("lessThan") =
    SimpleAPI.withProver(enableAssert = true) { p =>
      import p._
      val a, b = createConstant(StringSort)
      !!(str_<=(a,b))
      ??? == ProverStatus.Sat
    }
}

When I run the progam Ostrich will throw an exception:

Exception: ap.api.SimpleAPI$SimpleAPIForwardedException: Internal exception: java.lang.Exception:
Cannot handle literal str_<=(c0, c1)

Is this the intended behavior, or am I doing something wrong here?

The program does work just fine when one of the arguments tostr.<= is replaced with a singleton String. Would it be possible to add support for arguments that are not singleton Strings? Or is this just one of the limitations of the algorithm that is being used?

@pruemmer
Copy link
Collaborator

This is a restriction of the current solver architecture. We are in the process of revising and reimplementing the theory solver, and the new version will be able to solve this constraint.

daniel-raffler added a commit to sosy-lab/java-smt that referenced this issue Sep 11, 2024
…-singleton strings as their arguments. Ostrich does not support such operations yet, although the feature will likely be added later. See uuverifiers/ostrich#88 for some details.
@daniel-raffler
Copy link
Author

Hello Philipp,
great to hear that this is already being worked on! I've wrapped up most of the issues we've had with Princess/Ostrich and hope that we can merge sosy-lab/java-smt#257 soon. Once your new version is ready it should be enough to simply update the dependency.

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

No branches or pull requests

2 participants