Rule and Rulebook fixed. state is Option[A] instead of A.
Stuck state for rulebook added to solve failing '())'.