Logic is the faculty of valid inference — reasoning where the conclusion genuinely follows, not reasoning that merely sounds like it does. Swift's type system is that faculty made mechanical: a proof the compiler verifies before the program runs. But it checks only that the reasoning is valid — never that the premises are true. And that gap is exactly where AI is most dangerous.
Grammar makes a statement well-formed. Logic governs the moves you make between statements — whether the conclusion you drew is actually entailed by what came before, or whether it merely arrived wearing the costume of a conclusion. A grammatical sentence can be invalidly reasoned from. Logic is the faculty that catches it.
This is a human capacity first, and the largest of the three arts. A person formed in logic can feel the difference between "the premises force this" and "this is plausible and I would like it to be true." They can hold a chain of inference and test each link — does this follow from that, exactly, or did something slip in unearned? It is the discipline of refusing to accept a conclusion until it has been paid for by what precedes it.
Most reasoning failures are not failures of fact. They are failures of this — a step that felt right, a leap that sounded sound, an inference that was never actually valid. Logic is the faculty that makes the leap visible. And like grammar, it can be trained until it becomes reflex — until an invalid step feels wrong before you can name the fallacy.
There is a deep correspondence — the Curry–Howard correspondence — between programs and proofs: a type is a proposition, and a program that satisfies it is a proof. When you give a function a type signature, you are stating a logical claim, and the compiler verifies that claim before the program is ever allowed to run. Tests, contracts, and proof assistants check reasoning too — but the type system is where everyday programming first meets externally-checked inference, used every day by developers who rarely notice what it is: logic you cannot argue with. The reasoning is checked by a machine that has no interest in whether you would like it to be valid.
// A type is a proposition. This signature CLAIMS: given a Reading, I return a Verdict. func evaluate(_ reading: Reading) -> Verdict // The compiler will not accept a body that fails to make good on the claim. // You cannot return nothing. You cannot return the wrong thing. The proof must hold. // Make the invalid state unrepresentable, and the bad inference cannot even be written: enum Verdict { case allow, deny, escalate } // there is no fourth, undefined verdict to slip through
But here is the honest limit, and it is the most important thing on this page. The type system checks that your reasoning is valid — that the conclusion follows from the premises. It can never check that the premises are true. A perfectly-typed program can be built on a false assumption and will compile flawlessly, proving a conclusion that follows impeccably from a lie.
Validity. Does the conclusion follow from the premises? Is each step entailed by the last? The machine verifies this, tirelessly and without mercy.
Soundness. Are the premises actually true? Is the thing you assumed real? No compiler checks this. No type proves a premise. Only a formed mind does.
A valid argument from false premises is the most dangerous thing in reasoning: flawless logic in service of a falsehood.
This is the payoff, and it is sharper than grammar's. A large language model produces output that is not only well-formed but locally valid-seeming — the inferences look like they follow, the reasoning reads as sound, each step appears entailed by the last. And often it is valid. The failure is almost never in the validity. It is in the premises — a fabricated citation, an assumed fact that was never true, a confident foundation made of nothing. The model reasons impeccably from a lie, and presents the conclusion with the same fluency it gives the truth.
The type system trained you to demand that inference be checkable. That trained demand is what makes you ask the question AI's fluency is built to make you skip: are the premises even true?
A person formed in logic does not accept a conclusion because it is valid. They have the reflex — built by years of the compiler refusing their unearned proofs — to ask the second question the machine cannot answer: and are the premises true? That reflex is the immune system against confident invalidity. Without it, the operator accepts plausible reasoning as sound reasoning and is captured by the most persuasive failure mode AI has: being articulate, valid-sounding, and wrong at the root.
Be precise about the claim. AI can assist judgment, simulate it, and accelerate judgment-like work — often brilliantly. What it cannot do is bear responsibility for the soundness of a conclusion; that stays with the operator. This is how the second art forms a more effective human. Not by teaching the type system — by building the demand that inference be checkable, so the person stays the one who audits the premises while the machine handles the steps. The operator who never developed that demand has no way to tell sound from merely-valid, and defers to fluency. The formed one interrogates the foundation, and stays in command.
Logic at the scale of a single function is the type system. The same faculty, pointed at the question of what an agent may do, becomes governance — valid inference about authority, made mechanical and deterministic. It is the formation-side root of Governed Intelligence and the SwiftVector kernel. The art that checks your reasoning is the art that, grown up, checks the agent's.
Judgment is built by auditing foundations, not conclusions. The drill below forces the order AI's fluency reverses: evaluate the premises before you let yourself evaluate the answer.
Take one AI answer to a question that matters. Separate it into its parts: underline every premise, circle every inference, box the conclusion. Now mark each premise — verified, assumed, fabricated, or unknown — and each inference as valid or invalid. Do not let yourself judge whether the answer is good until the foundation is fully marked. Then ask the one question the machine cannot: what would have to be true for this to be sound?
Most answers survive the validity check and fail the premise check. That asymmetry — valid almost always, sound only sometimes — is the whole reason this art is the immune system of an AI-era operator.
Developer Application · the type system as a reasoning tool →The machine checks that it follows. Only you can check that it is true. Logic is the faculty that never forgets the difference.