← Back to home

Logic in WhyGraph

WhyGraph can check whether each step of an argument holds by logic alone: if all the nodes pointing at a claim were true, would the claim have to be true? It judges the form of the step, not whether the premises are actually true. The check uses fixed rules of propositional logic, no AI model, and works in Demo Mode too.

Check Logical Validity

In Build and Review mode. Marks every logically valid inference with indigo arrows and a star. More →

Make Inference Valid

In Build mode. Click an inference that is not valid, and the missing premises are added as new claims. More →

What gets checked

Each claim is checked together with the nodes directly supporting it: they are the premises, the claim is the conclusion. Nodes further up or down the graph don't count. When the inference is valid, its arrows turn indigo and a star appears at their tip.

Claim

The street is wet.

Logically valid inference
External Source

It rains.

Axiom

If it rains, then the street is wet.

Checked: if It rains and If it rains, then the street is wet are true, can The street is wet be false? No, so the inference is valid.

How a sentence becomes logic

The checker does not use an AI model. It reads your sentences with fixed rules: it splits them at connective words like if, and and not, and treats whatever text is left between them as an indivisible statement, or atom.

  1. 1

    Your sentence

    "If it rains, then the street isn't wet."
  2. 2

    Normalise

    IF IT RAINS THEN THE STREET IS NOT WET

    upper-case · n't → not · drop punctuation before then

  3. 3

    Split at connectives

    ifit rainsthenthe street isnotwet
  4. 4

    Pull “not” out of the atom

    ifit rainsathen¬the street is wetb

    identical text anywhere in the inference gets the same letter

  5. 5

    Formula

    a → ¬b

Connectives it recognises

Capitalisation doesn't matter. Any wording not listed here is treated as ordinary text inside an atom.

You writeLogic
notn'tit is not the case thatit is false that

Negates the atom it stands in, wherever "not" appears in it.

¬
and

Both hold. Splits the sentence even inside a noun phrase.

∧
or

At least one holds (inclusive).

∨
either … orxor

Exactly one holds (exclusive).

⊕
if … thenif …, thenif …, …impliesimplies that

"If A, B" works without "then" when the sentence has exactly one comma.

→
… if …… even if …

"B if A" means "if A, then B". It splits the whole sentence: "A and B if C" means "if C, then A and B". "Even if" is read like "if".

→
… only if …only if …, …

"A only if B" and "Only if B, A" both mean "if A, then B".

→
if and only ififfexactly ifis equivalent to

Both or neither hold.

↔
( … )

Groups parts of a sentence.

( )

Without parentheses, operators bind in this order (tightest first): ¬ · ∧ · ∨ · ⊕ · → · ↔. So "x and y or z" means (x ∧ y) ∨ z. Use parentheses when in doubt.

Inferences it certifies

An inference is valid if there is no way to make all premises true and the conclusion false. The checker recognises every valid pattern of propositional logic, including long chains, as long as it reads the sentences correctly. Here are the most common ones:

Modus ponens

A → B, A ⊢ B

If it rains, then the street is wet.

It rains.

⇒ The street is wet.

Modus tollens

A → B, ¬B ⊢ ¬A

If I study, then I pass.

I don't pass.

⇒ I don't study.

Chain (hypothetical syllogism)

A → B, B → C ⊢ A → C

If the car is red, then it is fast.

If the car is fast, then it is expensive.

⇒ If the car is red, then the car is expensive.

Disjunctive syllogism

A ∨ B, ¬A ⊢ B

It rains or it snows.

It is not the case that it rains.

⇒ It snows.

Exclusive or

A ⊕ B, A ⊢ ¬B

Either we win or we lose.

We win.

⇒ We do not lose.

Biconditional

A ↔ B, B ⊢ A

The lamp is on if and only if the switch is up.

The switch is up.

⇒ The lamp is on.

Conjunction

A, B ⊢ A ∧ B · A ∧ B ⊢ B

It rains and it is cold.

⇒ It is cold.

Addition

A ⊢ A ∨ B

It rains.

⇒ It rains or it snows.

De Morgan

¬(A ∧ B), A ⊢ ¬B

Not (we stay and we leave).

We stay.

⇒ We do not leave.

Double negation

¬¬A ⊢ A

It is not the case that the door is not locked.

⇒ The door is locked.

Some patterns look convincing but are not valid, and the checker correctly leaves them unmarked:

Affirming the consequent

not valid

A → B, B ⊬ A

If it rains, then the street is wet.

The street is wet.

⇏ It rains.

Inclusive or is not exclusive

not valid

A ∨ B, A ⊬ ¬B

It rains or it snows.

It rains.

⇏ It is not the case that it snows.

When are two sentences "the same"?

This is the part that matters most in practice. The checker has no idea what words mean. Two atoms count as the same statement only when their text is identical after a small amount of cleanup. So you have to phrase the same idea the same way every time.

