Skip to content

Commit

Permalink
Weakens the synthesize query to match the documented formula (Closes e…
Browse files Browse the repository at this point in the history
  • Loading branch information
emina committed Nov 6, 2021
1 parent 7ac31ff commit dbfd847
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rosette/query/core.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@
; ∃H. (∀I. assumes => asserts) ∧ (∃I. assumes).
(define (cegis inputs assumes asserts guesser checker)

(define φ (append assumes asserts))
(define φ `(,(=> (apply && assumes) (apply && asserts))))

(define ¬φ `(,@assumes ,(apply || (map ! asserts))))
(define (guess sol)
(solver-assert guesser (evaluate φ sol))

(define (guess ψ)
(solver-assert guesser ψ)
(match (solver-check guesser)
[(model m) (sat (for/hash ([(c v) m] #:unless (member c inputs)) (values c v)))]
[other other]))
Expand All @@ -171,14 +171,14 @@
v)))))]
[other other]))

(let loop ([candidate (begin0 (guess (sat)) (solver-clear guesser))])
(let loop ([candidate (guess (append assumes asserts))])
(cond
[(unsat? candidate) candidate]
[else
(let ([cex (check candidate)])
(cond
[(unsat? cex) candidate]
[else (loop (guess cex))]))])))
[else (loop (guess (evaluate φ cex)))]))])))



0 comments on commit dbfd847

Please sign in to comment.