Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Most artificial intelligence systems are made up of two parts: 1) Knowledge base
It contains fact about objects and their relationship. It is a set of procedures that are used to examine the knowledge base in an orderly manner to answer questions, solve problems or make decisions within the domain
2) Inference mechanism
The 1st step in constructing an AI program is to build a knowledge base. In order to act intelligently, a computer must have a knowledge about the domain of interest. The process of collecting and organizing the knowledge is called knowledge engineering.
Knowledge representation scheme have generally been categorized as either declarative or procedural. A declarative scheme is one used to represent facts and assertions. A procedure representation scheme deals with the action or procedure.
Continue
Declarative knowledge representation methods include logic, semantic networks, frames and scripts. Procedural knowledge representation scheme include procedure or subroutine and production rules
Logical Representations
Semantic Networks
Production Rules Frames
Logic is the oldest form of knowledge representation Logic is the study of the methods and principles used to distinguish correct from incorrect reasoning. The scientific study of the process of reasoning and system of rules and procedures that aid in the reasoning process. There are two types of reasoning
Continued.
Deductive Reasoning
When a general premises are used to obtain a specific inference, the process is called deductive reasoning or deduction. Inductive Reasoning uses a number of establishes facts or premises in order to draw some general conclusion.
Inductive Reasoning
Syntax
How we can construct legal sentences in the logic Which symbols we can use (English: letters, punctuation) How we are allowed to write down those symbols How we interpret (read) sentences in the logic i.e., what the meaning of a sentence is Perfectly valid sentence (syntax) And we can understand the meaning (semantics) This sentence happens to be false (there is a counterexample)
Semantics
Propositional Logic
Syntax
Semantics
Need to know how connectives affect truth E.g., P and Q is true if and only if P is true and Q is true P implies Q is true if P and Q are true or if P is false
Natural language, ie English, Too ambiguous. Programming Language, ie C++ Lisp. Not very expressive. We will use logic! Actually there are many different logics. We will start by considering Propositional Logic. We will find that has some drawbacks so we will consider the more generalFirst-Order Logic Predicate Logic. This too, has limitations, so we will consider the Propositional Logic more general Predicate Logic First-Order Logic.
Vocabulary A set of propositional symbols P, Q, R, . A set of logical connectives , , , , (and) (or) (not) (implication) (equivalence) Parenthesis (for grouping) () Logical constants True, False
Each symbol P, Q, R etc is a (atomic) sentence Both True and False are (atomic) sentences A sentence wrapped in parentheses is a sentence
If and are sentences, then so are conjunction disjunction negation implication equivalence
The above are complex sentences
Precedence is
, , , ,
Truth Tables
Sample Sentences
P True (P Q)
(P Q) R (P Q) (Q P) (P R )
What do the sentences mean? The meaning depends on user defined semantics. If P is defined as it is hot and Q is defined as it is raining, then P PQ Q means it is hot means either is is hot or it is raining (or both) means that it is not raining
Construct a truth table, if (P Q) (P Q) is true for all values of P and Q, then we have proved it.
For any sentence, no matter how complex, we can always prove or disprove it this way. In other words, truth table construction is complete.
|-
Hot
If we know Irish implies hot is true, and know Irish is true, we can infer Hot is true. Read as
Irish Blue
|-
Blue
If we know Irish and Blue is true, we can infer that Blue is true. Read as
Irish, Red
|-
Irish Red
If we know Irish is true, and we know Red is true, we can infer that Irish and Red is true. Read as
Irish
|- Irish Green
If we know Irish is true, then we know that Irish or Green is true. Read as
Irish |- Irish
If we know not not Irish is true, we can infer that Irish is true. Read as
Irish Fast
If we know Irish or Red is true, and we know not Red or Fast is true, we can infer that Irish or Fast must be true. Read as
Many kinds of inference cannot be formalized in propositional logic. For example, most useful inference involve applying a general rule to a specific case. But general-to-specific inferences like the following cannot be formalized in propositional logic. All men are mortal Socrates is a man Therefore, Socrates is mortal This inference cannot be formalized in propositional logic because it refers to individual men, such as Socrates, and make generalizations about all men.
Propositional logic has only sentences, which represent facts. First-order logic extends propositional logic in two directions It provides an inner structure for sentences. They are viewed as expressing relations between objects or individuals. It provides a means to express, and reason with, generalizations. It makes it possible to say that a certain property holds of all objects, of some objects, or of no object.
Terms
First-order logic has terms that represent objects or individuals.
Terms are built using constant, variable, and function symbols. Constants(designate specific object): A, B, John, Red, etc. Variables (designate unspecified object): x, y, z, et Functions(designate a specific object related in a certain way to another object, or objects): FatherOf, ColorOf, etc. Examples of terms: ColorOf(CarOf(Bill)), CostOf(TextbookOf(CMPSCI383)), etc. Ground terms are terms that include no variables.
Predicates
Predicates
have a value of true or false A predicate can take arguments, which are terms A predicate with one argument expresses a property of an object Student(Bob) A predicate with two or more arguments expresses a relation between objects likes(Bob, Mary) likes(Bob, school-of (Bob)) A predicate with no arguments is a simple proposition, as in propositional logic
Universal Quantifier
x P(x) means for all x, P of x is true Example: x Happy(x) If the universe of discourse is people, then this means that everyone is happy. Other examples: x y Knows(x,y) => Knows(y,x) x y Knows(x,y) ^ Knows(y,x) x y Knows(x,y) => Likes(y,x)
Existential Quantifier
x P(x) means there exists at least one x for which P of x is true Example: x Happy(x) If the universe of discourse is people, then this means there is at least one happy person. Other examples: x y Knows(x,y) x y Knows(x,y) ^ Knows(y,x) x y Knows(x,y) => Likes(y,x)
Syntax allows
Constants, variables, predicates, functions and quantifiers Or something is true for at least one object (existential) Working out the truth of statement
Semantics
Example Sentence
In English:
(go_to(me, house_of(john)
eat(me, dinner))).
Translating is problematic
More expressive than first order predicate logic Allows quantification over functions and predicates, as well as objects For example
We can say that all our polynomials have a zero at 17: f (f(17)=0). Important to AI, but not often used
Other Logics
Fuzzy logic
Use probabilities, rather than truth values Assertions other than true and false allowed
Multi-valued logics
E.g., unknown
Modal logics
Temporal logics
Semantic Networks
Logic is not the only fruit Humans draw diagrams all the time, e.g.,
Graphical Representations
Graphs are very easy to store inside a computer For information to be of any use
Jason is 15, Bryan is 40, Arthur is 70, Jim is 74 How old is Julia?
Roger Schanks brainchild Concepts are nodes, relationships are edges Narrow down labels for edges to a very few possibilities Problem:
Not clear whether reduction to graphs can be automated for all sentences in a natural language
Conceptual Graphs
John Sowa Each graph represents a single proposition Concept nodes can be:
Concrete (visualisable) such as restaurant, my dog spot Abstract (not easily visualisable) such as anger Instead, we introduce conceptual relation nodes See Russell and Norvig for details
Advantage:
If so, the production rule fires and the action is carried out This is a recognize-act cycle Multiple production rules will fire at once Call this the conflict set Agent must choose from this set
102. After creating a new generalization G of Concept C Consider looking for non-examples of G
Frame Representations
Flexibility in Frames
Information for choosing a frame in a situation Relationships between this and other frames Procedures to carry out after various slots filled Default information to use where input is missing Blank slots - left blank unless required for a task Other frames, which gives a hierarchy
Example Frame