Skip to content

Z3 Timing Out #2

@cscaff

Description

@cscaff

Hello!

I've been using this tool for reactive synthesis with TSLMT and it's been great! I had a question though regarding Z3.
I'm working on synthesizing a cops and robber's style game played on a finite grid. We have a cop (system player) that is formally guaranteed to catch a robber (environment player).

The following specification works!

var Int cop_x
var Int cop_y

var Int robber_x
var Int robber_y

SPECIFICATION

assume {
  gte cop_x i0() && lte cop_x i6();
  gte cop_y i0() && lte cop_y i6();

  gte robber_x i0() && gte robber_y i0();
  lte robber_x i6() && lte robber_y i6();
  
}

always guarantee {
  gte cop_x i0() && lte cop_x i6();
  gte cop_y i0() && lte cop_y i6();

  ([cop_x <- cop_x] || [cop_x <- add cop_x i1()] || [cop_x <- sub cop_x i1()]);
  ([cop_y <- cop_y] || [cop_y <- add cop_y i1()] || [cop_y <- sub cop_y i1()]);

  F (eq cop_x robber_x && eq cop_y robber_y);
}

However, when I try to play with adding a third input "Robber_two", I note my Z3 times out and I'm unsure why.

var Int cop_x
var Int cop_y

var Int robber_x
var Int robber_y

var Int robber_two_x
var Int robber_two_y


SPECIFICATION

assume {
  gte cop_x i0() && lte cop_x i5();
  gte cop_y i0() && lte cop_y i5();

  eq robber_x i0() && eq robber_y i0();
  eq robber_two_x i4() && eq robber_two_y i4();
}

always guarantee {
  gte cop_x i0() && lte cop_x i5();
  gte cop_y i0() && lte cop_y i5();

  ([cop_x <- cop_x] || [cop_x <- add cop_x i1()] || [cop_x <- sub cop_x i1()]);
  ([cop_y <- cop_y] || [cop_y <- add cop_y i1()] || [cop_y <- sub cop_y i1()]);

  (F (eq cop_x robber_x && eq cop_y robber_y)) || (F (eq cop_x robber_two_x && eq cop_y robber_two_y));
}

This following spec seems trivial given the first spec. The core difference is we have a third input player (Both players are assumed to be static in this case) and we now guarantee the system player has an option to pursue either static environment player. However, when I run Issy, it looks like I get stuck in Z3.

Is this an issue with Z3 or a subtle error I am misinterpreting? Any help is appreciated. Thanks for the great tool again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions