Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 对于Z3中的所有量词_C_Z3 - Fatal编程技术网

C 对于Z3中的所有量词

C 对于Z3中的所有量词,c,z3,C,Z3,我想在Z3中看到一个C-APIZ3\u mk\u forall\u const()的示例 我正在尝试编码- (define-fun max_integ ((x Int) (y Int)) Int (ite (< x y) y x)) 由于implication是一个整数表达式,因此出现类型错误。所有表达式的参数必须是布尔表达式。我假设你正在尝试创建公式 (forall ((x Int) (y Int)) (= (max_int x y) (ite (< y x) x y

我想在Z3中看到一个C-API
Z3\u mk\u forall\u const()
的示例

我正在尝试编码-

(define-fun max_integ ((x Int) (y Int)) Int 
    (ite (< x y) y x)) 

由于
implication
是一个整数表达式,因此出现类型错误。所有表达式的
参数必须是布尔表达式。我假设你正在尝试创建公式

(forall ((x Int) (y Int)) (= (max_int x y) (ite (< y x) x y)))

可能会有帮助。在quantified子句中,您不能使用正则常量来表示绑定变量,您需要生成绑定变量。请参阅API中的z3_mk_绑定。谢谢您的回答。我以前读过这篇文章,但对我来说有点困惑。我试图在代码中实现它,但没有成功编译代码;yVar=Z3_mk_界(ctx,1,int_排序)但它不起作用。我还检查了2个来源1。Z3 API,用于所有常量和2,两者都说我们可以在绑定参数中使用常量变量。
(forall ((x Int) (y Int)) (= (max_int x y) (ite (< y x) x y)))