Take the 2-minute tour ×

I'm working on a couple of C projects and I'd like to use automated theorem proving to validate the code. Ideally I'd just like to use the ATP to validate the functions contracts. Is there any functionality in C/gcc or external software/packages/etc that would enable design-by-contract style coding?

If not then thats just incentive to get started on my own.

My references for this would be something like Spec# or Sing# from MSR, but I'm an open source guy and I'm looking for open source solutions.

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

Obviously it is not built into the language, but there are plenty of add-ons to get you going. Most of them are beta - but you might consider contributing to them rather than starting your own.

The one at RubyForge, Design by Contract for C, looks very promising. GNU Nana has been around for a long time and will probably suit your needs fine. Hope these are helpful.

Edit: Check out this article at O'Reily on Design By Contract for C:


share|improve this answer
add comment


Automated Theorem Proving:check.

You should really like Frama-C and its ACSL specification language. You might have already heard about its Caduceus ancestor, but at this time it is considered superseded by Frama-C/Jessie.

share|improve this answer
add comment

If you are interested in validating C code using theorem provers, you should check the VCC project. From their webpage:


VCC is very mature system from Microsoft Research, and has been used to verify the hypervisor of Microsoft Hyper-V. VCC is also open source.

share|improve this answer
add comment

Your Answer


