# Logics are something

**Published:** **Last Edited:**

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

### ABSTRACT

Logics are something which we do not implement in solving our problems; rather it is used to explain the concept or reasoning of the problem. Logics are used in the most intellectual activities.

Logic was defined by Averroes as "the tool for distinguishing between the true and the false". A machine works on facts; it uses the logic behind the problem and produces the answer.

### INTRODUCTION

Basically there are two types of logic, propositional and predicate logic. Propositional logic is concerned about the statements and their connectivity in terms of logical reasoning. Predicate logic is concerned with the individual and its properties. It refers to an individual statement and links it with its properties.

### WHAT IS LOGIC

Logic can be defined as the art or system of reasoning.

Logic is a formal language that includes:

- Syntax - rules for writing legal sentences
- Semantics - meaning of those sentences (facts)
- Proof - rules for inferring sentences from other sentences

### ROLE OF LOGIC IN AI

Logical theories in AI are independent from implementations. They can be used to provide insights into the reasoning problem without directly informing the implementation. Direct implementations of ideas from logic like theorem-proving and model-construction techniques are used in AI, but the AI theorists who rely on logic to model their problem areas are free to use other implementation techniques as well.

Thus the uses of logic in AI can be as:

- a tool of analysis
- a basis for knowledge representation
- a programming language.

Logic can be represented in two major forms:

- Propositional
- Predicate

### PROPOSITIONAL LOGIC

It is the study of the statements and their connectivity structure.

Propositions are atomic sentences - which cannot be decomposed further. When logical connectors are used with propositions, we get well formed formulas which can be used to prove statements or infer from other statements. Propositional logic deals with the determination of the truth of a sentence.

In propositional logic we define:

- Truth table - truth table give the logical relationship between two or more statements. We can explain the functions of truth table with the help of logic gates. Ex - representation of the statement - ((P V H) " not(H) => P in truth table is as follows :
- Logical equivalence - when two statements have the same truth table values than they are said to be logically equivalent.
- Tautologies - there are those in which all the statements are true. Ex - "Sun is a star and Earth is a planet".
- Contradictions - in this all the values of truth table are false. Ex - "Sun is a planet and Earth is a star".

However, many kinds of inference cannot be formalised in propositional logic. Ex - general statements like "All men are mortal" cannot be represented in the form of this type of logic.

### SYNTAX OF PROPOSITIONAL LOGIC

Logical connectors are used to combine statements. Each connector has its symbol. The symbols and their corresponding meanings are:

- negation meaning "not"
- conjunction meaning "inclusive or"
- disjunction meaning "and"
- implication meaning "if - then"
- equivalence or bi-implication (iff) meaning "if and only if"

The propositional formulas are built upon these elements only and are called wee formed formulas. If A and B are sentences, then the various connectors are used as:

- A is true when A is false, and is false when A is true.
- A?B is false when both A and B are false, and is true otherwise.
- A^B is true when both A and B are true, and is false otherwise.
- A?B is false when A is true and B is false, and is true otherwise.
- A?B is true when both A and B are true, true when both A and B are false, and false otherwise.

### SEMANTIC OF PROPOSITIONAL LOGIC

Atomic sentences can either be true or be false. The truth value of the formula can be determined by the truth values of the atomic sentences that constitute the formula. In other words, the meaning of the propositional formula (well formed formula) is defined by the semantics.

Each logical connector is defined by a truth table. After determining each atomic statement to be true or false, a truth table can be used to compute the truth value of any formula.

### PREDICATE LOGIC

Predicate logic is the study of the individual and their properties. The most simple sentences can be represented in terms of logical formulae in which a predicate is applied to one or more arguments. In predicates, the statements are:

- Related in specific ways
- Predicate name identifies the relationship

A method that is used extensively in application of predicate logics in artificial intelligence programs has a machine based inference procedure called resolution. This method makes it simpler to represent knowledge, general and expert, in terms of set of axioms expressed in a special form of formulae and then derive the result from these axioms.

However, many statements are ambiguous and there is always a choice as to how to represent the statement. Ex - "Amit like to watch sports". This statement is ambiguous as many things are not stated in this statement like - which sport does Amit likes to watch whether cricket, football, etc and where does he like to watch the sports whether on TV or stadium.

### SYNTAX OF PREDICATE LOGIC

The statement in predicate logic contains:

- Objects - the individual
- Predicates - the property of the individual
- Quantifiers - the expression of a quantity

Quantifiers are of two types:

- Universal quantifier - For all (?)
- Existential quantifier - There exists (?)

### SEMANTICS OF PREDICATE LOGIC

Semantics for predicate logic can be defined as:

- How we interpret sentences
- How we translate between the two languages
- How we tell the truth of a sentence

### RESOLUTION

Resolution is a procedure that is used for predicate logic for proof. This method can be easily automated for machines to prove a statement based on set of other statements that are related. The steps followed in proving a method by resolution is:

- Negate all the sentences that are given as facts.
- Convert all facts to predicate logic statements.
- Convert statements to conjunctive normal form or clause form.
- Apply resolution (A Ú B) Ù ¬B ? A

Steps to convert the statements into Conjunctive normal form are:

- Eliminate the ? connective.
- Eliminate the ? connective.
- The negation symbols have to be moved inside the brackets.
- The variable names are standardised such that each quantifier has its unique name.
- Move all the quantifiers to left of statement.
- Remove existential quantifiers.
- Eliminate universal quantifiers.
- Convert to conjunctions of disjunctions (CNF).
- Flatten nested conjunctions and disjunctions.

In conjunctive normal form, a literal is a propositional variable or a negation. A clause is a disjunction of literals. A sentence written as conjunction of clauses is said to be in Conjunctive normal form.

A contradiction was derived from the given statements and the negation of the goal. Since the given statements are assumed to be true, the contradiction must arise from negating the goal.

### EXAMPLE

The following example represents all the matter studied in this paper.

Given

- Bill likes all kinds of food
- Anything that anyone eats and is not killed by is food.
- If a person is alive, then that person has not been killed.
- Bill eats peanuts and is still alive.
- Bill does NOT like peanuts.

To prove:

Bill likes peanuts.

Negate goal, add to given statements

Translate statements to predicate calculus:

- "x { Food(x) ? Likes(Bill, x) }
- "y { ?x { Eats(x, y) ^ ¬ KilledBy(x, y)) ? Food(y) }
- "x {Alive(x) ? ¬?y {KilledBy(x,y) } }
- Eats (Bill, peanuts) ^ Alive (Bill)
- Likes (Bill, peanuts)

Convert to CNF:

- Food(X1) ? Likes (Bill, X1)
- Eats(X2, Y2) ? KilledBy(X2, Y2) ? Food (Y2)
- Alive(X3) ? ¬KilledBy(X3, Y3)
- Eats (Bill, peanuts)
- Alive (Bill)
- Likes (Bill, peanuts)
- Food (peanuts)
- Eats(X2, peanuts) ? KilledBy(X2, peanuts)
- KilledBy (Bill, peanuts)
- Alive (Bill)
- NIL

Proceed with resolution - try to derive contradiction:

Hence the statement "Bill likes peanuts is true".

### REFERENCES

- Wikipedia.com
- Artificial Intelligence by rich and knight
- Cs.bham.ac.uk
- Google search