Q3
Support for forall, exists, etc in gnu c and c++
Usage
#include <Q.h>
bool A(init,cond,next,exprn) /* Forall */
bool E(init,cond,next,exprn) /* Exists */
bool E1(init,cond,next,exprn) /* Exists a single */
bool C(init,cond,next,exprn) /* Count */
Overview
This is a simple minded implementation of predicate calculus in C. The first three arguments are the same as those of the for loop in C and C++. For example to verify that all values in an array are positive you could use:
A(int i = 0, i < 100, i++, a[i] >= 0)
Note that the macros can be nested or used in any context that requires boolean values.
See nana.info for more details.
Portability
These macros require GNU C or GNU C++.
Releases
8 releases since Debian 2.1 (Slink); the text changed 1 time.