First-order logic (FOL)

Also known as predicate logic, is a powerful formalism used for knowledge representation in artificial intelligence and computer science. It extends propositional logic by allowing the use of quantifiers and predicates, enabling the representation of complex statements about objects and their relationships.

Key Components of First-Order Logic

Constants:
Definition: Constants are symbols that represent specific objects in the domain.
Examples: If a, b, and c are constants, they might represent specific individuals like Alice, Bob, and Charlie.

Variables:
Definition: Variables are symbols that can represent any object in the domain.
Examples: Variables such as x, y, and z can represent any object in the domain.

Predicates:
Definition: Predicates represent properties of objects or relationships between objects.
Examples: P(x) could mean “x is a person”, while Q(x, y) could mean “x is friends with y”.

Functions:
Definition: Functions map objects to other objects.
Examples: f(x) could represent a function that maps an object x to another object, like “the father of x”.

Quantifiers:

  • Universal Quantifier (∀): Indicates that a statement applies to all objects in the domain. For example, ∀x P(x) means “P(x) is true for all x”.
  • Existential Quantifier (∃): Indicates that there exists at least one object in the domain for which the statement is true. For example, ∃x P(x) means “There exists an x such that P(x) is true”.
  • Logical Connectives:

Definition: These include ∧ (and), ∨ (or), ¬ (not), → (implies), and :left_right_arrow: (if and only if).
Examples: P(x) ∧ Q(x, y) means “P(x) and Q(x, y) are both true”.

  • Equality:

Definition: States that two objects are the same.
Examples: x = y asserts that x and y refer to the same object.