Case statement inside constraint

In reply to dave_59:

Hi Dave,
I will try explaining the situation.
I have two rand bits a and b with widths 3 and 8 respectively.
b value depends on a such that
constraint a_b
{
case(a)
0: b=8;
1: b=7;
2: b=6;
3: b=5;
4: b=4;
5: b=3;
6: b=2;
7: b=1;
8: b=0;
endcase
;
}

I want to implement this. When I try to run, this gave me a Syntax Error.

If using a case inside constraint is possible, can you please correct the error?