SRI-CSL / yices2

The Yices SMT Solver
https://yices.csl.sri.com/
GNU General Public License v3.0
368 stars 46 forks source link

Is there any C API for me to extract value of a function? #407

Closed MrWater98 closed 2 years ago

MrWater98 commented 2 years ago

I wrote a Yices SMT code with following expressions.

(define f1::(-> (bitvector 2) (bitvector 2)))
(define t::(bitvector 2))
(assert (= t 0b00))
(assert (= f1 (update f1 (t) 0b01)))
(assert (= f1 (update f1 (0b01) 0b11)))
(assert (bv-gt (f1 t) 0b00)) 
(check)
;(↑sat)

However, when I tried to convert above expression into C language code, I cannot find a method to expresses (f1 t). I would like to ask if there is any C API function to extract a value as term of my function.(assert (bv-gt (f1 t) 0b00))

BrunoDutertre commented 2 years ago

You can construct (f1 t) using either yices_application or yices_application1. See https://yices.csl.sri.com/doc/term-operations.html#general-constructors.

MrWater98 commented 2 years ago

Solved, great thanks. :blush: