Skip to content

Instantly share code, notes, and snippets.

@gulan
Created October 14, 2015 19:42
Show Gist options
  • Select an option

  • Save gulan/68798421d2c1fea5eae9 to your computer and use it in GitHub Desktop.

Select an option

Save gulan/68798421d2c1fea5eae9 to your computer and use it in GitHub Desktop.

Knowledge Representation

Say that red is a relation and b is an individual.

Is b red?

red(b).

What is red?

red(X).

(The terms are written in prolog query syntax. A lowercase argument serves as the name of an individual thing, Any uppercase argument is a variable. A variable may be instantiated to any individual that makes a query true.)

I want a transform that makes red an individual, yet loses no information. I need to invent a new relation and give it a name. 'Color' is the obvious choice.

red(Thing)
----------------        Generalize
color(Thing,red)

Assume that color has a domain of

{red, orange, yellow, green, blue, violet}.

This adds information to the model.

Is his_car red?

color(his_car,red). 

What is red?

color(X,red).

What color is his_car?

color(his_car,C).

We can repeat this transform,

color(Thing,Color)
-----------------------         Generalize
prop(Thing,color,Color)

Is his_car red?

prop(his_car,color,red). 

What is red?

prop(X,color,red).

What color is his_car?

prop(his_car,color,C).

Possible queries:

prop(b,color,red).
prop(b,color,V).
prop(b,P,red).
prop(b,P,V).
prop(T,color,red).
prop(T,color,V).
prop(T,P,red).
prop(T,P,V).

In common English usage, 'red' is an adjective. Are similar transforms possible with other adjectives?

hard, heavy, clear, old, expensive, beautiful

Going from red to color seemed obvious. It is not difficult to imagine other members of the domain of color. For other adjectives, it is not so easy.

x is hard if x is in {?}
y is heavy if y is in {?}

Of course much of the difficultly is that I have not specified a problem domain to narrow our understanding of the terms. If I say that we are concerned with geology, hardness is a physical unit.

Many of these properties are modal or temporal:

Bob thinks Mary is beautiful.
My car was expensive when it was new, but now it is cheap.

About which a discussion may be continued on another day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment