Group nine unparenthesised sequences and properties the way the standard's precedence table does.
Hardware context: Unparenthesised assertion expressions from a checker library. Group sequence and property operators the way the precedence table does.
Each question is an expression with no parentheses, and two ways to group it. Write answer(q) so it returns the option the standard uses: 0 or 1.
Questions 0 to 2 are worked examples on sequence operators. Questions 3 to 8 mix property operators and are graded only by the full check.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 4 | input of each check |
Full specification
| q | Expression | Option 0 | Option 1 | Kind |
|---|---|---|---|---|
| 0 | a ##1 b[*2] | a ##1 (b[*2]) | (a ##1 b)[*2] | worked example |
| 1 | a throughout b ##1 c | a throughout (b ##1 c) | (a throughout b) ##1 c | worked example |
| 2 | x within y intersect z | x within (y intersect z) | (x within y) intersect z | worked example |
| 3 | not a and b | (not a) and b | not (a and b) | graded |
| 4 | a |-> b or c | (a |-> b) or c | a |-> (b or c) | graded |
| 5 | a until b implies c | (a until b) implies c | a until (b implies c) | graded |
| 6 | p and q or r | (p and q) or r | p and (q or r) | graded |
| 7 | x |-> y |=> z | (x |-> y) |=> z | x |-> (y |=> z) | graded |
| 8 | p iff q until r | (p iff q) until r | p iff (q until r) | graded |
Use IEEE 1800-2023 Table 16-3: operators higher in the table bind tighter; within one row, the associativity decides.
Examples
Example 1
Repetition Before Delay- Input
answer(0)
- Output
option = 0
Repetition binds tightest, so [*2] applies to b alone: option 0.
Example 2
Delay Before Throughout- Input
answer(1)
- Output
option = 0
## binds tighter than throughout, so a must hold through the whole b ##1 c: option 0.
Example 3
Within Before Intersect- Input
answer(2)
- Output
option = 1
within binds tighter than intersect: option 1.
Constraints and Contract
- Return 0 or 1 for each question from answer(q).
- Keep the function header.
Hints
Hint 1
not binds tighter than and, and and tighter than or.
Hint 2
|-> and |=> bind loosest of these, and group to the right.
Hint 3
until and implies share a row and group to the right; iff is one row above them.
What the grader checks: Nine constant answers, graded against IEEE 1800-2023 Table 16-1 (16.9.1) for the sequence operators and Table 16-3 (16.12) for the implication. Four graded forms are also measured on Verilator 5.052 (tools/probes/sva-w1a/delays-precedence.mjs): each counts like the grouping the table gives. Question 5 cannot be confirmed on 5.052 (it misses the failure that tells the groupings apart), and question 8 has no distinguishing trace.
9 checks on Verilator · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain public samples only. A passing result establishes the tested cases, not a proof for all possible inputs.
See all 4 steps and the final capstone