I think I should mention something about internal versus external --
Modern logic is very carefully structured so that you can't
literally attain self-reference. (You very quickly run into things like the Liar's paradox) The 'self-reference' here occurs by passing between internal and external statements.
What you normally think of as a logical statement is an
external statement. In the theory of integer arithmetic, the only
internal objects are numbers.
The major trick in Godel's proof is to develop formal logic purely out of integer arithmetic; he elaborates a way to treat certain numbers as internal statements, or even as internal proofs. He also provides a way to translate back and forth between external statements
P and their corresponding internal statements \bar{P}.
He then shows how to use integer arithmetic to construct the function
IsAProof(P, X)
which is true if and only if X is an internal proof of P. From this, it's easy to construct the "IsProvable(P)" function.
Now, if we had an external proof
X of
P, then we could translate it into an internal proof \bar{X} of the internal statement \bar{P}, and thus IsProvable(\bar{P}) is true. So, conversely, if IsProvable(\bar{P}) is false, then
P must not have a proof!
Incidentally, the converse is not true: it is possible for \bar{P} to have an internal proof, but for
P to be unprovable externally.
For example, it seems meaningful to consider a system that contains only positive claims, that is, does not contain the word "no". Similarly, it seems meaningful to consider a purely constructive system, in which the word "exist" is not needed, because this word expresses that something may exist even if you cannot explicitly find it.
You might be interested in
Universal Algebra.
A universal algebra consists only of functions and equational identities. But this is enough to define groups, rings, and vector spaces. But it has severe limitations too -- for example, you cannot define fields with universal algebra!
(But the
logic still contains words like "not" and "exist" -- you're just not allowed to use them in your axioms)
Horn clauses are a similar sort of thing, but with wider applicability.