# 5.1.3 subsume

## Introduction

The "subsume" goal is used to check whether one CG is more general than another CG.

## Signature

`subsume(g1,g2)`

## Operation

The subsume goal checks whether the CG g1 is more general than the CG g2.

Here are ways to generalize a graph:

• A subgraph is a generalization.
• Replacing a conceptual type with one of its supertypes causes a generalization.
• Erasing a referent causes a generalization.

## Example

```// Type-hierarchy
Entity > Animal, Act.
Animal > Carnivore, Herbivore.
Act > Eat, Persuade.

// Catalog of instances
Carnivore = Wolf, Fox.
Herbivore = Lamb, Chicken.

// Graph facts
gr(graph1, [Carnivore: Wolf]<-AGNT-[Eat]-PTNT->[Herbivore: Lamb]).
gr(graph2, [Carnivore: Fox]<-AGNT-[Persuade]-PTNT->[Herbivore: Chicken]).

// Rules
CarnivoreEatsAnimal(L) :- gr(L, G),
subsume([Carnivore]<-AGNT-[Eat]-PTNT->[Animal], G).
AnimalActsOnAnimal(L) :- gr(L, G),
subsume([Animal]<-AGNT-[Act]-PTNT->[Animal], G).
AnimalPersuades(L) :- gr(L, G),
```

## Explanation

First, we have the usual type-hierarchy and catalog of instances.

Then we have two facts called "gr" which specify two CGs. The CGs are given the names "graph1" and "graph2".

Lastly, we have three rules. They all take a formal parameter called "L" (for "label"). The first thing they then do is to call the "gr" facts to get the label and the graph of each "gr" fact. Then they use the "subsume" goal to check something.

In the following, we describe each of the rules in turn.

### CarnivoreEatsAnimal

The CarnivoreEatsAnimal rule finds those graphs in which a carnivore eats an animal.

We repeat it here:

```CarnivoreEatsAnimal(L) :- gr(L, G),
subsume([Carnivore]<-AGNT-[Eat]-PTNT->[Animal], G).
```

If we ask the following query:

`?- CarnivoreEatsAnimal(L).`

we get the following answer:

`{L = graph1}`

This is because the only graph which subsumes the graph in CarnivoreEatsAnimal is graph1.

### AnimalActsOnAnimal

The AnimalActsOnAnimal rule looks for a more general graph.

```AnimalActsOnAnimal(L) :- gr(L, G),
subsume([Animal]<-AGNT-[Act]-PTNT->[Animal], G).
```

Here, the graphs in the "gr" facts are checked for subsumption with a graph that just says than an animal is an agent of an act which has a patient which is an animal.

This is more general than both of the graphs in the example, because:

• All types in the graph in the rule (Animal, Act) are supertypes of the actual types in the "gr" graphs (Carnivore, Herbivore, Eat, Persuade).
• The referents have been erased.

If we ask the following query:

`?- AnimalActsOnAnimal(L).`

we get the following answer:

```{L = graph1}
{L = graph2}
```

This reflects the facts that the graph in the rule is a generalization of both graphs.

The AnimalPersuades rule finds graphs in which an animal is the agent of persuade.

```AnimalPersuades(L) :- gr(L, G),
```

This finds only graph2:

```?- AnimalPersuades(L).

{L = graph2}
```

The graph in the rule is a generalization of graph2 because:

• One of the type-labels of graph2 (Carnivore) has been replaced with a supertype (Animal).
• One of the referents of graph2 (Fox) has been erased.
• The graph in the rule is a subgraph of graph2, with appropriate supertype-replacements and referent-erasures.

## Summary

Thus the subsume goal checks whether a graph g1 is a generalization of graph g2. Generalizations arise through three procedures, namely subgraphing, replacement of types by a supertype, and erasure of referents.

PrevLite: 5.1.2 concOfCG
NextLite: 5.1.4 generalize

Prev: 5.1.2 concOfCG
Up: 5.1 CG goals
Next: 5.1.4 generalize