A Knowledgeable Model:
Network of C-Objects
Hoang Kiem - Do Van Nhon - Le Hoai Bac
Information Technology Department
University of Hochiminh City
227 - Nguyen Van Cu St., Dist. 5,
HoChiMinh City,
VIETNAM
Abstract
In this paper we propose a model that can be used for representing knowledge: network of C-objects. We
also discuss some problems on a network of C-objects, and prove the correctness of the algorithms used to
solve these problems. Algorithms have been implemented and tested carefully in various applications. In this
paper we bring out an application example: solving a geometry problem.
1 Network of C-Objects
1.1 C-Objects
In many problems we usually meet many different kinds of objects. Each object has attributes and internal
relations between them. Besides, objects can execute some actions and answer to requests from the outside.
As an example, a triangle with some knowledge (formulas, theorems, etc ...) is an object. The attributes of a
“triangle” object are 3 edges, 3 angles, .... A “triangle” object can also answer some questions such as “Is
there a solution for the problem to compute the surface from one edge and two angles?”.
Here we consider a kind of object called C-object. A C-object has the following characteristics:
1. A C-object has valued attributes. The set consists of all attributes of a C-object O will be denoted by
M(O). The figure 1 is the symbol of an object O ({x
1
, ..., x
k
} ⊆ M(O)).
2. There are internal relations between attributes of a C-object O. These are manifested in the following
features of the object:
- Given a subset A of M(O). The object O can show us the attributes that can be determined from A.
- The object O will give us the value of an attribute if we request it.
- It can also show us the internal process of determining the attributes.
figure 1: an C-object
1.2 Network of C-objects
Suppose O
1
and O
2
are C-objects. Between attributes of these C-ojects can have a relation f. We will call f
a relation between two objects O
1
and O
2
. For example, the value of the attribute a of O
1
is equal to the value
of the attribute b of O
2
will give a relation between O
1
and O
2
. This relation can be written by the expression
O
1
.a = O
2
.b. In general, we call a relation f between attributes of certain objects a relation between the objects.
A relation will help us deduce some attributes from the others.
Our network of C-objects will consists of a set of C-objects O = {O
1
,O
2
, ... , O
n
} and a set of relations F =
{f
1
,f
2
, ... , f
m
}. This network of C-objects is denoted by (O,F).
2 Problems On C-Object Network
Let (O,F) be a C-object network. We put
M(f
i
) = the set of attributes of C-objects in the relation f
i.
M(F) =
M(f
i
i 1
m
)
=
.
M(O) =
M(O
i
i 1
n
)
=
.
M = the set of attributes of C-objects are considered in certain problem.
M
i
= M ∩ M(O
i
), for i=1,2, ... , m.
By the above notations, M
i
is the set of attributes considered as of the object O
i
on the network of C-objects
(O,F).
We will suggest some algorithms that are completely proved. These algorithms give us the method to
solve the following problems:
Problem 1. Given sets of attributes A and B. The question is “Can we determine the attributes in B from
the attributes in A?”.
Problem 2. Suppose that we can determine the attributes in B from the attributes in A. The question is
“How is the process of determining attributes in B from attributes in A?”.
Let A ⊆ M be the set of attributes that are given, and B be the set of attributes that are needed to
determine. We denote the two problems by the notation:
A → B.
3 Algorithms
3.1 Definitions and notations
Let (O,F) be a network of C-objects, and M be a set of attributes. Suppose A is a subset of M. For each f ∈
F, we denote f(A) be the union of the set A and the set consists of all attributes in M deduced from A by f, and
we write:
A
f
→
f(A).
Similarly, for each C-object O
i
∈ O, O
i
(A) is the union of the set A and the set consists of all attributes (in
M) that the object O
i
can determine from attributes in A.
By the above notations, if t ∈ F ∪ O then we have t(A) ⊇ A.
Suppose D = {t
1
, t
2
, ..., t
m
} is a sequence of elements in F ∪ O. Put
A
0
= A, A
1
= t
1
(A
0
), . . .,
A
m
= t
m
(A
m-1
), and D(A) = A
m
,
we have A
0
⊆ A
1
⊆ . . . ⊆ A
m
= D(A) ⊆ M.
A problem A → B on a network (O,F) is called solvable if and only if there is a sequence D ⊆ F ∪ O such
that D(A) ⊇ B. In this case, we say that D is a solution of the problem.
3.2 Algorithms
To find out a solution for the problem A → B we can select relations and objects, and then we use them to
extend the set of attributes determined. Those actions can be repeated until all of attributes in B are
determined or until we cannot determine any more attribute. We have proved and tested the following
algorithms for solving the problem.
Algorithm 1. finding a solution.
Input : (O,F) is a network of C-objects,
M is a set of attributes,
A ⊆ M, and B ⊆ M.
Output : a solution of the problem A → B.
Algorithm :
1. Solution ← empty;
2. if B ⊆ A then
begin
Solution_found ← true;
{ Solution_found = true if solvable}
goto 5;
end
else
Solution_found ← false;
3. Repeat
Aold ← A;
Select f that is not considered yet;
while not Solution_found and
(the selection is successful) do
begin
if ( f symmetric and
0 < Card (M(f) \ A) ≤ r(f) )
or
( f not symmetric and
∅ ≠ M(f) \ A ⊆ v(f) ) then
begin
A ← f(A);
Solution ← Solution ∪ {f};
end;
if B ⊆ A then
Solution_found ← true;
Select f that is not considered yet;
end; { while }
Until Solution_found or (A = Aold);
4. if not Solution_found then
begin
Select O
i
∈ O such that O
i
(A) ≠ A;
if (the selection is successful) then
begin
A ← O
i
(A);
Solution ← Solution ∪ { O
i
};
if (B ⊆ A) then
begin
Solution_found ← true;
goto 5;
end;
else
goto 3;
end;
end;
5. if not Solution_found then
the problem has no solution;
else
Solution is a solution of the problem;
Algorithm 2. Find a good solution from an already solution known.
Input : (O,F) is a network of C-objects,
a solution {t
1
, t
2
, ..., t
m
} of
the problem A→ B.
Output : A good solution of
the problem A → B.
Algorithm :
1. D ← {t
1
, t
2
, ..., t
m
};
2. for i=m downto 1 do
if D \ {t
i
} is a solution then
D ← D \ {t
i
};
3. D is a good solution. �
3.3 Solving process
Consider a problem A→ B on a network of C-objects (O,F). In this section we state a method to construct
the solving process from a solution. With a solution, it is possible that we determine some redundant
elements. Therefore we need to consider the process of applying relations in the solution, and determine only
necessary elements to solve the problem. The following theorem give us an analysis (depending on the
solution) the sets of elements, and we can construct a process for determining necessary attributes.
Theorem. Let {t
1
, t
2
, ..., t
m
} be a good solution of the problem A → B on a network of C-objects
(O,F). Put
A
0
= A, A
i
= {t
1
, t
2
, ..., t
i
}(A), for i=1,...,m.
Then there exists a sequence {B
0
, B
1
, ..., B
m-1
, B
m
} consists of subsets in M satisfying the following
conditions:
(1) B
m
= B.
(2) B
i
⊆ A
i
, for i=0,1,...,m.
(3) for i=1,...,m, {t
i
} is a solution of the problem B
i-1
→ B
i
but it is not a solution of the problem G → B
i
,
where G is an arbitrary subset in B
i-1
and G ≠ B
i-1
.
4 Application Example
Now we state an application example: solve a geometry problem. This example is solved by a
program written in the programming language C++. The program gave us a good solution.
Figure 2.
In the above figure 2, suppose that AB = AC, the values of the angle A and the edge BC are given.
ABDE and ACFG are squares. Compute EG.
The problem can be considered on the network of C-objects as follows:
1. Four objects :
O
1
: triangle ABC , with AB = AC,
O
2
: triangle AEG,
O
3
: square ABDE,
O
4
: square ACFG.
2. The relations between objects :