arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Boolean operators in natural language

hashtag
Purpose of boolean operators

To say things such as pair ("peter","macbook") is either in relation ownsa or wantsa, requires us to use boolean operators ∪\cup ∪, ∩\cap∩, and −- − .

hashtag
Meaning

Let us explain the meaning of relational operators , , and by means of examples.

Assume we have a relation, ownsa[Person*LaptopType], which contains the persons who own a particular type of laptop. A fact "peter" ownsa "macbook" means that Peter owns a MacBook.

Also assume another relation wantsa[Person*LaptopType], which contains the persons who want a particular type of laptop. A fact "peter" wantsa "macbook" means that Peter wants a MacBook.

hashtag
Union

The sentence: "Peter owns a MacBook or Peter wants a MacBook." is represented as "peter" (ownsa wantsa) "macbook".

hashtag
Intersection

The sentence: "Peter owns a MacBook and Peter wants a MacBook." is represented as "peter" (label colour) "macbook".

hashtag
Difference

The sentence: "Peter owns a MacBook and Peter does not want a MacBook." is represented as "peter" (label colour) "macbook".

hashtag
Natural language templates

There is a pattern to this. A computer can generate a literal translation from the formula to natural language. However, that translation looks clumsy, verbose and elaborate. It is up to you to turn that in normal language. For examples . The systematic translation is given in the following table:

hashtag
Other explanation

Would you like a different explanation of the relational operators? explains the boolean operators in terms of set theory. An explanation in logic is given . for some algebraic rules about boolean operators. If you want to see it explained visually in Venn-diagrams, .

∪\cup ∪
∩\cap∩
−- −
∪\cup∪
∩\cap∩
−-−

Formally

Natural language template

a (r∪s) ba\ (r\cup s)\ ba (r∪s) b

a r b or a s b.

a (r∩s) ba\ (r\cap s)\ ba (r∩s) b

a r b and a s b.

a (r−s) ba\ (r-s)\ ba (r−s) b

a r b and nota s b.

click herearrow-up-right
This page
here
Click here
click here