MENTAL
 Main Menu
 Applications
 Logic
 Automatic Reasoning


Automatic Reasoning
 AUTOMATIC
REASONING

"Causality does not operate backwards" (Gregory Bateson).

"Logic was born as an attempt to mechanize the intellective processes of reasoning" (D. Hofstadter).

"Mathematics will soon be done only by computers" (Boris Shaliach).

"Logic is combining the known to reach the unknown" (George Edward Moore).



Types of Reasoning

Reasoning as a mode of analytical consciousness

As we know, there are two modes of consciousness: Reasoning is using the HI mode, going from the general to the particular, the ability to make inferences or deductions. To do this, everything must be expressed in formal language. Reasoning makes explicit knowledge that is already implicit in the premises or knowledge base.


The automaticity of reasoning

The incomplete inductive consciousness in principle cannot be automated because the intuitive cannot be formalized; only its manifestations can be formalized. Synthetic consciousness is the object of study of cognitive psychology, being today one of the main challenges of artificial intelligence.

Analytic consciousness, on the other hand, can be automated, since it is purely formal. Automatic reasoning is a branch of computer science that studies the reasoning capabilities of computational systems.


The concept of inference

Inference is the process of deriving conclusions from a set of premises (or deriving theorems from axioms). The premises, the conclusions, and the process of inference itself must be expressed in a formal language, which may be natural or artificial. The premises or axioms can be of general or specific type, as well as the conclusions.

Assuming that the process of inference is correct, the inferences may be valid, even if the premises are false. But true inferences always follow from the truth of the premises.

An inference is monotonic if it does not vary by adding new premises. Otherwise, it is non-monotonic.


Types of reasoning with rules

A knowledge base consists of:
  1. A set of premises or axioms of a theory, expressed in a formal language. If these premises are expressed by rules of the type "condition → action" or "antecedent → consequent", we have a rule base, representing generic knowledge.

  2. A set of facts, which form a fact base. They represent specific knowledge.
In this knowledge base there are two types of reasoning:
  1. Direct (or forward).
    The antecedents of the rules are examined, and when they are satisfied, inferences are drawn, which are the consequents. The rules are reapplied to the inferences obtained to obtain new inferences. And so on until the rules produce no new inferences.

  2. Inverse (or backward).
    We start from the target (a sentence or expression) and examine the rules containing that target in the consequents of the rules. If no rules are found, it is impossible to reach the target. If they are found, one of them is chosen and the antecedent of that rule becomes the new objective. And so on in a recursive process. When a rule does not lead to the goal, another alternative rule is chosen (if it exists). This type of reasoning is the one used in logic programming.
These two types of reasoning are analogous to those used in arithmetic calculus. For example: 1) Direct: 32 = 9 (the operation of raising 3 to the square is performed); 2) Inverse: √9 = 3 (a number such that its square is 9 is sought),

Direct reasoning is easier to automate than inverse reasoning, just as it is easier to perform direct operations than inverse ones.

The advantage of direct reasoning is that all the expressions being inferred are incorporated into the knowledge base. The disadvantage is that the inferred expressions are the basis for further inferences, a process that tends to grow exponentially.

The advantage of inverse reasoning is that we know the objective, the expression to prove, and we avoid exploring unnecessary rules. The disadvantage is that the steps we are taking are not guaranteed, having to backtrack often to find the correct path that will lead us to the goal. When applicable, inverse reasoning is more efficient than direct reasoning because you don't have to make multiple passes through the set of rules.

Ideally, both methods should be used in a controlled manner, depending on the issue or problem at hand.


The management of automatic reasoning

The management of reasoning, both direct and inverse, is performed with a reasoning program or "engine". This engine can be specific to each particular system or it can be generic (or universal), valid for any system. Ideally, a universal engine can be developed, i.e., regardless of the content of the rules.

Automatic reasoning is independent of the mechanical device with which it is implemented. Computing is an activity that can be human or mechanical, but conceptually it is the same thing. Informatics or computer science is not reducible to computer technology any more than astronomy is reducible to telescope technology. Computers and telescopes are just instruments of their respective sciences.

The reasoning engine performs two functions:
  1. The examination of each rule to see if it is applicable. If the engine is direct reasoning, it examines the antecedent. If the engine is inverse reasoning, it examines the consequent. The inference engine for forward reasoning explores the rules in breadth, i.e., all rules, independent of each other, are considered. For backward reasoning, the rules are examined in depth, i.e., one starts from a rule and looks for a rule dependent on it.

  2. Control, which manages the order in which rules are examined.

Automatic proof of theorems

Automatic theorem proving (DAT) −in English, Automated Theorem Proving, ATP− is a type of inverse reasoning. It is based on formal logic. It is currently the most developed field of automated reasoning.

The procedure consists of 3 steps: 1) the user expresses a conjecture using a formal language expression; 2) this expression is passed to the computational system as input; 3) the system attempts to solve it; 4) if it is solved, the answer can be positive or negative (the conjecture is or is not a theorem).

A theorem provers starts from the theorem to be proved and the demonstrator discovers (or infers) the steps to be performed to get from the axioms to the theorem.

A demonstration can serve to prove that something is true or to prove that something is false. To refute is to prove a negation.

By automating the proof of theorems, new theorems not previously known have been found. Some shorter and more elegant demonstrations than human ones have also been discovered.


Fields of application

The fields of application of automatic reasoning are numerous, the most important being:
A brief history of automatic reasoning A European research initiative in the field of efficient and accurate theorem proving is underway. The project is called TPTP (Thousands of Problems for Problem Solvers, http://www.tptp.org). A new language also called TPTP has been created in which to express problems and solutions using higher-order logic. And also a format called THF (Typed Higher-order Form).

Today, Leibniz's ideal can be considered to have been largely achieved. However, there is still much to be done: researching new heuristics, new more efficient algorithms, new rules (or meta-rules), etc.

Today there is no discussion of arithmetic when using a calculator. But the calculator, even if it gives the correct answer, does not prove it, i.e., it does not show all the steps it takes to arrive at a result. Ideally, reasoning should achieve the same result.


MENTAL and Automatic Reasoning

Traditional automatic reasoning systems are based: In contrast, in MENTAL: Actually, the problem of inferences can be stated in a general way. An inference process is a normal evaluation process of an expression that produces a modification of the abstract space. If the original expression does not change, all new expressions generated are the inferences produced.


Universal language

The problem with automatic reasoning is that it is not possible to address it in a coherent way without a standard, universal formal language, where the mathematical-logical language is equal to that of computers. With MENTAL as a universal language, this problem disappears and we are in ideal conditions to address the issue of automatic reasoning.

Traditionally, in automatic reasoning, a formal language based on first-order predicate logic with equality has been considered, a language with which many areas of mathematics could be formalized. But this language is far from universal and is not the language of computers.

Characteristics of MENTAL as a universal language for automatic reasoning are:
The formalization of a demonstration

Traditionally, the premises and conclusion are represented vertically: For example, Robinson's binary resolution rule is expressed as follows: The problem with this representation is that no formal language relating premises and conclusion is used.

In MENTAL, this problem is easily solved by the semantics of the "Condition" operation. For example, Robinson's rule above can be expressed as a generic expression: This expression is equivalent to
⟨( (AB ∧ ¬AC) → BC)⟩
Where ⟨( ¬A = (A?)' )⟩


The coding of the rules

In order to make the process as efficient as possible and to correspond to the type of reasoning to be performed, the rules are specified by means of generic expressions as follows: with Ai being the antecedents and C being the consequent. These expressions have the advantage that when an antecedent is not satisfied, the analysis process of that rule is terminated. This is called "cutting".

In forward reasoning it goes from antecedents to consequents. Backward reasoning goes from the consequent to the antecedents.

Since evaluation is from left to right, in backward reasoning you put what you want to prove first.

There can be several expressions with the same C, that is to say, that there are alternatives: the conclusion can be reached by several possible ways. And the same thing happens with antecedents.

This rule structure is equivalent to Horn's clauses, the one used in logic programming, which have the form. where commas assume logical "and" connections (and).

Rules can interact with each other such as being activated or deactivated, constrained with additional conditions, and so on.


Types of inferences

Inferences are made using the condition operators (→, ← and ↔), the substitution operators (=, =: and :=) and the equivalence operator (≡).

Inferences go from the general to the particular and can be of two types:
  1. Horizontal. They are made through the symmetric operators (↔ and ≡).

  2. Vertical descending. They are realized through condition and substitution operations.

Types of expressions

In MENTAL we can classify expressions into 3 types:
  1. Expressions type A. These are the generic expressions (parameterized or not), which are the engines of the inferences.

  2. Expressions type B. These are generic (parameterized or not) or non-generic expressions that are the initial expressions from which inferences are made.

  3. Expressions type C. These are the inferences made by means of the expressions of the two previous types.
Expressions of type B are specified after those of type A so that they are evaluated immediately and produce expressions of type C.


Characteristics of inferences
Examples
  1. Expressions type A.
    ⟨( x/man → x/mortal )⟩ // modus ponens

    Expressions type B.
    Socrates/man

    C type expressions (inferences).
    Socrates/mortal

  2. Expressions type A.
    ⟨( a = b )⟩ // substitution
    ⟨( b = c )⟩ // substitution


    Expressions type B.
    None.

    Expressions type C (inferences).
    ⟨( a = c )⟩ // transitive law of substitution

  3. Expressions type A.
    ⟨( x+yy+x )⟩ // commutative law of addition

    Expressions type B.
    a+b
    ⟨a+x


    Expressions type C (inferences).
    (a+b ≡ b+a)
    (⟨a+x⟩ ≡ ⟨x+a⟩)


  4. Expressions type A.
    ⟨( xxy )⟩ // law of logic

    Expressions type B.
    a

    Expressions type C (inferences).
    ⟨( a → a∨y )⟩

  5. Expressions type A.
    ⟨( x*yy*x )⟩ // commutative law of the product

    ⟨( (x+y)*z ≡ (x*z + y*z) )⟩ // distributive law


    Expressions type B.
    None.

    Expressions type C (inferences).
    ⟨( (x+y)*z ≡ (z*x + z*y) )⟩
    ⟨( (x+y)*z ≡ (x*z + z*y) )⟩
    ⟨( (x+y)*z ≡ (z*x + y*z) )⟩
    ⟨( (x+y)*z ≡ (x*z + y*z) )⟩

    ⟨( z*(x+y) ≡ (x*z + y*z) )⟩
    ⟨( z*(x+y) ≡ (z*x + z*y) )⟩
    ⟨( z*(x+y) ≡ (x*z + z*y) )⟩
    ⟨( z*(x+y) ≡ (z*x + y*z) )⟩


    This is an example of inferences that produce generic expressions.

  6. Expressions type A.
    ⟨( (x+y)*z ≡ (x*z + y*z) )⟩ // distributive law

    ⟨( x^2 =: x*x )⟩


    Expressions type B.
    (a+b)^2

    Expressions type C (inferences).
    ( (a+b)^2 =: (a^2 + 2*a*b + b^2) )

  7. Expressions type A.
    ⟨( xyx )⟩ // law of logic

    ⟨( xyyx )⟩ // commutative law of the logical conjunction


    Expressions of type B.
    a∧b

    Expressions type C (inferences).
    b∧a
    a
    b


  8. Expressions type A.
    ⟨( x∈(CD) ↔ (xCxD) )⟩

    Expressions type B.
    a∈(A∩B)

    Expressions type C (inferences).
    a∈A
    a∈B


  9. Expressions type A.
    ⟨( (xy) ≡ (x' ∧ y')' )⟩ // De Morgan's first law

    ⟨( (xy') ↔ (x' ≡ y) )⟩


    Expressions type C (inferences).
    ⟨( (xy)' ≡ (x' ∧ y') )⟩

    ⟨( (x' ∨ y')' ≡ (xy) )⟩ // second Morgan's law

Management of generic expressions
Example of direct and inverse reasoning

We start from a (well-formed) expression G, generic (parameterized or not) or specific, of which we want to know if it is valid or not.

The process is automatic, since generic expressions are evaluated at all times. Therefore, if G appears as a consequent in some axiom, it will automatically evaluate itself if the associated condition is satisfied. If that condition in turn depends on another condition, the same process applies, and so on. Conditions that are not satisfied will be evaluated as (the null expression). Example: Knowledge base for direct reasoning: Knowledge base query: Knowledge base for inverse reasoning: Knowledge base query:
Conclusions

Leibniz's idea of creating a universal language can be said to have been fulfilled with MENTAL, being founded on a minimal number of concepts that produce potentially infinite expressions. But it is not founded on the binary calculus, but on dual primary archetypes. Duality is universal. Binary numbers are only the simplest manifestation of that duality.

And Leibniz's idea of that universal language being able to perform computations has also been realized with MENTAL. Those computations are specified by generic expressions, which are self-sufficient as engines for automatic reasoning.



Addenda

Hilbert's deductive system

Hilbert's deductive system for propositional logic has the following characteristics: For example, we want to prove: pp:
  1. Instantiation of axiom 1 with p=p and q=(pp): p→((pp)→p)

  2. Instantiation of axiom 2 with p=p, q=(pp) and r=p: p→((pp)→p))→
    ((p→(pp))→(pp))

  3. Applying the Modus Ponens between 1 and 2: (p→(pp))→(pp)

  4. Instantiated axiom 1 with p=p and q=p: p→(pp)

  5. Applying the Modus Ponens between 3 and 4: (pp)

Bibliography