muZ3:非确定性递归调用

时间:2014-05-23 14:54:53

标签: recursion z3 fixed-point smt non-deterministic

有没有办法在muZ3关系规范中非确定性地执行递归调用?具体来说,我想翻译如下函数:

int foo(int x) {
    ...
    if (*) y = foo(y);
    ...
}

到muZ3规则格式。

1 个答案:

答案 0 :(得分:1)

您可以为这两种情况设置单独的规则:

  (declare-fun foo (Int Int) Bool)

   (assert (forall ((x Int) (y Int) (z Int))  (=> (and ... (foo x y) ...) (foo x z)))

   (assert (forall ((x Int) (y Int) (z Int))  (=> (and ... true ...) (foo x z)))