CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–4: Fuzzy Control of Inverted.

Slides:



Advertisements
Similar presentations
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 10– Club and Circuit Examples.
Advertisements

CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 9,10,11- Logic; Deduction Theorem 23/1/09 to 30/1/09.
CS344: Artificial Intelligence
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–5 and 6: Propositional Calculus.
CLASSICAL LOGIC and FUZZY LOGIC. CLASSICAL LOGIC In classical logic, a simple proposition P is a linguistic, or declarative, statement contained within.
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 15, 16, 17- Completeness Proof; Self References and.
CS621 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 12- Completeness Proof; Self References and Paradoxes 16 th August,
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 7– Predicate Calculus and Knowledge Representation.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 11– Fuzzy Logic: Inferencing.
CS621: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–3: Some proofs in Fuzzy Sets and Fuzzy Logic 27 th July.
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–1: Introduction 2 nd January
From Chapter 4 Formal Specification using Z David Lightfoot
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 21– Predicate Calculus and Knowledge Representation 7 th September,
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
CS621: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–4: Fuzzy Inferencing 29 th July 2010.
Fuzzy Logic Jan Jantzen Logic is based on set theory, and when we switch to fuzzy sets it will have an effect on.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–2: Fuzzy Logic and Inferencing.
CS621: Artificial Intelligence Lecture 27: Backpropagation applied to recognition problems; start of logic Pushpak Bhattacharyya Computer Science and Engineering.
Intro to Discrete Structures
CS621: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–1: Introduction 22 nd July 2010.
Chapter 1: The Foundations: Logic and Proofs
MATH 224 – Discrete Mathematics
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 17, 18: Predicate Calculus 15.
Of 33 lecture 12: propositional logic – part I. of 33 propositions and connectives … two-valued logic – every sentence is either true or false some sentences.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 28– Interpretation; Herbrand Interpertation 30 th Sept, 2010.
Ming-Feng Yeh Fuzzy Control The primary goal of control engineering is to distill and apply knowledge about how to control a process so that the.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 19: Interpretation in Predicate.
MATH 224 – Discrete Mathematics
CS621 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 12- Completeness Proof; Self References and Paradoxes 16 th August,
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–3: Fuzzy Inferencing: Inverted.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 38: Fuzzy Logic.
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
CS6133 Software Specification and Verification
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–7: (a) Formal System;(b) How to read research papers 3 rd August, 2010.
Prof. Pushpak Bhattacharyya, IIT Bombay 1 CS 621 Artificial Intelligence Lecture /08/05 Prof. Pushpak Bhattacharyya Fuzzy Set (contd) Fuzzy.
Fuzzy Inference and Reasoning
CS621: Artificial Intelligence Lecture 28: Propositional calculus; Puzzle Solving Pushpak Bhattacharyya Computer Science and Engineering Department IIT.
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 9- Completeness proof; introducing knowledge representation.
1 Propositional Logic: Fundamental Elements for Computer Scientists 0. Motivation for Computer Scientists 1. Propositions and Propositional Variables 2.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 14: AI, Logic, and Puzzle Solving.
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 25.
Prof. Pushpak Bhattacharyya, IIT Bombay 1 CS 621 Artificial Intelligence Lecture /08/05 Prof. Pushpak Bhattacharyya Fuzzy Logic Application.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 35–Himalayan Club example; introducing Prolog.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Prof. Pushpak Bhattacharyya, IIT Bombay 1 CS 621 Artificial Intelligence Lecture 16 – 09/09/05 Prof. Pushpak Bhattacharyya Soundness, Completeness,
CS621 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 32 Fuzzy Expert System.
CS 270 Lecture 1 In Class Problems. Q1: Logic Puzzle You arrive at the end of a long hallway. There are two knights guarding two doors. One knight always.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–10: Soundness of Propositional Calculus 12 th August, 2010.
Prof. Pushpak Bhattacharyya, IIT Bombay1 CS 621 Artificial Intelligence Lecture /08/05 Prof. Pushpak Bhattacharyya Fuzzy Inferencing.
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 4- Logic.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–6: Propositional calculus, Semantic Tableau, formal System 2 nd August,
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 5- Deduction Theorem.
CS621: Artificial Intelligence
CS344: Introduction to Artificial Intelligence (associated lab: CS386)
CS621: Artificial Intelligence
CS621: Introduction to Artificial Intelligence
CLASSICAL LOGIC and FUZZY LOGIC
Administrivia Course Web:
Information Technology Department
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
Fuzzy Inferencing – Inverted Pendulum Problem
CS621: Artificial Intelligence
CS621: Artificial Intelligence
ece 720 intelligent web: ontology and beyond
CS621 : Artificial Intelligence
CS344 : Introduction to Artificial Intelligence
Representations & Reasoning Systems (RRS) (2.2)
Artificial Intelligence
Presentation transcript:

CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–4: Fuzzy Control of Inverted Pendulum + Propositional Calculus based puzzles

Lukasiewitz formula for Fuzzy Implication t(P) = truth value of a proposition/predicate. In fuzzy logic t(P) = [0,1] t( ) = min[1,1 -t(P)+t(Q)] Lukasiewitz definition of implication

Use Lukasiewitz definition t(p  q) = min[1,1 -t(p)+t(q)] We have t(p->q)=c, i.e., min[1,1 -t(p)+t(q)]=c Case 1: c=1 gives 1 -t(p)+t(q)>=1, i.e., t(q)>=a Otherwise, 1 -t(p)+t(q)=c, i.e., t(q)>=c+a-1 Combining, t(q)=max(0,a+c-1) This is the amount of truth transferred over the channel p  q

Fuzzification and Defuzzification Precise number (Input) Fuzzy Rule Precise number (action/output) FuzzificationDefuzzification

Eg: If Pressure is high AND Volume is low then make Temperature Low Pressure/Volume/Temp High Pressure ANDING of Clauses on the LHS of implication Low Volume Low Temperature P0P0 V0V0 T0T0 Mu(P 0 )<Mu(V 0 ) Hence Mu(T 0 )=Mu(P 0 )

Fuzzy Inferencing Core The Lukasiewitz rule t( ) = min[1,1 + t(P) – t(Q)] An example Controlling an inverted pendulum θ = angular velocity Motor i=current

The goal: To keep the pendulum in vertical position (θ=0) in dynamic equilibrium. Whenever the pendulum departs from vertical, a torque is produced by sending a current ‘i’ Controlling factors for appropriate current Angle θ, Angular velocity θ. Some intuitive rules If θ is +ve small and θ. is –ve small then current is zero If θ is +ve small and θ. is +ve small then current is –ve medium

-ve med -ve small Zero +ve small +ve med -ve med -ve small Zero +ve small +ve med +ve small -ve small -ve med -ve small +ve small Zero Region of interest Control Matrix θ.θ. θ

Each cell is a rule of the form If θ is <> and θ. is <> then i is <> 4 “Centre rules” 1.if θ = = Zero and θ. = = Zero then i = Zero 2.if θ is +ve small and θ. = = Zero then i is –ve small 3.if θ is –ve small and θ. = = Zero then i is +ve small 4.if θ = = Zero and θ. is +ve small then i is –ve small 5. if θ = = Zero and θ. is –ve small then i is +ve small

Linguistic variables 1.Zero 2.+ve small 3.-ve small Profiles -ε-ε+ε+ε ε2 ε2 -ε2-ε2 -ε3-ε3 ε3ε3 +ve small -ve small 1 Quantity (θ, θ., i) zero

Inference procedure 1. Read actual numerical values of θ and θ. 2. Get the corresponding μ values μ Zero, μ (+ve small), μ (-ve small). This is called FUZZIFICATION 3. For different rules, get the fuzzy i values from the R.H.S of the rules. 4. “ Collate ” by some method and get ONE current value. This is called DEFUZZIFICATION 5. Result is one numerical value of i.

if θ is Zero and dθ/dt is Zero then i is Zero if θ is Zero and dθ/dt is +ve small then i is –ve small if θ is +ve small and dθ/dt is Zero then i is –ve small if θ +ve small and dθ/dt is +ve small then i is -ve medium -ε-ε+ε+ε ε2 ε2 -ε2-ε2 -ε3-ε3 ε3ε3 +ve small -ve small 1 Quantity (θ, θ., i) zero Rules Involved

