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

RDL check is a bit too lenient #212

Open
Gbury opened this issue Apr 26, 2024 · 1 comment
Open

RDL check is a bit too lenient #212

Gbury opened this issue Apr 26, 2024 · 1 comment
Labels
bug spec for differences between files in a benchmark and their specification

Comments

@Gbury
Copy link
Owner

Gbury commented Apr 26, 2024

The check for real difference logic in the type-checker is currently slightly too lenient. Consider for instance the following problem:

(set-logic QF_RDL)
(declare-const a Real)
(assert (distinct (+ a a) 0))
(check-sat)
(exit)

This is currently accepted by dolmen although the specification states that only the following are allowed:

"Closed quantifier-free formulas with atoms of the form:

  • p
  • (op (- x y) c),
  • (op x y),
  • (op (- (+ x ... x) (+ y ... y)) c) with n > 1 occurrences of x and of y,
    where
    • p is a variable or free constant symbol of sort Bool,
    • c is an expression of the form m or (- m) for some numeral m,
    • op is <, <=, >, >=, =, or distinct,
    • x, y are free constant symbols of sort Real.
      "

The term (distinct (+ a a) 0) does not conform to any of the allowed forms.

This is quite annoying since it effectively breaks the locality (and independance) of checking the invariants of real difference logic: to enforce the spec, one would have to either:

  • when typing the addition, know the context in which the typechecked term appears (i.e. what is "above" the term being typechecked), or
  • make it so that the typing of distinct has to know the arithmetic restriction currently in place (i.e. whether we are in difference logic or not).
@Gbury Gbury added the bug label Apr 26, 2024
@Gbury
Copy link
Owner Author

Gbury commented Apr 26, 2024

Idea for a fix for future me: shadow the typing of the distinct builtin in the arith module of the typechecker, and document that the order of applications of the typing extensions is important (i.e. arith needs to go before core/base, at least for smtlib).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug spec for differences between files in a benchmark and their specification
Projects
None yet
Development

No branches or pull requests

1 participant