CVC4 无法打开 SMT2 格式的文件

CVC4 cannot open file in SMT2 format

我正在尝试使用 CVC4 to perform syntax-guided synthesis on a function. To begin, I am following CVC4 Getting Started,我的 example.smt2 文件如下所示:

(set-logic ALL)
(declare-fun x () Int)
(assert (= (+ x x) (* x 2)))
(check-sat)

当我运行 cvc4 example.smt2在目录下命令行的时候,根据上面链接的教程应该没有问题。但是,我收到此错误:

(error "Couldn't open file: example.smt2")

请注意,此错误与文件不存在不同。比如我在运行cvc4 exampl.doesnotexist时出现如下错误:

CVC4 Error:
Couldn't open file: exampl.doesnotexist

这是不同的。我到处查了一下,但找不到答案。有什么想法吗?

如果您没有文件的读取权限,您将收到此错误消息:

$ cat example.smt2
(set-logic ALL)
(declare-fun x () Int)
(assert (= (+ x x) (* x 2)))
(check-sat)
$ cvc4 example.smt2
sat
$ chmod u-r example.smt2
$ cvc4 example.smt2
(error "Couldn't open file: example.smt2")
$ cat example.smt2
cat: example.smt2: Permission denied
$ chmod u+r example.smt2
$ cat example.smt2
(set-logic ALL)
(declare-fun x () Int)
(assert (= (+ x x) (* x 2)))
(check-sat)
$ cvc4 example.smt2
sat

根据您的操作系统,只需允许读取访问,问题就会消失。