1

I am writing code which is working like a state machine. So:

  • some functions are setting a specific state
  • others are allowed to be executed in a specific state.

(In reality it is a little more complex, but these are the basics, to keep it simple.)

Currently I use runtime assertions to check if a function is allowed in the current state. This is nice because it is kind of self documenting; moreover I can stop with the debugger on an assert and know where the error is. But the drawback is that it requires compiling the code, and that during testing I need to find custom inputs to fire the appropriate assertions.

Incidentally, I know that the Windows WDK provides annotations such as:

__drv_maxIRQL
__drv_setsIRQL

These annotations are statically checked using PreFAST, which can fire an error if necessary. This kind of static verification of code specifications is exactly what I need.

So the question is: are there any tools out there which provide similar functionality for programs specified in the form of state machines?

ftk
6146 silver badges11 bronze badges
asked Mar 12, 2012 at 17:29

1 Answer 1

2

The Frama-C plug-in Aoraï does more or less exactly what you describe, for C programs, with the possibility of static verification. It does not rely on PreFAST but on comparable verification tools from the Frama-C platform.

answered Mar 13, 2012 at 13:53
Sign up to request clarification or add additional context in comments.

1 Comment

Preferable is a solution for C++. But I will have a look on it.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.