1. A computer-implemented method for verifying a design, comprising: representing a verification directive, which pertains to the design and includes a local variable, by a finite state machine comprising multiple states, with transitions among the states, transition conditions associated with the transitions, and procedural blocks, which correspond to the transitions and define operations to be performed on the local variable when traversing the respective transitions; and executing the finite state machine by traversing the transitions in accordance with the respective transition conditions and modifying the local variable in accordance with the respective procedural blocks of the traversed transitions, so as to verify the design with respect to the verification directive.