1

Is there a way to perform a recursive call non-deterministically in a muZ3 relation specification? Specifically, I want to translate a function like the following:

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

to the muZ3 rule format.

duplode
  • 33,731
  • 7
  • 79
  • 150
Hinton
  • 2,320
  • 4
  • 26
  • 32
  • In the process of disambiguating the [fixed-point] tag, I have changed [fixed-point] to [z3-fixedpoint] in this question; however, I'm not familiar enough with Z3 or muZ3 to be fully sure that is appropriate here. Feel free to let me know and/or change it to something else if I got it wrong. – duplode Jul 06 '19 at 23:41

1 Answers1

1

You can have a separate rule for the two cases:

  (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)))
Nikolaj Bjorner
  • 8,229
  • 14
  • 15