We present a new unified framework for formalizations of axiomatic set theories of different strength, from rudimentary set
theory to full
ZF. It allows the use of set terms, but provides a
static check of their validity. Like the inconsistent “ideal calculus” for set theory, it is essentially based on just two set-theoretical
principles: extensionality and comprehension (to which we add ∈-induction and optionally the axiom of choice). Comprehension
is formulated as:

, where {
x|
ϕ} is a legal set term of the theory. In order for {
x|
ϕ} to be legal,
ϕ should be
safe with respect to {
x}, where safety is a relation between formulas and finite sets of variables. The various systems we consider differ from each
other mainly with respect to the safety relations they employ. These relations are all defined purely syntactically (using
an induction on the logical structure of formulas). The basic one is based on the safety relation which implicitly underlies
commercial query languages for relational database systems (like SQL).
Our framework makes it possible to reduce all extensions by definitions to abbreviations. Hence it is very convenient for
mechanical manipulations and for interactive theorem proving. It also provides a unified treatment of comprehension axioms
and of absoluteness properties of formulas.