Dulranga's Notes
Semester 3Artificial Intelligence

Knowledge Base

This is where the AI model represent things it has the knowledge of. There are two types of representations used.

  1. Propositional Logic
  2. First Order Logic
Important

Once you define your domain of interest, the entire knowledge base MUST be true for any entity in the domain. For example: if domain includes, professors, students, courses, grades

∀p ∃c    Prof(p)∧Course(c)∧Teaches(p,c)\forall p\,\exists c\;\; Prof(p) \land Course(c) \land Teaches(p,c)

This is not a valid expression. This tells, for everything in the domain is a professor, and he teaches a course. So even students, grades MUST be professors for this to hold true. Thus this is invalid

Important

Implications are always true when the first part is false.

P  ⟹  QP \implies Q

So if you want the Logic to be true only for some cases, Those need to be explicitly stated. Example: Bob is the only student who studies. means, There is only one student who studies, and that is Bob

Student(Bob)∧Studies(Bob)∧∀x ((Student(x)∧Studies(x))→x=Bob)Student(Bob) \land Studies(Bob) \land \forall x\,\big((Student(x) \land Studies(x)) \rightarrow x = Bob\big)

If we drop the first part, Student(Bob)∧Studies(Bob)Student(Bob) \land Studies(Bob), the implication will be true even when there is No student studying.

AABBA→BA \rightarrow B
TTT
TFF
FTT
FFT