Skip to content

Integer*real symbolic multiplication gives cryptic error message (unknown) #294

@natebragg

Description

@natebragg

The following program:

#lang rosette

(define-symbolic* x integer?)
(define-symbolic* y real?)

(synthesize
  #:forall (list x y)
  #:guarantee
  (assert (<= 0 (* (* x y) x))))

Gives the following cryptic error:

application: not a procedure;
 expected a procedure that can be applied to arguments
  given: (unknown)
  context...:
   ~/.racket/8.15/pkgs/rosette/rosette/query/eval.rkt:19:0: eval-rec
   .../match/compiler.rkt:559:40: f29
   ~/.racket/8.15/pkgs/rosette/rosette/query/eval.rkt:19:0: eval-rec
   .../match/compiler.rkt:559:40: f29
   ~/.racket/8.15/pkgs/rosette/rosette/query/eval.rkt:19:0: eval-rec
   .../match/compiler.rkt:559:40: f29
   ~/.racket/8.15/pkgs/rosette/rosette/query/eval.rkt:19:0: eval-rec
   .../match/compiler.rkt:559:40: f21
   ~/.racket/8.15/pkgs/rosette/rosette/query/eval.rkt:19:0: eval-rec
   ~/.racket/8.15/pkgs/rosette/rosette/query/core.rkt:151:0: cegis
   ~/.racket/8.15/pkgs/rosette/rosette/query/core.rkt:129:6

Obviously it should just fail to synthesize since that property can't hold forall x,y.

If I tweak the program to include the hole p, and ignore y in the guarantee:

#lang rosette

(define-symbolic* x integer?)
(define-symbolic* y real?)
(define-symbolic* p real?)

(synthesize
  #:forall (list x y)
  #:guarantee
  (assert (<= 0 (* (* x p) x))))

It succeeds with the result (model [p$2 0.0]).

What is this (unknown)? Is this program impossible but with a confusing error message, or is this just a straightforward bug? In the meantime, is there an equivalent program I can write that guarantees an equivalent property? For context, this is a simplified version of a different program I wanted to write, with p and y restricted to fewer values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions