Fundamentals of Knowledge Engineering and Representation

1.1. What is Knowledge Engineering?

Definition: The application of logic and ontology to create computable models for solving domain-specific problems within constraints like budgets and deadlines.

Example: A knowledge engineer models a traffic light system where the light alternates between red and green automatically or can be manually controlled under special conditions.

2. Translating Informal Specifications

  • Challenge: Informal, natural language descriptions must be translated into precise, computable formats.
  • Example:
    • Informal Spec: “A traffic light automatically turns red or green but has manual control.”
    • Formal Spec:
      • Variables: currentColor (red/green), autoSwitch (on/off).
      • Rules:
        • If autoSwitch = on, green lasts gg seconds, then turns red.
        • If autoSwitch = off, manual inputs control the light.

3. Principles of Knowledge Representation

Knowledge representations serve multiple purposes in AI systems:

  1. Surrogate: Models real systems computationally (e.g., simulating a traffic light system).
  2. Ontological Commitments: Defines entities and relationships (e.g., variables like TrafficLight).
  3. Intelligent Reasoning: Enables logical deductions (e.g., predicting state changes).
  4. Efficient Computation: Supports algorithmic execution (e.g., state transition loops).
  5. Human Expression: Facilitates communication with domain experts (e.g., simplified graphs).

4. Approaches to Formalization

Declarative Approach

  • Describes system behavior with rules and axioms.
  • Example: Initial state (Light is red, autoSwitch = on); Deductive Rule (After rr seconds, the light turns green).

Procedural Approach

  • Uses step-by-step instructions to simulate system operations.
  • Example: while autoSwitch == "on" { set currentColor to "red"; wait r; set currentColor to "green"; wait g; }

5. Ontological Commitments

Defines the system’s structure through templates, frames, or schemas.

Example: Traffic Light in a rule-based system like CLIPS:

(deftemplate trafficLight (slot name (type SYMBOL)) (slot currentColor (allowed-values red green)) (slot redTime (type FLOAT)) (slot greenTime (type FLOAT)) (slot autoSwitch (allowed-values on off)))

6. Reasoning Strategies

  1. Procedural Loop: Step-by-step execution for sequential systems.
  2. Logical Formulas: Enables prediction or deduction.
  3. Forward-Chaining Rules: Automatically updates the system when conditions are met.

7. Medium for Human Expression

To communicate with domain experts, knowledge must be represented intuitively, such as through conceptual graphs or stylized English.

8. Knowledge Structures in AI

Representing knowledge structures is a key concept in AI that focuses on organizing information so computers can understand, store, and reason with it. Common methods include:

  • Semantic Networks: Use nodes and links to show relationships.
  • Frames: Structured data formats using slots and values.
  • Ontologies: Define a formal hierarchy of concepts.
  • Logic-based Representations: Use symbols and rules to support reasoning.

9. Rules and Data

Data provides the basic facts (e.g., “The traffic light is red”), while rules define how to derive new knowledge using IF–THEN logic (e.g., IF red THEN stop).

10. Object-Oriented Systems

Organizes information into objects containing data (attributes) and behavior (methods). Key features include encapsulation, inheritance, and polymorphism.

11. Natural Language Semantics

Semantics focuses on the meaning of language. In AI, it ensures systems interpret words based on context, such as distinguishing between a “riverbank” and a “financial bank.”

12. Levels of Representation

  1. Knowledge Level: Abstract representation of goals and facts.
  2. Logical (Symbolic) Level: Formal expression using logic (e.g., Human(x) → Mortal(x)).
  3. Implementation Level: Physical encoding in data structures and algorithms.