Suppose θ is 1 radian and dθ/dt is 1 rad/sec μ zero (θ =1)=0.8 (say) μ +ve-small (θ =1)=0.4 (say) μ zero (dθ/dt =1)=0.3 (say) μ +ve-small (dθ/dt =1)=0.7 (say) -ε-ε+ε+ε ε2 ε2 -ε2-ε2 -ε3-ε3 ε3ε3 +ve small -ve small 1 Quantity (θ, θ., i) zero Fuzzification 1rad 1 rad/sec

Suppose θ is 1 radian and dθ/dt is 1 rad/sec μ zero (θ =1)=0.8 (say) μ +ve-small (θ =1)=0.4 (say) μ zero (dθ/dt =1)=0.3 (say) μ +ve-small (dθ/dt =1)=0.7 (say) Fuzzification if θ is Zero and dθ/dt is Zero then i is Zero min(0.8, 0.3)=0.3 hence μ zero (i)=0.3 if θ is Zero and dθ/dt is +ve small then i is –ve small min(0.8, 0.7)=0.7 hence μ -ve-small (i)=0.7 if θ is +ve small and dθ/dt is Zero then i is –ve small min(0.4, 0.3)=0.3 hence μ-ve-small(i)=0.3 if θ +ve small and dθ/dt is +ve small then i is -ve medium min(0.4, 0.7)=0.4 hence μ -ve-medium (i)=0.4

-ε-ε+ε+ε -ε2-ε2 -ε3-ε3 -ve small 1 zero Finding i Possible candidates: i=0.5 and -0.5 from the “zero” profile and μ=0.3 i=-0.1 and -2.5 from the “-ve-small” profile and μ=0.3 i=-1.7 and -4.1 from the “-ve-small” profile and μ= ve small -ve medium 0.7

-ε-ε+ε+ε -ve small zero Defuzzification: Finding i by the centroid method Possible candidates: i is the x-coord of the centroid of the areas given by the blue trapezium, the green trapeziums and the black trapezium ve medium Required i value Centroid of three trapezoids

Propositional Calculus and Puzzles

Propositions − Stand for facts/assertions − Declarative statements − As opposed to interrogative statements (questions) or imperative statements (request, order) Operators => and ¬ form a minimal set (can express other operations) - Prove it. Tautologies are formulae whose truth value is always T, whatever the assignment is

Model In propositional calculus any formula with n propositions has 2 n models (assignments) - Tautologies evaluate to T in all models. Examples: 1) 2) - e Morgan with AND

Semantic Tree/Tableau method of proving tautology Start with the negation of the formula α-formula β-formula α-formula - α - formula - β - formula - α - formula

Example 2: BC BC Contradictions in all paths X α-formula (α - formulae) (β - formulae) (α - formula)

A puzzle (Zohar Manna, Mathematical Theory of Computation, 1974) From Propositional Calculus

Tourist in a country of truth- sayers and liers Facts and Rules: In a certain country, people either always speak the truth or always lie. A tourist T comes to a junction in the country and finds an inhabitant S of the country standing there. One of the roads at the junction leads to the capital of the country and the other does not. S can be asked only yes/no questions. Question: What single yes/no question can T ask of S, so that the direction of the capital is revealed?

Diagrammatic representation S (either always says the truth Or always lies) T (tourist) Capital

Deciding the Propositions: a very difficult step- needs human intelligence P: Left road leads to capital Q: S always speaks the truth

Meta Question: What question should the tourist ask The form of the question Very difficult: needs human intelligence The tourist should ask Is R true? The answer is “yes” if and only if the left road leads to the capital The structure of R to be found as a function of P and Q

A more mechanical part: use of truth table PQS’s Answer R TTYesT TF F FTNoF FF T

Get form of R: quite mechanical From the truth table R is of the form (P x-nor Q) or (P ≡ Q)

Get R in English/Hindi/Hebrew… Natural Language Generation: non-trivial The question the tourist will ask is Is it true that the left road leads to the capital if and only if you speak the truth? Exercise: A more well known form of this question asked by the tourist uses the X-OR operator instead of the X-Nor. What changes do you have to incorporate to the solution, to get that answer?