.XQVWLJLQWHOOLJHQV01),7K VW )RUHOHVQLQJ Emner: Litt om intelligente agenter Kunnskapsrepresentasjon - intro Problemløsning - søkerom - problemtyper Predikatlogikk - basisformalisme for representasjon av kunnskap Intelligente agenter Agent = System og benyttes for å framheve systemer som vekselvirker med omgivelsene. En DJHQW er et system som VDQVHU, dvs. får inndata, fra en RPJLYHOVH via VHQVRUHU (inndatakanaler), og som KDQGOHU i denne omgivelsen via HIIHNWRUHU
Rasjonelle agenter En UDVMRQHOODJHQW er en agent som gjør de rette handlinger i en gitt situasjon. En handling kan være å skrive et ord på en skjerm eller å bevege en robotarm. En LQWHOOLJHQW DJHQW er en UDVMRQHOODJHQW, et system som oppfører seg rasjonelt i ulike komplekse og tildels ukjente situasjoner. En rasjonell agent er et system som : - har visse PnO det skal oppnå - har NXQQVNDS som gjør det istand til å oppnå sine mål - har PHWRGHU som anvender kunnskapen for å oppnå målene $JHQWHUVRPUHVRQQHUHUORJLVN Logisk resonnering er karakterisert ved: et representasjonsspråk for kunnskap der syntaks og semantikk er klart definert (et formelt språk) en metode for å resonnere (trekke slutninger) utifra denne kunnskapen Kunnskapen i en kunnskapsbase er brutt ned i enheter, f.eks. objekter, faktautsagn, delstrukturer. Her velger vi å snakke omdisse enhetene som VHWQLQJHU
.XQQVNDSVUHSUHVHQWDVMRQEDVLV Kunnskapsrepresentasjon i AI vil si å representere kunnskap LÃ et system, og IRUÃ dette systemet. Det er altså det intelligente systemets kunnskap - enten dette systemet er et menneske eller en maskin. En kunnskapsrepresentasjon består derfor av en kunnskaps-struktur i et visst språk, samt en tolkning som gjør at kunnskapen får mening for den som 'eier' kunnskapen. En representasjonsmetode består av en VSUnNV\QWDNV, og en XQGHUOLJJHQGHÃVHPDQWLNN definert av inferens-metoden. Uttrykkskraften av språket bestemmes av begge disse i sammen. En kunnskaps-struktur får mening ved at den gis en WRONQLQJÃ i den sammenhengen der den utnyttes. Kunnskapens meningsinnhold er derfor sjelden helt uavhengig av det formålet kunnskapen benyttes for og den sammenhengen den benyttes i. Ã Hvorvidt representasjonen har den mening vi ønsker, kan testes ved å stille spørsmål til systemet. )XQGDPHQWDOH.XQQVNDSVW\SHU Dyp kunnskap - fundamentale teorier, prinsipper - lærebok-kunnskap - detaljerte klasse/subklasse hierarkier - detaljerte system/komponent relasjoner - funksjonelle modeller - kausale modeller (årsak-virkning relasjoner) - forklarte situasjoner Grunn kunnskap - erfaringregler - overflatiske sammenhenger mellom domenebegreper (klasse/subklasse, system/komponent, funksjonalitet,...) - erfarte situasjoner
TILSTANDSROM måltilstander mellomtilstander starttilstand Et tilstandsrom er definert ved: en start-tilstand en eller flere mål-tilstander et sett av mellomtilstander et sett av operatorer som anvendt på en tilstand gir et sett av mulige etterfølgende tilstander SØKING I TILSTANDSROM måltilstander mellomtilstander Et tilstandsrom er en UHSUHVHQWDVMRQ av en problemløsningsstruktur. starttilstand traverserte søkeveier mislykkede noder aktive noder node der testing pågår Sentralt i enhver AI-metode er en eller flere V NHVWUDWHJLHUÃ for traversering av tilsstandsrommet (søkerommet) fra en starttilstand til en egnet måltilstand.
the predicate calculus representation of knowledge reasoning about this knowledge representation and reasoning propositional calculus and predicate calculus todays topic -Propositional and Predicate calculus: appropriate for representing and reasoning about symbolic knowledge Propositional Calculus is a representation language that can represent properties and relationships in the world, can reason about that knowledge. Propositional Calculus Syntax Semantics Symbols Sentences propositional symbols truth variables connectives are formed from symbols and connectives meaning
Symbols: the pieces that make up the language propositional symbols : P,Q,R. denote propositions truth symbols : true, false connectives :,,,, = Propositions are declarative sentences (facts), are either true or false. Examples: P: Today is wednesday. Q: The earth is round. Sentences: propositions are atomic sentences more complex sentences are formed from atomic sentences and connectives. Legal sentence:s atomic sentences (P,Q,R.. ) combination of atomic sentences and connectives. -followings are legal combined sentences: P Q (conjunction) P (negation) P Q (disjunction) P ^ Q (implication) P = Q (equivalence) - Legal sentences are also called well formed formulas.
Semantics Propositional calculus is also a method for determining whether a sentence is true or false. - the semantic(behaviour) of the connectives is captured in a diagram called a truth table On determination of truth value: Truth value of a proposition is determined according to a given state of the world. Truth value assignment to a set of propositions is called interpretation(a mapping from propositional sentences into the set { T,F} Truth value of a compound expression depends on the propositions and operators it contains. The precedence of logical operators for evaluation in a sentence is: NOT, AND, OR, IMPLY, EQUAL. The truth assignment of compound propositionas are often described in truth tables. Predicate Calculus: - is an extension of propositional calculus. differences from Propositional calculus: instead of representing entire proposition with a single symbol such as P: ball s color is red, the predicate calculus permits a representation that describes the relationship of the knowledge in a form of color(ball,red). In propositional calculus it is not possible to represent sentences having the words all or some. Example: It is not possible to perform the following reasoning in Propositional calculus: Premises: All children like chocolate. Mette is a child. Conclusion: Mette likes chocolate. Such a reasoning requires reasoning through the predicates`.
The syntax of predicate calculus : - ALPHABET SYMBOLS -letters (both upper & lower English l.) -underscore. -the set of digits -begin with a letter - may represent constants (begin with lowercase letter, represent specific objects & properties in the world, e.g. mette, blue, long. variables (begin with uppercase letters, denote general classes of objects or properties; X,Y functions (begin with lowercase letters,denote a mapping of one or more elements (argument) into an element in the domain. father (mette) maps to Arne (suppose he is her father) predicates (begins with lowercase letters) names a relationship between objects in the world. For functions & Predicates : f(t1,...tn), t1,...tn are terms p(t1,...tn) a term can be - a constant - a variable - a function expression Predicate : - The concept of predicate results from analyzing propositions or statements. -Consider the statement Mette likes chocolate. likes (mette, chocolate) in predicate calculus, where mette and chocolate are constant symbols and likes is a binary predicate symbol. the predicate symbol, likes, once defined can be applied to arbitrary pairs of constants to produce other propositions. likes (kirstin, flowers) it is even possible to use variables for arguments likes (kirstin, X) argument can also be filled with function symbols friend (father (mette), father (kirstin))
quantifiers: two new symbols -Universal : (for all) -Existential : (for some) -A quantifier is followed by a variable and a sentence y friends (y, peter) x likes (x, ice _cream) GRAMMAR: - Predicates & truth values are atomic sentences - more complicated formulas can be constructed from atomic formulas by combining them with connectives (S, S1, S2 are sentences, x is a variable) - S1 S2 - S1 - S1 S2 - S1 S2 - S1 = S2 - x S - x S ex : equal (plus (2, 3), seven) x foo (x, two, plus(two, tree)) - With connectives we can say things like If Clyde is an elephant, then Clyde is gray. But if we want to say something much more general: If anything is an elephant, then it is gray. To do this we need to introduce quantifiers Universal quantifiers : say that something is true for all possible values of a variable. X is a universally quantified variable in the formula in the scope of the variable x. (forall (X) f), we say that f is -ex: 1) Natural language: all elephants are gray: predicate logic: (forall (Z) (elephant(z) color( Z, gray)). (For all Z, if Z is an elephant, then Z is gray) 2) (forall (X) (X+X=2X) states that for every X (where X is a number) the sentence X+X=2X is true. Existential Quantifier: say that something is true for at least one member of the domain. examples: 1) X( X * X =1) 2) X(elephant(X) ^ name(clyde)) 3) X (philosopher(x) ^ computer_scientist(x))
The Semantics of the predicate Logic: The truth of an expression depends on the mapping of predicate calculus symbols into objects and relations in a given domain. How to determine the truth values? - represent objects and relatioships of the domain in the form of predicate calculus sentences - the truth of relationships in the domain determines the truth of the calculus expressions. Interpretation of a formula: 1- specifying a domain of m>= 1 elements, each element being identified by a constant; 2- each variable maps to a subset of elements in the domain. 3- defining the mapping of every n-argument function f(c1, c2,..., cn), where the c s symbolize constants from the domain; 4-assigning truth values for every n-argument predicate p(c1, c2,...,cn). Once a formula has been given an interpretation, the truth value of that formula can be evaluated.
Truth Value of Expressions for a given interpretation I and a domain D: 1. The value of a constant is an element in D 2. The value of a variable is a subset of elements of D 3. The value of a function is the result of its evaluation 4. The value of an atomic sentence is determined by the interpretation 5. The value of connected sentences is determined from the value operators as we have seen before. 6. The value of X S is true if S is true for all assignments to X under the interpretation, and is false otherwise 7. The value of X S is true if there is at least one assignment to X in the interpretation under which S is true, and is false otherwise. First order predicate calculus: - the predicate logic we have described is also called first order logic. * In first order logic, quantified variables may refer only to objects(constants) in the domain of discourse. if p and f are predicates and function symbols respectively, then p(p(x)) and f(p(f(x))) are not permitted to be formulae. For example likes (likes(george,kate) ) is not a wff.
Example: Blocks world c a b d on(c,a) on(b,d) ontable(a) ontable(d) clear(b) clear(c) hand_empty predicate calculus representation of the blocks world. - define a test which determines if a block is clear(does not have any block on top of it): - The following rule describes when a block is clear: X ( Y (on(y,x) clear(x) -We can define a new rule to put a block on top of another : stack(x,y); X Y((hand_empty ^clear(x) ^ clear(y) ^ pick_up(x) ^ put_down(x,y)) stack(x,y) where pick_up, put_down and stack are newly defined predicates. Using inference rules to produce predicate calculus expressions: - Inference rules are means to produce new sentences from already existing ones. are means to determine whether a consequence logically follows from particular premisses. - New expression must be consistent with existing ones. Defn:A new expression is said to be consistent or satisfiable if there is an interpretation that makes it true. ex: The assignment B=T, C=F, D=T satisfies the formula (((B OR C) AND NOT C) OR D) Defn: An expression is inconsistent or unsatisfiable if the wff is false in all interpretations. ex: inconsistent : p AND NOT P. Defn: Formula G is said to logically follow from formulae F1, F2,..., Fn if, and only if, every interpretation that satisfies the formula (F1 AND F2 AND...AND Fn) also satisfies G.
Defn: If the inference rule is able to produce every expression that logically follows from premisses, then it is said to be complete. Defn: A wff is valid if it is true in all interpretations, else it is invalid. ex: X(p(X) p(x)) is valid. p q is not valid since it is not true for p=t and q=f. Defn: a model is an interpretation in which the wff is true. ex: a model of p q is p=t and g=t. Defn: a wff is proved if it can be shown to be valid. A proof procedure is a combination of an inference rule and and algorithm which applies that rule to a set of logical expressions to generate new expressions. - Defn: If we prove in general that an inference rule applied to a set of premisses produces a formula that is a logical consequence of the premisses, then we say we have verified that the rule is sound (modus ponens is a sound rule). Ex: Modus ponens : P Q P --------- Q If we are given that P implies Q and if P is true, modes ponens infer that Q is true. Some other inference rules --modus tollens: P Q Q ---------- P -- elimination: if (P AND Q) is true, then both P and Q are also true. -- introduction: IF P and Q are true then the rule infers that (P AND Q) is also true. -- universal instantiation: If a formula is true for all elements in a domain, then it is true for specific elements in the domain. This rule infers p(a) from X p(x), where a is a constant in the domain.
-Some examples on MODUS PONENS: 1) Premisses: If it is raining then the ground will be wet. it is raining ---------------------- the ground is wet. 2) Premisses: All men are mortal Socrates is a man -------------------- Socrates is mortal This can be written in predicate logic as follows: X (man(x) mortal(x)) man(socrates) -------------------- mortal(socrates). 5HSUHVHQWDVMRQVPHWRGHU Predikatlogikk - matematisk syntaks; deduktiv inferens - typisk eks.: Teorembevis-system Regel-basert - syntaks er If-Then sammenhenger, med AND, OR, NOT operatorer og evt. usikkerhetsanslag; inferens er regel-lenking og usikkerhetsberegning. - eks.: Produksjonssystem Nettverk - begreper er noder, relasjoner er lenker; inferens er bl.a. arving langs utvalgte lenker, ellers i utganspunktet uspesifisert. - eks.: Taksonomisk hierarki Rammebaserte systemer - kan ses på som et nettverk der nodene er komplekse objekter; inferens som for nettverk, og typisk default arving, 'constraint propagation', og demoner (tilknyttede prosedyrer).