Unification, Number, List, Set, Assertion, Queries
Unification, Number, List, Set, Assertion, Queries
1. Assertions in FOL
🔹 Definition: Assertions are facts or rules added to a knowledge base (KB)
using the TELL operation.
🔹 Purpose: Assertions store known information about the world.
🔹 Example Assertions:
1. TELL(KB, King(John)) → "John is a King."
2. TELL(KB, Person(Richard)) → "Richard is a Person."
3. TELL(KB, ∀x King(x) ⇒ Person(x)) → "All kings are persons."
📌 Explanation: These facts and rules form the base knowledge, allowing AI to
infer new information.
2. Queries in FOL
🔹 Definition: Queries are questions asked to check whether a fact is true or
false in the knowledge base. Queries use the ASK operation.
🔹 Purpose: Queries retrieve information using logical inference.
🔹 Example Queries:
1. ASK(KB, King(John)) → Returns True, as it is already in KB.
2. ASK(KB, Person(John)) → Returns True, because of the rule ∀x King(x) ⇒
Person(x).
3. ASK(KB, ∃x Person(x)) → Returns True, since at least one person exists
(Richard or John).
📌 Explanation: If a query can be logically derived from KB, it returns True;
otherwise, it returns False.
3. Goals in FOL
🔹 Definition: A goal is a query where the system needs to find supporting
evidence.
🔹 Limitation: This only returns True, without specifying who the person is.
2. Sets in FOL
🔹 Definition: Sets allow us to group elements and perform operations like
union, intersection, and membership checks.
🔹 Key Elements:
{}: Empty set.
x ∈ s: Element x belongs to set s.
s1 ⊆ s2: s1 is a subset of s2.
s1 ∩ s2: Intersection of sets s1 and s2.
s1 ∪ s2: Union of sets s1 and s2.
{x | s}: Set formed by adding x to s.
🔹 Axioms for Sets:
1. Definition of sets: A set is either an empty set {} or formed by adding an
element to another set.
o ∀s Set(s) ⇔ (s = {}) ∨ (∃x,s2 Set(s2) ∧ s = {x | s2}).
2. The empty set has no elements:
o ¬∃x,s {x | s} = {}.
3. Adjoining an existing element does not change a set:
o ∀x,s x ∈ s ⇔ s = {x | s}.
4. Membership rule: x is a member of s if it was explicitly added or already
in the base set.
o ∀x,s x ∈ s ⇔ ∃y,s2 (s = {y | s2} ∧ (x = y ∨ x ∈ s2)).
5. Subset definition: A set is a subset of another if all its elements belong
to the other set.
o ∀s1,s2 s1 ⊆ s2 ⇔ (∀x x ∈ s1 ⇒ x ∈ s2).
6. Set equality: Two sets are equal if they are subsets of each other.
o ∀s1,s2 (s1 = s2) ⇔ (s1 ⊆ s2 ∧ s2 ⊆ s1).
7. Intersection rule: An element belongs to the intersection of two sets if it
is in both.
o ∀x,s1,s2 x ∈ (s1 ∩ s2) ⇔ (x ∈ s1 ∧ x ∈ s2).
8. Union rule: An element belongs to the union of two sets if it is in at least
one.
o ∀x,s1,s2 x ∈ (s1 ∪ s2) ⇔ (x ∈ s1 ∨ x ∈ s2).
📌 Explanation: These axioms allow set manipulation using FOL logic, making it
possible to reason about collections of objects.
3. Lists in FOL
🔹 Definition: Lists are ordered collections, unlike sets where order does not
matter.
🔹 Key Elements:
Nil: Empty list.
Cons(x, y): A list where x is the first element and y is the rest of the list.
Append(l1, l2): Concatenates two lists.
First(l): Returns the first element of l.
Rest(l): Returns all elements of l except the first.
Find(x, l): True if x exists in list l.
List?(l): True if l is a list.
🔹 List Notation (Syntactic Sugar):
Nil = [].
Cons(A, Cons(B, Cons(C, Nil))) = [A, B, C].
🔹 List Axioms:
1. Empty list is a valid list: List?([]).
2. Any list formed using Cons is a valid list:
o ∀x,l List?(l) ⇒ List?([x | l]).
3. First element of a list:
o ∀x,l First([x | l]) = x.
4. Rest of a list:
o ∀x,l Rest([x | l]) = l.
5. Appending lists:
o ∀l1, l2 Append([], l2) = l2.
o ∀x,l1, l2 Append([x | l1], l2) = [x | Append(l1, l2)].
6. Finding an element:
o ∀x, l Find(x, [x | l]) = True.
o ∀x, y, l Find(x, [y | l]) = Find(x, l).
📌 Explanation:
Lists allow ordered data representation.
They are recursive (defined in terms of smaller lists).
Cons, Append, and Find allow list operations like searching and merging.