Programs are meant to be read by humans and only incidentally for computers to execute. (Donald E. Knuth)
If a system does not have a counterexample (i.e., an error or a bug) for a certain property within a small scope (a limited size or configuration), then it is unlikely to have a counterexample in a larger scope. (Daniel Jackson)
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies” (Tony Hoare)
// 结构约束 assert(u == u->parent || u == u->parent->left || u == u->parent->right); assert(!u->left || u->left->parent == u); assert(!u->right || u->right->parent == u); // 数值约束 assert(!u->left || u->left->val < u->val); assert(!u->right || u->right->val > u->val);
assert(first(obj) <= ptr && ptr < last(obj)); *ptr = 1; // Assumes ptr is valid.
int elements[MaxN + 100];
-fsanitize=address