1 / 43

Knowledge Representation: The Basics

Knowledge Representation: The Basics. Basic Knowledge-based system architecture. Inference Engine. User Interface. Knowledge Base. Knowledge-based System. User Interface. Inference Engine. Knowledge Base. Knowledge is explicitly represented in a knowledge base

adele
Download Presentation

Knowledge Representation: The Basics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Knowledge Representation:The Basics

  2. Basic Knowledge-based system architecture Inference Engine User Interface Knowledge Base Knowledge-based System

  3. User Interface Inference Engine Knowledge Base • Knowledge is explicitly represented in a knowledge base • System has knowledge and uses this knowledge to achieve its goals • Causal Link between knowledge and system’s behaviour

  4. Knowledge Representation Hypothesis Any mechanically embodied intelligent process will be comprised of structural ingredients that we as external observers naturally take to represent a propositional account of the knowledge that the overall process exhibits, and independent of such external semantic attribution, play a formal but causal and essential role in engendering the behaviour that manifests that knowledge Brian Smith, 1982

  5. Knowledge Representation Language • Formalism to represent “propositional account of knowledge” • Ingredients • Set of symbols • The alphabet for constructing legal expressions • Syntax • The rules that specify the set of legal expressions • Semantics • An approach to assign meaning to symbols in the language

  6. An example ( <relation-name> <term1> <term2> ) (works-with Enrico-Motta John-Domingue)

  7. ( setofall (var+) <log-expression>) Another example (setofall (?x) (or (works-with Enrico-Motta ?x) (works-with John-Domingue ?x)))

  8. Performing Inferences (involved-in-project John-Domingue AKT) (involved-in-project Enrico-Motta AKT) (=> (and (involved-in-project ?x ?p) (involved-in-project ?y ?p) (not (= ?x ?y))) (works-with ?x ?y))------------------ (works-with Enrico-Motta John-Domingue)

  9. Properties of an Inference System • Soundness • Inferences have to be truth-preserving • Computationally Tractable • Proofs should be carried out in polynomial time • Completeness • Everything which logically follows from a knowledge base should be actually derivable

  10. 1st order logic TP LOOM Prolog C++ Fundamental Trade-off Competence Efficiency

  11. The OCML Language • OCML= Operational Conceptual Modelling Language • Operational = Supported by an Interpreter • Conceptual Modelling = Emphasis on modelling functionality, rather than symbol-level efficiency • Originally defined as a environment to operationalise ontologies specified in Ontolingua

  12. 1st order logic TP LOOM, OCML Prolog C++ OCML in the Trade-off Competence Efficiency

  13. Modelling Primitives • Relations • Functions • Classes • Class Instances • Relation Instances • Rules • Procedures • Axioms

  14. Functional View of a Knowledge Base Knowledge Base Tell Ask

  15. Asserting Relation Instances (tell (involved-in-project enrico-motta akt)) (tell (involved-in-project john-domingue akt)) (def-relation-instances (involved-in-project enrico-motta akt) (involved-in-project john-domingue akt))

  16. Assertion-driven Inferences (def-rule declare-cool-person (involved-in-project ?x akt) then (exec (output "Cool Person ~s" ?x)))

  17. Constraint Checking as Assertion-driven Inference (def-rule Legal-involved-in-project (involved-in-project ?x ?y) then (or (not (person ?x)) (not (project ?y))) (exec (output "~%Bad assertion (involved-in-project ~s ~s)" ?x ?y)))

  18. Expressing Constraints in OCML (def-relation involved-in-project (?x ?project) "This relation associates people to projects" :constraint (and (person ?x) (project ?project)))) Logically: (=> (involved-in-project ?x ?p) (and (person ?x) (project ?p)))

  19. Querying a KB ? (ask (involved-in-project ?x ?y)) Solution: ((INVOLVED-IN-PROJECT JOHN-DOMINGUE AKT)) Solution: ((INVOLVED-IN-PROJECT ENRICO-MOTTA AKT))

  20. Goal-driven Inference (def-relation involved-in-project (?x ?project) "This relation associates people to projects" :sufficient (has-project-leader ?project ?x)) Logically: (=> (has-project-leader ?p ?x) (involved-in-project ?x ?p))

  21. Backward Chaining Rules (def-rule infer-involved-in-project ((involved-in-project ?x ?y) if (has-project-leader ?project ?x)))

  22. If and only if statements (def-relation involved-in-project (?x ?project) "This relation associates people to projects" :iff-def (or (has-project-member ?project ?x) (has-project-leader ?project ?X))) Logically: (<=> (or (has-project-member ?p ?x) (has-project-leader ?p ?x)) (involved-in-project ?x ?p))

  23. Proofs by Procedural Attachments • :Prove-by • Use to define an efficient mechanism to prove something • :Lisp-fun • Use when you want to prove something by resorting to Lisp code

  24. (def-relation enumerated-set (?x) "A set represented as (:set-of el1 el_2...el_n), where no el_i is repeated" :iff-def (and (= ?x (:set . ?elements)) (not (exists ?el (and (member ?el ?elements) (member ?el (remove1 ?el ?elements)))))) :prove-by (and (variable-bound ?x) (= ?x (:set . ?elements)) (not (exists ?el (and (member ?el ?elements) (member ?el (remove1 ?el ?elements)))))):no-proofs-by (:iff-def))

  25. Example of procedural attachment (def-relation POSITIVE-REAL-NUMBER (?x) :iff-def (and (real-number ?x) (> ?x 0)) :lisp-fun #'(lambda (x env) (let ((y (instantiate x env))) (if (and (realp y) (> y 0)) (list env) :fail))))

  26. Classes • Define collections of entities • Persons, Projects, Tigers, etc… • Semantics is the same as unary relations • Needed for • Modelling reasons • Mechanisms to structure a domain KB and for highlighting main categories of target domain • Operational reasons • Class taxonomies allow inheritance of properties • HCI Reasons • Easier to design and implement effective browsers/editors for hierarchical structures than for generic graphs

  27. INTANGIBLE-THING SOFTWARE-STATUS METHOD GENERIC-AREA-OF-INTEREST BUSINESS-AREA RESEARCH-AREA AWARD DEGREE FINANCIAL-AWARD EMPLOYMENT-CONTRACT-TYPE WORK-STATUS GENDER APPELLATION ORGANIZATION-SIZE ABSTRACT-INFORMATION ………………………………. THING TECHNOLOGY COMPUTING-TECHNOLOGY GENERALISED-MEANS-OF-TRANSPORT INFORMATION-TRANSFER-MEDIUM TRANSPORTATION-DEVICE INDIVIDUAL STRING QUANTITY TEMPORAL-THING ACTIVITY EVENT GENERIC-AGENT TANGIBLE-THING INTANGIBLE-THING ……………………

  28. Classes in OCML (def-class ORGANIZATION (legal-agent) "An organization is a type of legal agent" ((affiliated-people :type affiliated-person) (organization-part-of :type organization) (has-sub-unit :type organization-unit) (headed-by :type affiliated-person) (has-size :cardinality 1 :type organization-size) ))

  29. Semantics of Subclass-of (def-class organization (legal-agent)) (def-relation organization (?x)) (def-relation legal-agent (?x)) (=> (organization ?x) (legal-agent ?x))

  30. Semantics of type specifications (def-class ORGANIZATION (legal-agent) "An organization is a type of legal agent" ((affiliated-people :type affiliated-person))) (def-relation affiliated-people (?x ?y)) (=> (and (organization ?x) (affiliated-people ?x ?y)) (affiliated-person ?y))

  31. Semantics of cardinality specifications (def-class ORGANIZATION (legal-agent) ((has-size :cardinality 1 :type organization-size))) (def-relation has-size (?x ?y)) (=> (organization ?x) (and (exists (?y) (has-size ?x ?y)) (not (exists (?y1 ?y2) (and (has-size ?x ?y1) (has-size ?x ?y2) (not (= ?y1 ?y2)))))))

  32. Semantics of slot values (inheritance) (def-class SENDING-AN-EMAIL (information-transfer-event) ((sender-of-information :type generic-agent) (information-object-being-transferred :type email-message) (information-transfer-medium-used :value email-medium ))) (=> (sending-an-email ?x) (information-transfer-medium-used ?x email-medium))

  33. Using relation options in classes (def-class SMALL-OR-MEDIUM-SIZED-ORGANIZATION (organization) ?x "SME are important, so we define a class to represent them explicitly.In some case we might not know or we do not want to bother specifying exactly whether something is a small-organization or a medium-organization. Hence, we can just say 'x is a SME' without going into further detail." :iff-def (and (organization ?x) (has-size ?x ?size) (member ?size '(micro-size small-size medium-size))) :avoid-infinite-loop t)

  34. Specifying Functions (def-function rest (?l) "Returns the elements of a list but the first one. If the list is empty, then NIL is returned" :constraint (list ?l) :body (if (= ?l (?a . ?b)) ?b nil))

  35. Function Specification Options • :def. • Defines the function • :constraint. • Specifies a constraint on the domain of the function • :body. • Specifies how to compute the function • :lisp-fun. • Specifies a lisp function which is used to compute the function

  36. Example of :def spec (def-function ALL-SUBCLASSES (?class) -> ?subs "returns all subclasses of a class" :constraint (class ?class) :def (= ?subs (setofall ?sub (subclass-of ?sub ?class))) :lisp-fun #'(lambda (class) (let ((class-s (get-ocml-class class))) (if class-s (mapcar #'name (current-subclasses class-s))))))

  37. } { { } Semantics of Functions (def-function find-somebody-coworkers (?x) :body (setofall (?y) (works-with ?x ?y))

  38. Meta-level Mechanisms Holds. Meta-relation which makes it possible to test whether a relation is true for certain arguments Holds (?rel ?arg1…..?argn) iff (?rel ?arg1…..?argn)

  39. Entities ‘Right Entities’ Filter Criterion Filtering items according to some criterion Function

  40. Definition of Filter (def-function filter (?l ?rel) -> ?sub-l "Returns all the elements in ?l which satisfy ?rel" :body (if (null ?l) ?l (if (holds ?rel (first ?l)) (cons (first ?l) (filter (rest ?l) ?rel)) (filter (rest ?l) ?rel))))

  41. Summary • The essence of knowledge-based systems • Explicit representation of knowledge • Casual link between knowledge and behaviour • The importance of semantics • KB = Statements and inferences about a universe of discourse • Specification vs efficient implementation • Variety of representational constructs • Need for meta-level mechanisms • The world is not uni-dimensional!

  42. Modelling Task John Domingue, a senior research fellow in KMi, has a cat called Bugsy. John and his cat live at 100, Infinite Loop in Disneyland. A cat is a specific species of animal. John has been involved in the PatMan project. He formalised in OCML a medical guideline targeted at nurses and non-professional care givers.

More Related