`randc` not legal with `solve`

I cannot figure out why the following code works with rand but not randc.
I’d like to hit all posible states of a before they start repeating in randomization, that is why i want randc.

class myclass;
  rand var byte a,b;
   // randc var byte a,b;  <- does not work
  constraint spec0 {
    a inside {[1:5]};
    b inside {1,-1};
    a == 3 -> b == -1;
    solve a before b;
  }
endclass

module tb;  
  initial begin
    myclass abc = new();
    repeat(10) begin
      assert(abc.randomize());
      $display("[i] rand abc.a = %0d, abc.b = %0d",abc.a,abc.b);
  	end
  end
endmodule

Thank you for the help you can provide.

In case of randc, you need to remove solve.. before
2017 LRM : 18.5.10 Variable ordering “randc variables are not allowed. randc variables are always solved before any other.”

In the latest LRM (1800-2023), this is in section 18.5.9.

Also, your simulator should give you an error message explaining why you can’t use ‘solve…before…’ with randc variables.

As the others have replied, the LRM does not allow a randc variable with a solve before construct–randc enforces a implicit solving order.

It’s also nonsensical to have both a and b be cyclic random variables. Given the constraints you’ve imposed on them, it’s impossible for that to happen.