AI Glossary / Graphs and symbolic AI / Beginner
Logic
Definition
Logic provides formal ways to express statements and determine what follows from them. In AI, a logic specifies a language, an interpretation of its statements, and a basis for valid reasoning. It lets a system distinguish conclusions supported by stated assumptions from conclusions that merely sound plausible or happen to fit familiar examples.
What it means
A reasoning system may know that a shipment is fragile and that fragile shipments require protective packaging. Logic can make the connection between those statements and a packaging requirement explicit. It does not independently inspect the shipment or decide whether the packaging policy is appropriate.
The word is broader than one notation or algorithm. Propositional logic represents whole statements, while first-order logic can describe objects and relations. Other logics add ways to discuss possibilities, knowledge, time, or other concerns. The choice affects what can be expressed and how difficult reasoning may become.
How it works
Define a vocabulary and rules for constructing sentences. Then specify semantics: the conditions under which each sentence is true in an interpretation. A knowledge base contains the statements accepted for the current reasoning task.
A conclusion is entailed when every interpretation satisfying the knowledge base also satisfies that conclusion. An inference procedure tries to establish such relationships using permitted operations. The procedure's soundness and completeness describe how its derivations relate to semantic entailment.
Useful questions include whether the premises are jointly satisfiable, whether a proposed conclusion follows, and whether two formulations mean the same thing. These are different questions. Checking a sentence's grammar does not prove it true, and finding one satisfying interpretation does not show that every proposed conclusion follows from it.
Three practical examples
1. A workflow designer tests whether a set of routing rules can assign a document to incompatible destinations at the same time.
2. A product configuration system checks whether selected components satisfy compatibility rules and whether required supporting components are included.
3. A knowledge-based assistant derives a classification from explicit facts and rules, retaining the supporting derivation so a reviewer can inspect the assumptions.
Think of it this way
Think of logic as a system for tracing which conclusions are supported by a carefully stated set of rules and facts, much like checking the consequences of a game's rulebook.
The analogy is limited because real-world descriptions are often incomplete or mistaken. A correct derivation from a rulebook does not show that the rulebook captures every relevant aspect of reality. The system's confidence should therefore distinguish certainty inside the model from confidence that the model and its inputs are appropriate.
Worked example
Consider an invented shipment model. Let F mean “the shipment is fragile,” P mean “protective packaging is required,” and E mean “the shipment qualifies for express handling.” The knowledge base contains F, F implies P, and E or P.
From F and F implies P, derive P. Does E also follow? No. An interpretation with F true, P true, and E false satisfies all three premises. Because that interpretation makes E false, it is a counterexample to the proposed entailment of E.
Now add not P as another premise. The set becomes inconsistent: the first two premises require P, while the new premise requires P to be false. In classical logic there is no interpretation satisfying the whole set. This calls for investigating the inputs or rules; it should not be hidden behind a confident operational recommendation.
The example distinguishes a supported conclusion, an unsupported conclusion, and contradictory premises. None of these outcomes tells us whether the real shipment was correctly labeled fragile in the first place.
Illustrative case study
Fictional case: Hazel Logistics prototypes a rule-based packaging assistant. A clerk marks a parcel fragile, while an imported record says protective packaging is not required. The team discovers that one record expresses a customer's preference and the other represents an internal handling rule.
They revise the vocabulary so preference and requirement are separate propositions, then review the policy for resolving actual exceptions. The exercise shows why consistent terminology matters before reasoning begins. It does not report a real shipping outcome, safety certification, or cost reduction from the prototype.
Common misconceptions and mistakes
Do not use “logical” as a synonym for “certain to be correct in practice.” The validity of reasoning is separate from the accuracy and completeness of the premises.
Do not automatically treat missing information as negation. If a knowledge base does not establish express eligibility, that need not establish ineligibility. Some applications deliberately adopt a closed-world rule, but it must be part of the chosen framework.
Do not assume every use of “or” in ordinary language is exclusive. Classical propositional disjunction allows both statements to be true. If the intended rule permits exactly one, encode that additional condition explicitly.
Business use
Logic can be valuable when a business needs explicit requirements, repeatable checks, and inspectable reasoning. Begin with a limited scope and a glossary of predicates or propositions that domain specialists can review.
Test ordinary cases, exceptions, incomplete records, and contradictory inputs. Store the relevant rule version with a derived decision so later reviewers know which assumptions were used. Where uncertainty or changing evidence is central, consider how probabilistic reasoning or another suitable framework complements the logical model. A clear rule system is useful only when its scope and limitations are understood.
People also ask
Is logic the same as an AI model's explanation in natural language?
No. Fluent explanatory text may or may not correspond to a valid formal derivation. The reasoning must be represented and checked to establish that correspondence.
Can logic handle incomplete information?
A knowledge base can leave statements undecided. How the system acts on those gaps depends on its semantics and application rules.
Does a consistent knowledge base describe the real world correctly?
Not necessarily. Consistency means its statements can hold together under an interpretation; factual accuracy requires additional evidence.
Check your understanding
Why does E or P fail to establish E once P is known?
Answer: The disjunction is already satisfied by P. A case with E false and P true remains compatible with the premises, so E is not forced.
Related terms
- Formal logic
- Knowledge base
- Entailment
- Satisfiability
- Consistency
- Logical connectives
- First-order logic
- Closed-world assumption
- logical connective
Learn next
Practice separating three questions: whether premises can all be true, whether a conclusion must follow, and whether a real-world observation supports a premise. Then study truth tables and countermodels to make those distinctions concrete.
More in Graphs and symbolic AI
- Localist representation - A localist representation assigns a particular concept or item to a dedicated representational unit.
- Locality-sensitive hash - A locality-sensitive hash is a hash designed so that similar items are more likely than dissimilar items to receive the same value.
- Locking - In historical automated theorem proving, locking is a restriction on resolution that uses labels on literal occurrences to control which inferences are...
- Logical equivalence - Logical equivalence means that two statements have the same truth value in every interpretation allowed by the chosen logic.
- Logical inference - Logical inference is the process of deriving conclusions from premises using specified reasoning rules.
- Logical minimization - Logical minimization, in the circumscription sense used in knowledge representation, prefers models that make selected predicates true of as few cases as...
Sources
Russell and Norvig, AIMA logical-agents slides, models, entailment, and satisfiability: https://aima.cs.berkeley.edu/slides-pdf/chapter07.pdf
Russell and Norvig, first-order logic and richer vocabulary: https://aima.cs.berkeley.edu/slides-pdf/chapter08.pdf
The shipment model and fictional case are original teaching examples. Classical logic supplies the semantics used in the worked example; other logics can treat some issues differently.
Previous: Logarithmic transformation Next: Logic form