Cleanup applied before comparing

  • • Upper / lower case is ignored
  • • Full stops are dropped
  • • A leading Therefore, Thus, Hence, Consequently or So, is dropped
  • • It is true that / It is the case that are dropped
  • • isn't, don't, … become is not, do not
  • • can't / cannot become can not, won't becomes will not, shan't becomes shall not
  • • Typographic apostrophes (’ ‘ ´ ` …) count as '
  • • does not smoke matches smokes, if that sentence occurs too
  • • Commas before and / or / then are ignored
  • • not in the middle negates the whole atom

NOT (…) below stands for the negation of the sentence in parentheses.

It rains.=it RAINScase and full stop ignored
The street isn't wet.=NOT (The street is wet)n't → not, negates the atom
I don't smoke.=NOT (I smoke)"do" is removed when the sentence without it exists
They do not win.=NOT (They win)same for we / you / they
Tom does not smoke.=NOT (Tom smokes)"does" + verb becomes "smokes" when "Tom smokes" occurs in the inference (also has, goes, watches, flies, …)
Tom did not swim.≠NOT (Tom swam)past tense with "did" is not recognised; write "It is not the case that Tom swam"
It is raining.≠It rains.different words, no synonyms or grammar
Yesterday, it rained.≠Yesterday it rained.commas inside an atom count
The street is wet!≠The street is wet.only full stops are dropped, not ! or ?
The bridge isn’t safe.=NOT (The bridge is safe)typographic apostrophes are recognised
I can't swim.=NOT (I can swim)can't → can not; won't → will not

Pronouns: he, she, it

The checker understands he, she and it when the name they refer to appears in the same node. Across nodes it can't tell who is meant.

✓ Resolved

Socrates is a man and he is mortal.

⇒ Socrates is mortal.

✗ Not resolved

Node 1: Socrates is a man.

Node 2: He is mortal.

The name is in a different node.

When in doubt, repeat the name.

What it cannot see

Quantifiers

"All", "every", "some", "no" are just words. Syllogisms about classes are out of reach.

All men are mortal. Socrates is a man. ⇏ Socrates is mortal.

Other connectives

"but", "unless", "neither … nor", "because", "when" are not connectives. An "if" after verbs like wonder, ask, know, check or find out stays part of the statement ("I wonder if it rains").

It rains but it is warm. ⇏ It is warm.

Shortened sentences

Each side of a connective must be a full sentence.

It rains or snows. ⇏ … write "It rains or it snows."

Lists with commas

Only the last item before "and" is split off. Everything before it stays one atom.

x, y and z. ⇏ y.

Meaning and world knowledge

Synonyms, causation and common sense are invisible. The connection has to be stated as a premise.

Rain makes streets wet. It rains. ⇏ The street is wet.

Context across the tree

Only the direct supporters of a claim are used. Premises two levels down don't count.

Make each step valid on its own.

Known quirks

The checker misses valid inferences far more often than it wrongly marks one as valid. So if an inference is marked valid, it almost certainly is. If it isn't marked, it may still be valid: the checker may just have read a sentence differently than you meant it. Most surprises, in both directions, come from sentences like these:

"and" / "or" inside a name or a list

The checker reads "Romeo and Juliet is a play" as two statements, Romeo and Juliet is a play. Usually that does no harm: "If Romeo and Juliet is a play, then it can be adapted to a movie. Romeo and Juliet is a play. Therefore, Romeo and Juliet can be adapted to a movie." is correctly recognised as valid. But "Juliet is a play" would be wrongly accepted as following from it, and Make Inference Valid may suggest odd premises. If that happens, write & in names and simple lists: "Romeo & Juliet is a play."

"not" that doesn't deny the sentence

"The computer sometimes, but not always, gives false explanations." does not deny anything, but the checker reads it as NOT (the computer sometimes, but always, gives false explanations). Rephrase without "not", e.g. "The computer occasionally gives false explanations."

"if" in the middle of a sentence

A mid-sentence if applies to everything before it: "It is cold and it snows if it is winter" means "If it is winter, then it is cold and it snows." If you mean something else, write it as "If …, then …".

Making an inference valid

In Build mode, Make Inference Valid highlights the arrows of every inference that is not logically valid yet. Click one, and the missing premises are added as new claims supporting the conclusion. If there are several ways to make it valid, you choose one.

It rains. ⇏ The street is wet.

Added claim: If it rains, then the street is wet.

The added claims make the step valid, they don't make it true: they are new claims that can be reviewed, disputed and revised like any other.

Writing for the checker

  1. 1Pick one phrasing per idea and reuse it word for word in every node.
  2. 2State conditionals as "If A, then B." — the shorter "B if A" and "If A, B" work too.
  3. 3Negate with "not" right after the verb ("is not", "does not", "can't"), or with "It is not the case that …".
  4. 4Avoid "did not" with irregular verbs: "did not swim" does not match "swam".
  5. 5Spell out the bridge premise ("If …, then …") instead of relying on common sense.
  6. 6Repeat names instead of using pronouns across separate nodes.

See also: Bots guide →