Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
1
Artificial IntelligenceArtificial Intelligence
Mostafa M. Aref
University of BridgeportDepartment of Computer Science &
Engineering
2
What is Artificial What is Artificial IntelligenceIntelligence
AI is the study of how to make computers do things which, at the moment, people do better.AI problems– Game Playing Theorem proving– Common sense reasoning (GPS)– Perception– Natural Language Understanding– Expert Systems
The Underlying Assumption– A physical symbol system
entities: symbols, tokens, expression (symbol structure)Collection of processes: create, modification, reproduction and destruction.
– HypothesisThe physical symbol system has the necessary and sufficient means for general intelligent action.
3
Artificial IntelligenceArtificial IntelligenceTechniquesTechniques
Manipulate SymbolsIntelligence requires knowledge– Voluminous– hard to characterize accurately– constantly changing– organized in a way that it will be used
knowledge should be represented such that– captures generalization– understood by people who provide it– easily to modified– be used even it is not totally accurate or
complete– help to narrow the range of possiblities
Examples: 8 3 4– Tic-Tac-Toe blank, X, O 1 5 9– 0,1,2 - 2,3,5 (18 or 50) - magic square 6 7 2
Search - Knowledge - Abstraction
4
Level of ModelLevel of Model
same way as people ⇔ whatever easiest wayWhy do we model human performance?– Test psychological theories of human
performance– Enable computers to understand human reasoning– Enable people to understand computer reasoning– Exploit what knowledge we can get from people– Cognitive science
psychologistsLinguistsComputer Scientist
Criteria for Success– Turing Test– Playing Chess– Dendral: analyzes organic compounds to
determined their structures– XCON: configures computer systems
5
Problems, Problem Spaces Problems, Problem Spaces and Searchand Search
To build a system to solve a particular problem, we need to:– Define the problem precisly
initial situation(s)final situation(s)
– Analyze the problem– Isolate & represent the needed task
knowledge– Choose the best problem-solving
technique(s)Defining the problem as a state spacePlay chess– Rule for each possible position (10120)
No one can supply these rulesNo program can handle all these rules
– Write a rule for legal moves in general– State space of play chess
6
Problems, Problem Spaces Problems, Problem Spaces and Searchand Search
Advantages– It allows for formal definition of a problem– converts a given situation into desired situation
using a set of permissible operations– defines the problem as:
techniques (a rule defining step)search, very important for hard problems
Example: A water jug problem– Two jugs 4-gallon and 3-gallon jug, how to get
exactly 2 gallons in 4-gallon jug?(0,0) Start State
(4,0) (0,3)(4,3) (1,3) (3,0)
(3,3)(4,2)
(0,2)(2,0)
Goal State
7
Problem Spaces and Problem Spaces and SearchSearch
Specific rules: no search - no problem solving– solve the problem a head of time
General rules– Search - Applicable to different situation
Special rules: good some times - bad some timesOperationalization: – Informal description -> formal one– Hard and difficult– To get the formal description
define a state space (possible without enumeration all of them)Specify initial state(s) and goal state(s)Specify a set of rules (operations)
– Unstated assumptions– How general should be the rules– how much of work will be precomputed and
represented in the rule– control strategy to search the problem space from
the initial state to the goal state – use algorithmic approach if needed during search– search when no direct method is known
8
AI Programming AI Programming LanguagesLanguages
Lisp (list processing)– atoms, list, functional programming language– a abc (ab abbc 3 test) (this is a test)– (car (abc sad fgh)) --> abc– (cdr (abc sad fgh)) --> (sad fgh)– (cons abb (abc sad fgh)) --> (abb abc sad fgh)) – (cond ((eq x 2) (+ x 4))
((> x 2) (- x 3))(t (* x 5)) )
Prolog (programming in logic)– rules, backward search
person(marcus).ruler(caesar).tryassassinate(marcus,caesar).hate(X,caesar) :- person(X), notloyalto(X,caesar).notloyalto(X,Y) :- person(X), ruler(Y),
tryassassinate(X,Y).
9
Production SystemsProduction SystemsProduction Systems– Clips (C Lang. Integrated Production System)
Control Strategies– It causes motion It is Systematic
Breadth-First Search– Not trapped in a blind alley– It is guaranteed to find an existing solution– If multiple solution, minimum solution is found
Depth-First Search– Requires less memory– Less search specially if there are many solutions
ControlControlStructureStructure
WorkingWorkingMemoryMemoryKnowledgeKnowledge
BaseBase
AgendaAgenda
10
Heuristic SearchHeuristic Search– Mobility systematically– no longer guaranteed the best answer, yet will almost
always finds a very good answer– points to interesting directions– may miss points of interest to particular case– Ex1: nearest neighbor (TSP)– Ex2: f(x,y) ----> f(x,x)
* squareset union identify functionkill suicide
Why we use heuristic?– People are not optimizer but rather satisficers– no very good in the worst case that rarely arise– lead to deep understanding of the problem
heuristics are introduced in search as:– rules by themselves– evaluation function - the more accurate, more direct
solution– Trade off between cost of evaluation of heuristic function
and saving in search time
11
Problem CharacteristicsProblem CharacteristicsAI The study of techniques for solving exponentially hard problem in polynomial time by exploiting knowledge about the problem domainProblem Characteristics– Decomposable problem
integrationblocks world problem
AC BA B C
– Solution steps can be ignored or undoneProve mathematical theorem (ignorable)8-puzzle (can be undone) (recoverable)
2 8 3 1 2 31 6 4 8 47 5 7 6 5
chess playing (irrecoverable ---> recoverable)
12
Problem CharacteristicsProblem CharacteristicsDifferent formulation lead to different c/cThe complexity of the control structure depends on the problem c/c
– Predictable problem8-puzzle - certain outcomecard game - uncertain outcomecontrolling a robot arm - legal assistant uncertain outcome + irrecoverable --> hard problem
– Absolute or relative good solutionany-path best-pathTSP
– A state or a path solutionNLU interested in the final interpretation
– The bank president ate a dish of salad with the forkwater jug how to get to the solutionstore the path with each state
– The role of knowledgeplaying chess medical diagnosis
– Interactive solutionCAD/CAM/CAITheorem provingMedical diagnosis
13
Problem ClassificationProblem Classification
– Classification (e.g. Diagnosis, selection)– Design - propose and refine
Production System Characteristics– Monotonic PS: Rule application never prevents
the other rules application– Partially Commutative PS: Any permutation of
a set of rule transforms state X to state YMonotonic Non- Monotonic
Partially Commutative Changes occur but can
Commutative Ignorable problems be reversed
Theorem proving Order is not criticalNo backtracking Robot, 8-puzzle
blocks world
Not Partially Irreversible changes
Commutative occurChemical synthesis
14
Design of Search ProgramDesign of Search Program– Forward versus backward reasoning (direction)– Matching– Knowledge representation (frame problem)– Search trees versus search graphs
Additional problem– Missionaries and cannibals
(farmer, grass, fox and goat)– The tower of Hanoi– Monkey and bananas – Cryptarithmetic
SEND DONALD CROSS+ MORE + GERALD + ROADSMONEY ROBERT DANGER
Summary– Define the problem, spesify problem space, the
operator, start state, goal state– problem characteristics– knowledge representation– Problem solving techniques
15
Knowledge RepresentationKnowledge Representation
Representation and Mapping– Facts: truths that we want to represent
(Knowledge level)– Representation: to be able to manipulate
(Symbol Level)
Facts Internal ResoningRepresentation
Understanding Generation
LanguageRepresentation
Example: Ahmed is a student => student(Ahmed)All students have classes => ∀x: student(x) --> hasclass(x)Ahmed has class <= hasclass(Ahmed)
The mapping is a many-to-many relationEvery student has a class– Mutilated Checkerboard
16
Properties ofProperties ofKnowledge RepresentationKnowledge RepresentationRepresentation Adequacy– The ability to represent the required knowledge
Inferential Adequacy– The ability to manipulate the knowledge
represented to produce new knowledge corresponding to that inferred from the original
Inferential Efficiency– The ability to direct the inferential mechanisms
into the most productive directions by storing appropriate guides
Acquisition Efficiency– The ability to acquire new knowledge using
automatic methods wherever possible rather than reliance on human intervention
17
Knowledge RepresentationKnowledge RepresentationApproachesApproaches
Simple Relational KnowledgeStudent Level GPA graduationAhmed Al-bader FR 3.25 2001Said Al-sheikh JR 2.87 1999Fahd Al-Baar SR 3.86 1998– Provide very weak inferential capabilities
Procedural Knowledge– what to do when– low in inferential adequacy and acquisition
efficiency
Inferential Knowledge– Resolution
Inheritable Knowledge– isa class inclusion– instance class membership
18
Issues in Knowledge Issues in Knowledge RepresentationRepresentation
Important AttributesRelationships among AttributesInversesAn Isa Hierarchy of AttributesTechniques for Reasoning about ValuesSingle-Valued AttributesChoosing the Granularity of RepresentationRepresenting set of ObjectsFinding the Right Structures as Needed– Selecting an Initial Structure
Index the structureconsider major conceptsLocate one major clue
– Revising the Choice When necessaryMake excuse
The Frame Problem
19
Predicate LogicPredicate Logic
Propositional & Predicate Logic– man(marcus) pompeian(marcus)– ruler(caesar) tryassassinate(marcus, caesar)– pompeian(X) --> roman(X)– roman(X)-->loyalto(X, caesar)Vhate (X, caesar)– man(X)^ruler(Y)^tryassassinate(X,Y) -->
~ loyalto(X,Y)prove hate(marcus,caeser)Resolution & unification – Many sentences are ambiguous– simple representation preclude reasoning– missing some information– instance and isa relations
Question and answeringNatural Deduction– judge(X) ^ ~crooked(X) --> educated(X)– ~ judge(X) V crooked(X) V educated(X)
20
ResolutionResolution– Resolution is not guaranteed to halt if given a
non-theorem to prove– Semantic information are lost in converting
from predicate to clause form– Difficult to interact with users– Difficulty to represent incomplete infromation:
very, often, assume, more, belief
Using RulesUsing RulesProcedural versus DeclarativeLogic Programming
logic prologvariables quant. explicitly implicitlyAND - OR ^ V , or
p --> q q :- p– Prolog: rules only, fixed control strategy
reason backward, depth first search– Clips: different KR, multiple control strategy,
reason forward
21
ReasoningReasoningForward versus Backward– more start states or goal states– branching factors– if justification is needed– type of event: arrival of new fact (forward)
query & response (backward)– Examples:
Driving unfamiliar place <----> home– same branching factor
Symbolic integration (forward)Theorem Proving (backward)
– bi-direction searchMatching– Indexing– Matching with variables (Rete-Match)• Rules do not change the state description radically• Structural similarity in rules• Persistence of variable binding consistency
• son(x,y) ^ son(y,z) ==> grandson(x,z)• son(ahmed, ali) and son(omar, saad)
22
MatchingMatching– Complex and Approximate Matching
Speech understandingELIZA: Psychology Therapist
Person: Men are all alike.ELIZA: In what way?Person: They’re always bugging us about something or other.ELIZA: Can think of a specific example?Person: Well, my boyfriend made me come here.ELIZA: Your boyfriend made you come here.Person: He says I’m depressed much of the time.ELIZA: I am sorry to hear you are depressed.Person: It’s true. I am unhappy.ELIZA: Do you think coming here will help you not be unhappy.Person: I need some help, that much seems certain.ELIZA: What would it mean to you if you gt some help?Person: Perhaps I could learn to get along with my mother.ELIZA: Tell me more about your family– Some ELIZA rules:(X me Y) ==> (X you Y)(I remember X) ==> (Why do remember X just now)(My {family-member} is Y) ==> (Who else in your family is Y)(X {family-member} Y) ==> (Tell me more about your family)
23
Conflict ResolutionConflict Resolution
Based on Rules– physical order -- give priority– reject general rules
preconditions set is a subset of another rule preconditionshave free variable
Based on objects– priority assigned to obejcts– most recent elements (Short term memory)
Based on states– evaluate the result of each rule
Control Knowledge– search control knowledge
which states are more preferable which rule to apply in a given situationorder to pursue subgoalssequence of rules to apply
– meta-knowledge
24
Reasoning under Reasoning under uncertaintyuncertainty
Monotonicity of reasoning system– Complete (all facts are present)– Consistent– Only way to change is to add facts
Non-monotonic issues– inferences based on lack of knowledge– ~P it is not known P– defeasible (may be defeated)– updating KB and changing the proofs
Statistical ReasoningStatistical ReasoningProbability and Bayes’ TheoremP(Hi/E) = P(E/Hi) . P(Hi )
∑kn=1 P(E/Hn) . P(Hn)
Fuzzy Logic
tallvery tall
height height
25
Slot and Filler StructuresSlot and Filler StructuresSemantic Nets– A set of nodes (concepts) connected by a set of
labeled arcs (relations)Mammal
has-partPerson Nose
uniform color instance teamblue Pee-wee-reese Brooklyn
– intersection search– non-binary predicates
John gave the book to Marygive book
agent instance instanceJohn Ev7 Bk23
beneficiary objectMary
– Making some important distinctionssome arcs define new entities (height)other describe relationships among existing entities (greater than, value)
John Billvalue height height
72 H1 H2Greater-than
– Partitioned semantic nets– The Evolution into frames
26
FramesFrames– A frame is collection of attributes and associated values
that describes some entity– Frames as sets & instances
Kinds of attributes– about the class itself– about the class member
Regular class and meta-classMultiple inheritance
– Slots as full-fledged objectsAttribute properties
– attribute class -- attribute type or value– shared values for all subclasses– default values -- single or multi value– rules for inheriting values– rules for computing values– an inverse attribute
attributes of attribute (frame)
Conceptual Dependency (Schank 1973-1975)provides both the structures and primitivesset of primitives and set of building blocksAdvantages: fewer inference rules
– initial structures have holes to be filledDisadvantages: need more primitives to represent more knowledge
27
ScriptsScriptsA script– Describes a stereotyped sequence of events.– Consists of a set of frames with default values– Points out between different events:
go restaurant, order, pay, leave– Fleet scripts (should not be activated)
Susan passed her favorite restaurant on her way to the museum
– Builds coherent interpretation from a collection of observation:
John went, ordered, paid, left– Did john eat dinner?
Why did waitress bring Susan a menu?– Because Susan asked to– So that Susan could decided what to eat
Focuses attention on unusual events– Waited for a long time, he got mad and left
CYC (D. Lenat 1990)Large knowledge-based for common sence projectrepresentation for events, objects, attributesissues of large scaleMotivation: brittleness, content focus not form, shared knowledgehand coded (10 million facts)
28
OntologyOntologySpecification of concepts to be used for expressing knowledge– What are categories?– How they are related to each other– Collection (superset/subset)/Individual (has
parts)Person - Nation - NoseAhmed - Qatar - Ahmed’s Nosesubstance (retains its properties)
– Intangible(no mass)/tangible(mass)/Compositesets - numbers - eventsperson’s body - an orange
– Intrinsic (color)/Extrinsic– Event (walking)/Process (walking2min)– slots -Time (intervals) – agents (subset of composite)
collectionindividualbeliefs
– Space - causality - structures– persistence of object through time
29
Knowledge Representation Knowledge Representation SummarySummary
Syntactic-Semantic Spectrum of Rep.– Predicate Logic -- Production Rules– Nonmonotonic Systems -- Statistical Reasoning– Semantic nets -- Frames– Conceptual Dependency -- Scripts– Objects
Syntactic Representation– problem solving methods– adequate for any problem– slow for hard problem
Semantic Representation– Stronger– More Effectively
KR systems– not just to hold knowledge– but also to provide inference procedures
Role of knowledge– define the search space and the criteria for determining a
solution to a problem (essential knowledge)– improve the efficiency of a reasoning procedure
(heuristic knowledge)