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

str.<= is not reflexiv #89

Closed
daniel-raffler opened this issue Sep 9, 2024 · 1 comment
Closed

str.<= is not reflexiv #89

daniel-raffler opened this issue Sep 9, 2024 · 1 comment

Comments

@daniel-raffler
Copy link

Hello,
str.<= in Ostrich does not work quite as I expected. Here is an example program:

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 Bug3 extends Properties("Bug3") {
  Debug enableAllAssertions true

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

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

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

When I run the tests, lessThan passes, but lessOrEqual fails. I was expecting them both to pass as str.<= is reflexiv in the SMT-LIB standard.

Is this an intentional change or am I just doing something wrong here?

@daniel-raffler
Copy link
Author

Thanks! This seems to have fixed it

daniel-raffler added a commit to sosy-lab/java-smt that referenced this issue Sep 12, 2024
…n was not reflexive and returned `false` if both arguments are the same. This has reported in uuverifiers/ostrich#89 and is now fixed
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

1 participant