Data Structures, Logic, and Reasoning in AI

Trees

A tree is a hierarchical data structure consisting of:

  • Nodes – store information
  • Branches – connect the nodes

The top node is the root, occupying the highest hierarchy. The leaves are at the bottom, occupying the lowest.

Graphs

Graphs are sometimes called a network or net. A graph can have zero or more links between nodes – there is no distinction between parent and child. Sometimes links have weights – weighted graph; or, arrows – directed graph. Simple graphs have no loops – links that come back onto the node itself.

Graph Properties

A circuit (cycle) is a path through the graph beginning and ending with the same node. Acyclic graphs have no cycles. Connected graphs have links to all the nodes. Digraphs are graphs with directed links. A lattice is a directed acyclic graph.

Making Decisions

Trees and lattices are useful for classifying objects in a hierarchical nature. Trees and lattices are useful for making decisions. We refer to trees and lattices as structures. Decision trees are useful for representing and reasoning.

Binary Decision Trees

Every question takes us down one level in the tree. A binary decision tree having N nodes:

  • All leaves will be answers.
  • All internal nodes are questions.

There will be a maximum of 2N answers for N questions. Decision trees can be self-learning. Decision trees can be translated into production rules.

State and Problem Spaces

A state space can be used to define an object’s behavior. Different states refer to characteristics that define the status of the object. A state space shows the transitions an object can make in going from one state to another.

Finite State Machine

An FSM is a diagram describing the finite number of states of a machine. At any one time, the machine is in one particular state. The machine accepts input and progresses to the next state. FSMs are often used in compilers and validity checking programs.

Using FSM to Solve Problems

Characterizing ill-structured problems – one having uncertainties. Well-formed problems: Explicit problem, goal, and operations are known. Deterministic – we are sure of the next state when an operator is applied to a state. The problem space is bounded. The states are discrete.

Accepting Quarters (Q) and Nickels (N)

AND-OR Trees and Goals

In the 1990s, PROLOG was used for commercial applications in business and industry. PROLOG uses backward chaining to divide problems into smaller problems and then solves them. AND-OR trees also use backward chaining. AND-OR-NOT lattices use logic gates to describe problems.

Types of Logic

  • Deduction – Reasoning where conclusions must follow from premises.
  • Induction – Inference is from the specific case to the general.
  • Intuition – No proven theory.
  • Heuristics – Rules of thumb based on experience.
  • Generate and test – Trial and error.
  • Abduction – Reasoning back from a true condition to the premises that may have caused the condition.
  • Default – Absence of specific knowledge.
  • Autoepistemic – Self-knowledge.
  • Nonmonotonic – Previous knowledge.
  • Analogy – Inferring conclusions based on similarities with other situations.

Deductive Logic

Argument – group of statements where the last is justified on the basis of the previous ones. Deductive logic can determine the validity of an argument. A syllogism has two premises and one conclusion. Deductive argument – conclusions reached by following.

Arguments Using Venn Diagrams

  • If a class is empty, it is shaded.
  • Universal statements, A and E, are always drawn before particular ones.
  • If a class has at least one member, mark it with an *.
  • If a statement does not specify in which of two adjacent classes an object exists, place an * on the line between the classes.
  • If an area has been shaded, no * can be put in it.

Knowledge-based Systems

Rules of Inference

Venn diagrams are insufficient for complex arguments. Syllogisms address only a small portion of the possible logical statements. Propositional logic offers another means of describing arguments.

Limitations of Propositional Logic

If an argument is invalid, it should be interpreted as such – that the conclusion is necessarily incorrect. An argument may be invalid because it is poorly concocted. An argument may not be provable using propositional logic, but may be provable using predicate logic.

First-Order Predicate Logic

Syllogistic logic can be completely described by predicate logic. The Rule of Universal Instantiation states that an individual may be substituted for a universe.

Logic Systems

A logic system is a collection of objects such as rules, axioms, statements, and so forth in a consistent manner. Each logic system relies on formal definitions of its axioms (postulates) which make up the formal definition of the system. Axioms cannot be proven from within the system. From axioms, it can be determined what can be proven.

Goals of a Logic System

  • Be able to specify the forms of arguments – well formulated formulas – wffs.
  • Indicate the rules of inference that are invalid.
  • Extend itself by discovering new rules of inference that are valid, extending the range of arguments that can be proven – theorems.
  • An alphabet of symbols.
  • A set of finite strings of these symbols, the wffs.
  • Axioms, the definitions of the system.
  • Rules of inference, which enable a wff to be deduced as the conclusion of a finite set of other wffs – axioms or other theorems of the logic system.

Shallow and Causal Reasoning

Experiential knowledge is based on experience. In shallow reasoning, there is little or no causal chain of cause and effect from one rule to another. The advantage of shallow reasoning is ease of programming. Frames are used for causal / deep reasoning. Causal reasoning can be used to construct a model that behaves like the real system.

Eliminate Conditionals

When possible, eliminate negations or reduce their scope. Standardize variables. Eliminate existential quantifiers using Skolem functions. Convert wff to prenex form.

Convert

The matrix to conjunctive normal form. Drop the universal quantifiers as necessary. Eliminate signs by writing the wff as a set of clauses. Rename variables in clauses making unique.

Chaining

Chain – a group of multiple inferences that connect a problem with its solution. A chain that is searched / traversed from a problem to its solution is called a forward chain. A chain traversed from a hypothesis back to the facts that support the hypothesis is a backward chain. The problem with backward chaining is finding a chain linking the evidence to the hypothesis.

Other Inference Methods

  • Analogy – Relating old situations (as a guide) to new ones.
  • Generate-and-Test – Generation of a likely solution then test to see if proposed meets all requirements.
  • Abduction – Fallacy of the Converse.
  • Nonmonotonic Reasoning – Theorems may not increase as the number of axioms increase.

Metaknowledge

The Markov decision process (MDP) is a good application to path planning. In the real world, there is always uncertainty, and pure logic is not a good guide when there is uncertainty. An MDP is more realistic in the cases where there is partial or hidden information about the state and parameters, and the need for planning.