Lectures 7 and 8 - CSC 309 PDF
Document Details
![LightHeartedOnyx8787](https://quizgecko.com/images/avatars/avatar-12.webp)
Uploaded by LightHeartedOnyx8787
Pan-Atlantic University
Tags
Related
- APP002-4-2-IAI& Introduction to Artificial Intelligence Knowledge Representation - Uncertainty PDF
- Knowledge Representation I PDF
- Artificial Intelligence - Chapter 3: Knowledge Representation PDF
- AI Lecture Notes PDF
- Predicate Logic PDF - INF4067 - S8 - MAJ - IADS 2024-2025
- Lesson 5 Knowledge Representation and Frames PDF
Summary
These lecture notes from Pan-Atlantic University on Knowledge Representation (KR) cover predicate logic, animal classification, knowledge graphs, and semantic networks. The document includes examples to demonstrate these concepts.
Full Transcript
Lecture 7 Knowledge Representation (KR) Week 7: Knowledge Representation (KR) Objectives: By the end of this week, students will be able to: Explain different Knowledge Representation (KR) techniques Knowledge Representation (KR): In artificial intelligence, knowl...
Lecture 7 Knowledge Representation (KR) Week 7: Knowledge Representation (KR) Objectives: By the end of this week, students will be able to: Explain different Knowledge Representation (KR) techniques Knowledge Representation (KR): In artificial intelligence, knowledge representation, or KR, is the act of encoding information about the outside world into a format that a machine can comprehend, use for reasoning, and solve problems. It models facts and relationships using structures like graphs, and rules. AI systems can make judgments, deduce new information, and engage in meaningful interaction when KR is done well. Introduction to Knowledge Representation (KR): a. Predicate Logic Concept: Predicate logic represents relationships and facts in a formal, logical structure. It is commonly used in rule-based systems. Example: Animal Classification Scenario: Classify animals based on their characteristics, such as being a mammal, laying eggs, or flying. Facts (Predicate Logic): mammal(Dog) – Dog is a mammal. mammal(Bat) – Bat is a mammal. lays_eggs(Platypus) – Platypus lays eggs. flies(Bat) – Bat can fly. flies(Eagle) – Eagle can fly. Example: Animal Classification Rules: If an animal is a mammal and flies, it is a bat: mammal(X) ∧ flies(X) → Bat(X) If an animal is a mammal and lays eggs, it is a platypus: mammal(X) ∧ lays_eggs(X) → Platypus(X) Query: Is a bat a mammal? Answer: Yes, because mammal(Bat) is true. Does a platypus lay eggs? Answer: Yes, because lays_eggs(Platypus) is true. Is a dog capable of flying? Answer: No, because there is no fact stating flies(Dog). This example shows how predicate logic is used to represent facts and infer new knowledge based on rules. predicate logic predicate logic does not necessarily require rules to function. It can operate with just facts, depending on the use case. Facts Only: Predicate logic can simply represent static knowledge using facts, without any inference or derivation of new facts. Example: mammal(Dog) (Fact: A dog is a mammal) flies(Eagle) (Fact: An eagle can fly) Use Case: If you're only interested in storing and querying known information (e.g., a database of animal traits), then rules are unnecessary. Non-monotonic logic Non-monotonic logic differs from classical logic in that the conclusions can change when new information is introduced. In contrast, classical (or monotonic) logic assumes that once something is proven true, it remains true regardless of additional information. Example Initial Knowledge Base (Facts): mammal(Robin) (Robin is a mammal) flies(Robin) (Robin flies) Default Conclusions: From mammal(Robin) ∧ flies(Robin), we conclude: Bat(Robin) — Robin is classified as a bat. New Information (Exception): Suppose we receive new information: Robin is not a bat but a bird. This can be represented as: ¬Bat(Robin) ∧ bird(Robin) Revised Knowledge and Conclusion: The system retracts the conclusion that Robin is a bat because of the new fact: ¬Bat(Robin) The system updates its classification: bird(Robin)— Robin is a bird, not a bat. The rule mammal(X)∧flies(X)→Bat(X) no longer applies to Robin. Predicate logic vs Non-monotonic logic Knowledge Graph Example: A knowledge graph is an organized depiction of the connections between entities, with nodes standing in for entities (such as persons, places, or objects) and edges for the connections between them (such as "is a," "has," or "located in"). Complex data can be represented in a queryable, examined, and updated manner with the use of these graphs. Graph Entities: Students: Alice, Bob Courses: "AI 101," "Mathematics" Professors: Dr. Smith, Dr. Johnson Relationships: ALICE IS ENROLLED BOB IS ENROLLED DR. SMITH TEACHES DR. JOHNSON IN "AI 101". IN "AI 101". TEACHES "MATHEMATICS". "MATHEMATICS". Knowledge Graph Structure Key Queries: Which course is Alice enrolled in? Result: "AI 101". Who teaches "Mathematics"? Result: Dr. Johnson. Which students are enrolled in courses taught by Dr. Smith? Result: Alice. Semantic Networks Semantic networks are graphical representations of knowledge that depict relationships between entities in a structured form. Definition and Purpose "A semantic network is a directed or undirected graph that represents relationships between objects, concepts, or entities." Components of a Semantic Network Components of a Semantic Network Nodes: Represent objects, concepts, or entities. Edges: Represent relationships between the nodes (e.g., is-a, has-a, part-of). Types of Relationships in Semantic Networks Hierarchical Relationships (is-a): "A dog is an animal." Part-Whole Relationships (has-a): "A car has wheels." Associative Relationships: "A doctor treats patients." Inheritance in Semantic Networks Inheritance refers to how properties or attributes are passed from higher-level nodes (parent) to lower-level nodes (child) in a hierarchical semantic network. Single Inheritance "If mammals have lungs, then a dog, which is a mammal, also has lungs." Multiple Inheritance (when a node inherits properties from more than one parent) "A penguin inherits characteristics from both birds and aquatic animals." Benefits of Inheritance Reduces redundancy by avoiding repetitive declarations. Enhances efficiency in knowledge retrieval and organization. Frames in AI Frames are data structures for representing entities by organizing information into slots and fillers. Definition and Purpose "A frame is a structure for representing a concept or situation, containing various attributes (slots) and their associated values (fillers)." Components of Frames Frame Name: Represents the entity or concept. Slots: Attributes or properties of the entity (e.g., color, size, function). Fillers: Specific values assigned to the slots (e.g., color: red, size: large). Example of a Frame Frame: Car Slot: Color → Filler: Red Slot: Engine Type → Filler: Electric Slot: Manufacturer → Filler: Tesla Applications of Frames in AI Expert Systems: Representing domain-specific knowledge. Robotics: Storing and retrieving object-related information. Differences between Semantic Networks and Frames Semantic networks focus on relationships between concepts, while frames represent detailed attributes of a concept. Advantages and Limitations of Each Approach in AI Semantic Networks: Advantage: Good for hierarchical and associative reasoning. Limitation: Can become complex and inefficient with large data. Frames: Advantage: Efficient for storing detailed, structured knowledge. Limitation: Less effective at representing dynamic relationships. Real-World Applications of Semantic Networks and Frames in AI Systems Semantic Networks: Used in knowledge graphs, search engines, and NLP for context- based reasoning. Frames: Applied in expert systems, robotics, and context- aware systems to represent objects or scenarios.