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

PrimitiveSize functions should not be generated when termination checking is off? #1519

Open
drganam opened this issue May 6, 2024 · 0 comments

Comments

@drganam
Copy link
Collaborator

drganam commented May 6, 2024

Stainless seems to generate size functions even when they are not needed:

Input:

sealed abstract class Exp
case class Num(param0: BigInt) extends Exp
case class Plus(param0: Exp, param1: Exp) extends Exp
case class Minus(param0: Exp, param1: Exp) extends Exp

def eval(exp: Exp): BigInt = exp match
  case Num(a) => a
  case Plus(a, b) => eval(a) + eval(b)
  case Minus(a, b) => eval(a) - eval(b)

Output trees (when running with --infer-measures=no --check-measures=no):
eval$1, @synthetic ExpPrimitiveSize$0, @synthetic ObjectPrimitiveSize$0, @synthetic BigIntAbs$0

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