HYPERSOLVER: A graphical tool for commonsense set theory

HYPERSOLVER: A graphical tool for commonsense set theory

NORTH- ttOIKAND HYPERSOLVER: A G r a p h i c a l T o o l for C o m r n o n s e n s e S e t T h e o r y Mb'JDAT PAKKAN Computer Engineering Department,...

814KB Sizes 0 Downloads 37 Views

NORTH- ttOIKAND HYPERSOLVER: A G r a p h i c a l T o o l for C o m r n o n s e n s e S e t T h e o r y Mb'JDAT PAKKAN Computer Engineering Department, Bo~azi~i University, 13ebek, 80815 istanbul, 7)zrkey and VAROL AKMAN* Department of Computer Engineering and Informatzon Science, Bilkent University, Bilkent, 06533 Ankara, 7~rkey

Communicated by Erol Gelenbe

ABSTRACT This paper investigates an alternative set theory (duc to Aczel) called the Hypersct Theory. Aczel uses a graphical representation for sets and thereby allows the representation of non-well-founded sets. A program, called ttYPERSOLVER, which can solve systems of equations defined in terms of sets in the universe of this new theory is presented. This may be a useful tool for commonscnse reasoning.

1.

INTRODUCTION

Set t h e o r y has long occupied a u n i q u e place in m a t h e m a t i c s since it allows various o t h e r branches of m a t h e m a t i c s to be formally defined w i t h i n it. T h e t h e o r y has ignited m a n y d e b a t e s on its n a t u r e a n d a n u m b e r of different a x i o m a t i z a t i o n s were developed to formalize its u n d e r l y i n g "philosophical" principles. Collecting entities into an a b s t r a c t i o n for f u r t h e r t h o u g h t (i.e., set c o n s t r u c t i o n ) is a n i m p o r t a n t process in m a t h e m a t i c s , a n d this brings in assorted p r o b l e m s [5]. T h e t h e o r y had m a n y g r o u n d - s h a k i n g crises (like *Corresponding author. Akman's research is supported in part by the Scientific and Technical Research Council of Turkey (rI'IIBiTAK), Grant No. TBAG-992. He wishc~ to thank tile following individuals for moral support: Prof. Patrick Suppes, Stanford University, Erkan "Fin, Bilkent University, and Dr. Wlodek Zadrozny, IBM Thomas J. Watson Research Center. Preliminary versions of this paper have been presented ms [1, 2, 3, 41.

INFORM.A TION SCIENCES 85, 43- 6 l (1995) (c)Elsevier Science Inc. 1995 655 Avenue of the Americas, New York, NY 10010

0020-0255/95 / $9.50 SSDI 0020-0255(94)00114-Q

44

M. P A K K A N A N D V. A K M A N

the discovery of the Russell's Paradox [6]) throughout its history, which were nevertheless overcome by new axiomatizations. Tile most popular of these is the Zermelo-Fraenkel axiomatization with "Choice" (ZFC). ZFC is an elegant theory which inhabits a stable place among other axiomatizations as the mainstream set theory. It provides a "hierarchical" framework. This hierarchy starts with only one abstract entity, the e m p t y set (0), forms sets out of previously formed entities cumulatively, and is therefore called the cumulative hierarchy. The coherence of this hierarchy is secured by the Axiom of Foundation (FA) which forbids infinite descending sequences of sets under the membership relation c, such as E a2 E al E a0 E a (thereby not allowing sets which can be constituents of themselves), and which has sometimes been regarded as a somewhat superficial limitation [6]. Sets which obey the FA are called well-founded sets. T h e cumulative hierarchy has providcd a precise framework for the formalization of m a n y mathematical concepts [7]. However, it may be asked whether the hierarchy is limiting, in the sense that it might be omitting some sets one would like to have around. Cyclic sets, i.e., sets which carl be members of themselves, are examples of such interesting sets which are excluded in ZFC. A set like a = {a} is strictly banned in ZPC by the FA since a has no member disjoint from itself. Such sets have infinite descending membership sequences and are called non-well-founded sets. Non-well-founded sets have generally been neglected by the practicing mathematician since the classical well-founded universe was a satisfying domain for his practical concerns. However, non-well-founded sets are useful in modeling various phenomena in computer science, viz. concurrency, databases, artificial intelligence (AI), etc. [8]. M c C a r t h y stressed the feasibility of using set theory in AI and invited researchers to concentrate on the subject in a 1985 speech [9]. Circularity is an often exploited property in various fields of AI, e.g., commonsense reasoning. Rehearsing an example of Perlis [10], if non-profit organizations are considered as individuals, then the organization of all non-profit organizations is a set. It is conceivable t h a t this umbrella organization (called N P O ) might want to be a member of itself in order to benefit from having the status of a non-profit organization (e.g., tax exemption). But this implies t h a t N P O must bc non-well-founded, i.e., N P O E NPO. This paper (also see [11]) investigates an alternative set theory, due to Aczel [12], which uses a graphical representation for sets and thereby allows the representation of non-well-founded sets. A program, called HYPF_2,SOLVER, which can solve systems of equations defined in terms of sets in the universe of this new theory is presented. .

.

.

A G R A P H I C A L T O O L F O R SET T H E O R Y

HYPERSOLVER:

2.

HYPERSET

45

THEORY

In this section we offer, using [8] and [13], a brief review of the Hyperset Theory, which is an enrichment of the classical ZFC set theory. It is the collection of all the conventional axioms of ZFC modified to be consistent with the new universe involving atoms, except that the FA is now replaced by the AFA (to be explained in the sequel). The sets in this theory are collections of atoms (urclements) or other sets, whose hereditary m e m b e r s h i p relation can be depicted by graphs. These sets may be well-founded or nonwell-founded, i.e., may have an infinite descending membership sequence, in which case they are also called hypersets. Sets can be pictured by means of directed graphs in an unambiguous manner. For example, a = {b, {c,d}} can be pictured by the graph in Figure 1. In this graph, each nonterminal node represents the set which contains the entities represented by the nodes below it. The edges of the graph stand for the hereditary membership relation such that an edge from a node n to a node rn, denoted by n --* m, mcans that m is a member of n. Since b, c, and d are assumed to contain no other entities as elements (i.e., they are urelements), there are no nodes below them. In Aczel's terminology [12], a pointed graph is a directed graph with a specific node called its point. A pointed graph is said to be accessible if for every node n, there exists a path no---*nl--* • •. ---,n from the point no to n. If this path is always unique, then the pointed graph is a tree and the point is its root. Accessible pointed graphs (apg's) will be used to "picture" sets. A decoration D for a graph is an assignment of a set to each node of the graph in such a way that D(n)

]" an atom or ~, {D(m): n --* m},

if n has no children, otherwise.

a

/ c

?

\ d

Fig. 1. T h e g r a p h r e p r e s e n t a t i o n of a = {b, {c, d}}.

46

M. P A K K A N A N D V. A K M A N

Fig. 2. The picture of the non-well-founded set ft = {.Q}. An apg G with point n is a picture of a if there exists a decoration D(n) = a, i.e., if a is the set that decorates the top node. An apg is called well-founded if it has no infinite paths or cycles. Mostowski's Collapsing Lemma states that every well-founded graph has a unique decoration. As a corollary, every well-founded apg is a picture of a unique well-founded set. A non-well-founded apg can never picture a well-founded set because if a is the set which contains all tile sets pictured by tile nodes occurring in a cycle of the non-well-founded apg, then it can be seen that no member of a is disjoint from a itself, violating the FA. Aczel's Anti-Foundation Axiom (AFA) states that every apg, wellfounded or not, pictures a unique set, or stated in other words, every apg has a unique decoration [12, 14]. The AFA has two implications: existence and uniqueness. The former assures that every apg has a decoration (which leads to the existence of non-well-founded sets besides well-founded ones) and the latter asserts that no apg h ~ more than one decoration. By throwing away the FA from the ZFC (and naming the resulting system Z F C - ) and adding the AFA, we obtain the Hyperset Theory. (a.k.a. ZFC-/AFA). One of the important advantages of the new theory is that, by allowing arbitrary graphs, non-well-founded sets are included. For example, the non-well-founded set ~ = {f~} is pictured by the apg in Figure 2, and by the uniqueness property of the AFA, this is the only set pictured by that graph. Therefore, there is a unique set which is equal to its own singleton in the universe of hypersets. The picture of a set can be unfolded into a tree picture of the same set. The tree whose nodes are the finite paths of tile apg which start from the point of the apg, whose edges are pairs of paths {n0 --~ . . . . n, no --~ . . . . n --* n~), and whose root is tile path no of length 1 is called the uT~foldin9 of that apg. The unfolding of an apg always pictures any set pictured by that apg. Unfolding the apg in Figure 2 results in the infinite tree in Figure 3, analogous to unfolding f~ = {f~} to ~ = {{{--.}}}. The uniqueness property of the AFA leads to an intriguing concept of extensionality for hyI)ersets. The classical extensionality paradigm, that

HYPERSOLVER:

A GRAPHICAL

TOOL

FOR SET THEORY

47

.

Fig. 3. Unfolding R to obtain an infinite tree.

sets are equal if and only if they have the same members, works fine with well-founded sets. However, this is not of use in deciding the equality of, say, a = (1, u} and b = {l, b} because it just asserts a = b if and only if a = b [$I. However, in the universe of hypersets, a is indeed equal to b since they are depicted by the same graph.r Aczel develops his own extensionality concept by introducing the notion of bisimulation. A bisimulation between two apg’s, Gr with point pi and Gz with point ps, is a relation R 2 G1 x Gs satisfying the conditions 1. P~RPZ, if nRm, then

2.

l

l

for every edge n ---f n’ of Gr, there exists an edge m + m’ of G2 such that n’Rm’, for every edge m -+ m’ of G2, there exists an edge n -+ n’ of Gi such that n’Rm’.

Two apg’s Gi and Gz are said to be bisimilar if a bisimulation exists between them; this means that they picture the same set. It can be concluded that a set is completely determined by any graph which pictures it. Therefore, for two sets to be different, there should be a genuine structural difference between them. For instance, the graphs in Figure 4 all depict the non-well-founded set fi because their nodes can be decorated with 0‘ The AFA has interesting applications. In [S], a modeling scheme for propositions (of natural language [15, 161) is offered. In this scheme, the lTo see this [S], consider a graph G and a decoration D assigning a to a node z of G, i.e., D(z) = a. Now consider the decoration D’ exactly the same as D except that D’(x) = b. D’ must also be a decoration for G. But by the uniqueness property of the AFA, D = D’, so D(z) = D’(z), and therefore a = b.

48

M. P A K K A N A N D V. A K M A N

Fig. 4. Other graphs depicting ~. 0 P = = >

{p,0}

if O0 p

Fig. 5. The picture of "This proposition is not expressible in eight words." t r i p l e (P,p,i} d e n o t e s t h a t p r o p o s i t i o n p has p r o p e r t y P if i -= 1, a n d it does n o t have it if i -- 0. 2 If p is t a k e n t o be, say, "This p r o p o s i t i o n is n o t e x p r e s s i b l e using eight words," t h e n it can be m o d e l e d b y t h e t r i p l e (E,p, O) w h e r e E (an a t o m ) d e n o t e s t h e p r o p e r t y o f b e i n g e x p r e s s i b l e (in English) using e i g h t words. In A c z c l ' s c o n c e p t i o n , p can b e d e p i c t e d as in F i g u r e 5 w h e r e t h e longest arc shows t h a t p refers to itself. 2Remember that in set theory, triples such as (x, y, z) are defined as pairs of pairs, i.e., (x, (y, z}}, and (y, z} is defined as {{y}, {y, z}}.

HYPERSOLVER:

3.

A GRAPHICAL TOOL FOR SET THEORY

49

SOLVING SYSTEMS OF H Y P E R S E T E Q U A T I O N S

T h e AFA has an important consequence which has useful applications allowing us to assert t h a t some sets exist without having to picture them with graphs. This will be motivated by the following example [12]. An equation of the form x = (0, x) in one variable x can be rewritten as x = {{0}; {0, x}}. This is equivalent to the following system of four equations in four unknowns:

{y, z}, y = {w}, =

z = { ~ , z}, W ~---0.

By the AFA, this system of equations has a unique solution pictured by the graph in Figure 6. Unfolding the original equation, one obtains x

=

>>.

This result can be generalized. For any set a, the equation x = (a, x) has a unique solution x = (a, (a, ( a , . . . ) ) ) . More generally, an infinite system of equations x0 = :

xl = (al, x2),

has

a

unique solution

xo -- >>, x, = >/, x2 = (a~, (a3, ,

Motivated by such examples, a technique to assert that every system of equations has a unique solution has been developed by Aczel [12]. Named the Solution L e m m a by Barwise and Etchemendy [8], this is formulated below. L e t ~ A be the universe of hypersets with atoms from a given set A. Let VA, be the universe of hypersets with atoms from another given set A t such t h a t A C A'. Let X be defined as A' - A. The elements of X can be considered as indete~'ninates ranging over the universe ]2A. Sets which can contain atoms from X in their construction are called X-sets. A system o f

50

M. P A K K A N A N D V. A K M A N X

J w=0 Fig. 6. The solution of the system x -~ {y,z}, y = {w}, z = {w,x}, w = 0.

equations is a set of equations. {x = ax: x • X A a~. is an X - s e t } for each x E X . For example, choosing X = { x , y , z } a n d A = { C , M } (thus A ~ = {x, y, z, C, M}), we m a y consider the system of e q u a t i o n s

= { c , y}, = z = {M, x}. (This s y s t e m will be used in the sequel for illustrative purposes.) A solution to a s y s t e m of e q u a t i o n s is a family of pure sets b~, (sets which can have only sets b u t no a t o m s as elements), one for each x • X , such t h a t for each x E X , bx = 7ra~. Here, rr is a substitution operation (defined below) a n d zra is the pure set o b t a i n e d from a by s u b s t i t u t i n g b~ for each occurrence of an a t o m x in the c o n s t r u c t i o n of a. T h e Substitution Lemma states t h a t for e ~ h family of pure sets b~ (x E X ) , there exists a u n i q u e o p e r a t i o n 7r which assigns a pure set 7ra to each X - s e t a, viz., 7ra = {srb: b is an X - s e t such t h a t b • a} kJ {~rx: x • a N X } . T h e Solution Lemma can now be s t a t e d [12]. If a~ is a n X - s e t , t h e n t h e s y s t e m of e q u a t i o n s x = a~ (x E X ) has a u n i q u e solution, i.e., a u n i q u e family of p u r e sets b~ such t h a t for each x E X, b~ = lra~. T h i s l e m m a can be s t a t e d s o m e w h a t differently [13]. L e t t i n g X a g a i n be the set of i n d e t e r m i n a t e s , g a f u n c t i o n from X to 2 X, a n d h a f u n c t i o n from X to A, there exists a u n i q u e f u n c t i o n f for all x E X such t h a t f ( x ) -- { f ( y ) : y e

u h(x).

HYPERSO],VER: A G R A P H I C A L

TOOL

FOR SET THEORY

51

O b v i o u s l y , g(x) is t h e set of i n d e t e r m i n a t e s a n d h(x) is t h e set of a t o m s in each X - s e t a~ of an e q u a t i o n x = a~. In t h e a b o v e e x a m p l e , .q(x) : {y}, :j(y)

:

z,

:

:

{C},

h(V)

= {C},

:

can c o m p u t e t h e s o l u t i o n

f(x) = {C, {C, { M , x } } } , f(y) = {C, {M, {C; y}}}, f(z) = {M, {C, { C , z } } } , easily. 3 T h i s t e c h n i q u e of soh, ing e q u a t i o n s in t h e universe of" h y p e r s e t s allows us to a s s e r t t h e e x i s t e n c e of s o m e sets (the s o l u t i o n s of t h e e q u a t i o n s ) w i t h o u t h a v i n g to d e p i c t t h e m w i t h g r a p h s . T h i s f e a t u r e can be of c o n s i d e r a b l e help in m o d e l i n g i n f o r m a t i o n which can be cast in t h e form of e q u a t i o n s . A n e x a m p l e c o n c e r n i n g s i t u a t i o n t h e o r y follows. Situation theory is a t h e o r y of m e a n i n g a n d i n f o r m a t i o n c o n t e n t develo p e d by B a r w i s e a n d P e r r y [17]. It tries to formalize a s e m a n t i c s for E n g l i s h in t h e w a y English s p e a k e r s h a n d l e i n f o r m a t i o n . A situation is a limited p o r t i o n of t h e reality. A n infon is an o r d e r e d list (R, a , i ) , w h e r e R is a r e l a t i o n , a is a p r o p e r sequence of a r g u m e n t s of R, and i is t h e p o l a r i t y (1 or 0). For a given R a n d a. only one of t h e two infons cr = (R. a, 1) or = (R, a~ 0) is a fact, n a m e l y t h e one which holds in some s i t u a t i o n s. (As a n o t a t i o n a l convention, a p o l a r i t y of 1 is u s u a l l y d r o p p e d . ) It is g e n e r a l l y h y p o t h e s i z e d t h a t s i t u a t i o n s a r e sets of facts a n d t h e r e f o r e can be m o d e l e d by sets to m a k e use of t h e e x i s t i n g s e t - t h e o r e t i c techniques. I n d e e d , this was t h e a p p r o a c h B a r w i s e a n d P e r r y a d o p t e d in [17]. However, using B a r w i s e ' s Admissible Set Theory [7] as t h e p r i n c i p a l m a t h e m a t i c a l tool in t h e b e g i n n i n g led to p r o b l e m s in t h e h a n d l i n g of circular s i t u a t i o n s a n d t h e y h a d to t u r n to t h e H y p e r s e t T h e o r y [18, 19]. To d e m o n s t r a t e c i r c u l a r s i t u a t i o n s , an e x a m p l e c o n c e r n i n g c o m m o n k n o w l e d g e will now be given, viz. t h e Conway paradox [20]. T w o c a r d players P1 a n d P2 a r e given s o m e c a r d s such t h a t each gets an ace. Thus, b o t h P1 a n d P2 know t h a t t h e following is a fact: or: E i t h e r PI or P2 has an ace. ~The Solution Lemma is an elegant r~ult, but not every system of equations has a solution. First of all, the equations have to be in the form suitable for the Solution Lemma. For example, ~ pair of equations x = {y,z}, y = {1,x} cannot be solved since this requires the solution to be stated in terms of the indeterminate z. (Notice the a,alogy to the Diophantine equations.) As another examplc~ the equation x = 2~ cannot be solved because Cantor has proved in ZFC- that there is no set which contains its own power set (no matter what axioms are added to Z F C - ) [6].

52

M. P A K K A N A N D V. A K M A N

When asked whether they knew if tile other one had an ace or not, they both would answer "no." If they are told that at least one of them has an ace and asked the above question again, first they both would answer "no." But upon hearing P1 answer "no," P2 would know that P1 has an ace. Because, if P1 does not know P2 has an ace, having heard that at least one of them does, it can only be becausc P1 has an ace. Obviously, Pl would reason the same way, too. So, they would conclude that each has an ace. Therefore, being told that at least one of them has an ace must have added some information to the situation. How can being told a fact that each of them already knew increase their information? (This is the Comvay paradox.) The solution relies on the observation that initially a was known by each of them, but it was not common knowledge. Only after it became common knowledge did it give more information. Hence, common knowledge can bc viewed as iterated knowledge of cr of the following form: P1 knows a, P2 knows a, P1 knows P2 knows a, P2 knows P1 knows a, and so on. This iteration can be represented by an infinite sequence of facts (where ~ is the relation "knows" and s is the situation in which the above game takes place, hence a E s):

(,~, Pl, 4 , (,~, P2, 4 , (,~, 1"1, (,~, P2, 8)), (,~, P2, (,~, P1, ~)), •. •. However, considering the system of equations

x = {(~, PI, y), (~, P2, y} }, y = ~ u {(,~, P l , y ) , (,~, P2,y)}, the Solution L c m m a asserts the existence of the unique sets s ~ and s U s' satisfying these equations, respectively, where

s ' = {(~, P1, ~ u s'), (~, g2, 8 u s')}. Then, the fact that s is common knowledge can be represented by s ', which contains just two infons and is circular. This is known as the fixedpoint account of common knowledge.

4.

THE IMPLEMENTATION

HYPERSOLVER is a stand-alone program which can solve equations in the universe of hypersets b:~ making use of the Solution Lemma. It has builtin graphical capabilities for displaying the graphs depicting the equations input by the user and the solutions of these equations. HYPERSOLYERis

HYPERSOLVER:

A GRAPHICAL TOOL FOR SET THEORY

53

HYPERSOLVER

FILENAME:

OPTIONS

Fig. 7. The command interface of HYPERSOLVER.

i m p l e m e n t e d on a S P A R C s t a t i o n ELC in Lucid C o m m o n Lisp. ~lb comm l m i c a t c with t h e user a n d to display graphs, it makes use of the XView W i n d o w Toolkit [21] built o n the X W i n d o w System. T h e user interface of HYPERSOLVER, called the c o m m a n d interface, is shown in F i g u r e 7.

4.1.

FUNCTIONALITY

HYPERS[}LVER solves a system of e q u a t i o n s in the universe of hypersets. B y a s y s t e m of e q u a t i o n s , the definition in Section 3 is m e a n t : { x = az: x E X a n d a~ is an X - s e t }

for each x E X , where X is a set of i n d e t e r m i n a t e s , A is a set of atoms, a n d a n X - s e t is a set which can c o n t a i n e l e m e n t s from X . HYPERSOLVER does not solve s y s t e m s which are n o t of ttiis form. 4 T h e n o t a t i o n a l c o n v e n t i o n s in HYPERSOLFER are as follows. Letters A t h r o u g h L are used to represent a t o m s of A, while letters M t h r o u g h Z r e p r e s e n t i n d e t e r m i n a t e s of X . T h e s y m b o l @ will be used to represent t h e n o n - w e l l - f o u n d e d singleton ft. ( O n e - l e t t e r variable n a m i n g m a y seem q u i t e limiting, b u t it is simple to a d o p t the parser to h a n d l e variables with 4Therefore, taking A = {0,1} and X = {x,y}, a system such as x = {0,1,y}, y = {x}, is a valid input for HYPERSOLVER,while the single equation 1 = {x,y, 0}, or the system x = {0, 1}, x = {x}, are not since 1 ~ X, and there should be a single equation for each x 6 X. HYPERSOLVERincludes some filtering functions to detect invalid input.

54

M. P A K K A N A N D V. A K M A N

7-~1-~i~,sai.V-Eii .....................................................................................................................................................................................................

Fig. 8. An example output of HYPERSOLVER.

longer names.) Therefore, the graphs of the solution given in Section 3 are depicted as in Figure 8. HYPERSOLVER gets its input from a file which is to be specified by the user. T h e file must have one equation per line. For example, a file consisting of the following lines is.a valid input file: x = {x,Y}, Y = {A,B,Y,Z},

Z = {X,Y,@}. T h e input read from the file is sent to the parser of HYPERSOLVER. T h e parser is a character-checking parser with a lookup table for the input characters. After converting the input into Lisp form, a transformation is applied to m a p it to a list t h a t can be processed by the equation solver. Finally, the input is checked to see whether it conforms to the input requirements of HYPERSOLVER (e.g., if it contains one equation for eazh indeterminate, if each equation is of the form x = ax, and SO o n ) .

T h e equation-solving step o f tile HYPERSOLVER applies the Solution L e m m a to the input system of equations. T h e alternative formulation mentioned in Section 3 is used for this purpose:

f(x)

: { f ( y ) : Y e g(x)} U

h(x),

for any set X of indeterminates where g is a function from X to 2 X and h is a function from X to a set A of atoms. For the input file above, g(X) = { X , Y } , 9(Y) = {Y,Z}, 9(Z) = { X , Y } and h(X) = 0,

HYPERSOLVER:

A GRAPHICAL TOOL FOR SET THEORY

55

h(Y) = {A, B}, h(Z) = {@} = @. This representation scheme is suitable for recursive substitution. The algorithm of the equation solver performs this substitution by applying the Substitution L e m m a to each cquation of the input system. So, the solution for an indeterminate X can be found by finding the solutions of the indeterminates in g(X) recursively. For each indeterminate, a decoration is found and the solutions are expressed in terms of these decorations. If the decoration for an indeterminate includes itself, then this denotes self-membership, and @ is used to signal that. For example, the decorations of the graphs for the above system of equations are (p,q, and r are the decorations for the indeterminates X, Y, and Z, respectively): p={@,{A,B,@,{p,

q,@}}},

q = {A,B,@,{{@, q},q, @}}, r = {{O,q},{A,B,@, r},@}. To prevent duplicate substitutions which arise when an indeterminate occurs two or more times in an X-set, a list of already visited indetcrminates is maintained. Nevertheless, because of the nature of recursion, duplication may occur in different levels of set nesting. Therefore, a kind of filtering is applied on the output of the solver to remove such duplicates. T h e next step is the invocation of the graph display part of the HYPERSOLVER. This part takes the solution of a system of equations produced by the equation solver as input. As the general graph layout algorithm, a variant of the hierarchical layout algorithm proposed in [22] is exploited. T h e reason to use a hierarchical layout algorithm instead of a generalpurpose algorithm is t h a t most of the equations to be solved by the Solution L e m m a will be hierarchical and t h a t self-reference generally occurs for a single indeterminate. (Figure 5 is a good example of this.) The algorithm which has been adapted to the representation conventions and output requirements of HYPERSOLVER first forms the edge list of tile solution system which consists of pairs of nodes. This list helps to get all children of each indeterminate. Then the nodes corresponding to these children are distributed to the levels taking care of the relationships between pairs of nodes. A more complicated part of the graph display unit is the one calculating the positions of the nodes on the screen. Tile hierarchical nature of the solution graphs is again exploited to make this calculation. T h e positions of the descendants of a node are calculated with respect to its own position, which in turn has been calculated with respect to its antecedents. After tile calculation of the positions, the actual graph-drawing procedure is activated to display first the nodes and later the edges. This

56

M. P A K K A N A N D V. A K M A N

l ~ ~ERSOLVER

I® Fig. 9. The

HYPERSQLVER

graph of fL

procedure pops up a large window (called the graph display window, G D W ) on which all graphical information is put. The output convention is such t h a t the node labels which are the decorations of the sets represented by those nodes are written inside the node boundaries. While the edges which define hereditary membership are easily drawn, care has to be taken in case of a cycle. Cycles implying self-reference are not displayed as circular edges, but are drawn in a different form. (Therefore, fl is depicted as in Figure 9.) Cycles of one level are not much of a problem. If there exists a cycle between two nodes a and b, then the directed edge (b,a) can be drawn over the directed edge (a, b) to give a doublc arrow. However, references to higher lcvels, especially to the root node representing the indeterminate, are problematic since a p a t h with minimum edge-crossing has to be found for aesthetic reasons. In such a case, paths walking around the graph are preferred (cf. Figure 12). Edge crossings may be unavoidable if no such p a t h can be found. The solution graphs of the above example are depicted in Figure 10. T h e displaying of the graphs depicting the input sets proceeds exactly the same way as the displaying of the solution system. For example, the

t[~ HYPEI~SOLVER

Fig. 10. Graphs depicting the solution to the example in Subsection 4.1.

HYPERSOLVER"

A GRAPHICAL TOOL FOR SET THEORY

57

~] HYPEHSOLVER

Fig. ] 1. Graphs of the input equations for the example in Subsection 4.1.

graphs of the input equations of the example system above can be found in Figure 11. ,~.2.

LIMITATIONS

AND ONGOING

WORK

HYPERSOLVER can solve any system which is in the form required by the Solution Lemma. This requires the equations to be in the form x -= ax for each x E X. The systems which cannot be solved by HYPERSOLVER are those to which the Substitution L e m m a cannot be applied. Such systems have been exemplified in Section 3. HYPERSOLVER is generally weak in i n p u t / o u t p u t operations. First of all, it has limitations on the format of the input, such as one-letter variable naming, and one equation per line in the input file with no space between the characters of the input equations. These limitations arise because of the brittleness of the parser. A more powerful parser would let HYPERSOLVER be more flexible with input, but the extra features would not add to the power of the program. T h e graph display unit is another weak part of HYPERSOLVER. G r a p h drawing is a hard problem when considered for general graphs with any number of nodes. Limiting the scope of the graph display problem as explained above reduces the difficulties considerably, but classical problems such as minimizing the number of edge-crossings remain. HYPERSOLVER's graph display unit does not claim to know much about the graph layout problem. The algorithm does not work well for arbitrary graphs with no coherent node relationships. However, it works fine for the examples presented so far. Graph-drawing problems arc addressed in [23-25], which propose generic graph browsers or editors. Future work on HYPERSOLVER will concentrate on its applications to modeling of various phenomena in AI. This may include, for example~ integrating HYPERSOLVER into a situation-theoretic framework [26] where the program m a y solve equations whose indeterminates can be unknown

58

M. P A K K A N A N D V. A K M A N [ ] HYPERSOLVER

Fig. 12. T h e gn~ph of a circular situation S = (R, P, S}. (N.B. Not all t h e s t r u c t u r e is shown.)

elements of situations, or unknown situations themselves. As a simple example, if a situation S is represented by the triple
par(a) = {x E X: x E T C ( a ) } , where TC(a) denotes the transitive closure of a, is called the set of parameters of a. If a'E VA, then par(a) = O, since a does not have any parameters. An anchor is a fimction f with domain(f) c_ X and ran.qe(f) c VA - A which assigns sets to indeterminates. For any a E ~2A[X] and anchor f, a(f) is the object obtained by replacing each indeterminate

HYPERSOLVER: A G R A P H I C A L T O O L F O R S E T T H E O R Y

59

x E par(a) (q domain(f) by the set f ( x ) in a. This can be accomplished by solving the resulting equations using HYPERSOLVER. 5.

CONCLUSION

T h e Solution L e m m a is a nice feature of the Hypersct Theory. Besides its m a t h e m a t i c a l importance and elegance, it provides an interesting way of modeling various circular phenomena [8, 28]. The implementation presented in this paper, HYPERSOLVER, is a program ba.~ed on the Solution L e m m a and can be a uscful tool in areas of AI where information can be c ~ t in the form of set equations. Its simplicity, clarity, and well-defined user interface make it a practical instrument accessible for such purposes. When supported by a more general parser and a better graphical interface, it can bc one of the emerging tools in mar, hcmatical logic, along the lines of, e.g., Suppes and Sheehan's computerized set theory course [29] or Barwisc and Etchcmendy's T a r s k i ' s World [30]. HYPERSOLVER m a y be an important utility for basic research on the use of set theory in AI, too [31]. Such research involving conceptual innovations is urgently nc~.ded in AI, as pointed out by McCarthy [32].

REFERENCES 1. 2. 3.

4.

5. 6. 7. 8. 9.

10.

V. Akman, Set theory from Zermelo to Aczel. Seminar, l)epartment of Mathematics, Bilkent University, Ankara, March 10, 1992. V. Akman, lIypersets and common sense. Seminar, Department of Computer Engineering, Middle East Technical University, Ankara, October 21, 1992. M. Pakkan, Solving equations in tile universe of hypersets..Master's thesis, Department of Computer Engineering and Information Science, Bilkent University, Ankara, Turkey, 1993. M. Pakkan and V. Akman, HYPERSOLVER: A graphical tool for commonsense set. theory. In Proceedings of the Ei.qhth h~ternational Symposium on Computer and Information Sciences (ISCIS VIII), L. Grin, R. C)nvnral, and E. Gelenbe, Eds., istanbul, 1993, pp. 436-443. J. IL Shoenfield, Axioms of set theory. In lIandbook of Mathematical Logic, J. Barwise, ed., North-tIolland, Amsterdam, 1977, pp. 321-344. A. A. Fraenkel, Y. Bar-Hillel, and A. Levy, Foundations of Set Theory. NorthHolland, Amsterdam, 1973. J. Barwise, Admissible Sets and Structures. Springer-Verlag, Berlin, 1975. J. Barwise and J. Etchemendy, The Liar: A n Essay on "lYuth and Circularity. Oxh)rd University Press, NY, 1987. J. McCarthy, Acceptance addre.~,~ of the International Joint Confe.rence on Artificial Intelligence (IJCAI-85) award for rc~earch excellence, Los Angeles, CA, 1985. D. Perils, Commonsense set theory. In Meta-Level Architectures and Reflection, P. Mats and D. Nardi, 'Eds., Elsevier (North-IIolland), Amsterdam, 1988, pp. 87- 98.

60

M. P A K K A N A N D V. A K M A N

11.

M. Pakkan and V. Akman, Issues in commonsense set theory. In Proceedings of the First Turkish Symposium on Artificial Intelligence and Neural Networks, K. Oflazer, V. Akman, and U. Halici, Eds., Bilkent University, Ankara, 1992, pp. 47-52. P. Aczel, Non-weU-founded sets. Number 14 in CSLI Lecturc Notes. Center for the Study of Language and Information, Stanford, CA, 5988. J. Barwise and L. Moss, Hypcrsets, Mathematical Intelligencer 13(4):31-41 (1995). .1. Barwise, AFA and the unification of information. In The Situation in Logic, number 17 in CSLI Lecture Notes, Center for the Study of Language and Inforrnation, Stanford, CA, 1989, pp. 277-283. C. McLarty, Anti-foundation and self-reference. Journal of Philosophical Logic 22:19-28 (1993). D. Perlis, Languages with self-reference I: Foundations. Artificial Intelligence 25(3):301-322 (1985). J. Barwise and J. Perry, Situations and Attitudes. MIT Press, Cambridge, MA, 1983. J. Barwise, Situations, sets, and the axiom of foundation. In The Situation in Logic, number 17 in CSLI Lecture Notes, Center for the Study of Language and Information, Stanford, CA, 1989, pp. 577-200. J. Barwise, Situated set theory. In The Situation in Logic, Center for the Study of Language and Information, Stanford, CA, 1989, Chap. 14. J. Barwise, On the model theory of common knowledge. In The Situation in Logic, number 17 in CSLI Lecture Notes, Center for the Study of Language and Information, Stanford, CA, 1989, pp. 201-220. D. tIeller, X V i e w Programming Manual. O'Reilly & Associates, Sebastupol, CA, 1990. L.A. Rowe, M. Davis, E. Me,~singer, C. Meyer, C. Spirakis, and A. Tuan, A browser for directed graphs. Software--Practice and Experience 17(1):65-76 (1987). E . R . Gansner, S. C. North, and K. P. Vo, D A G - - A program that draws directed graphs. Software--Practice and Experience 58(1l):1047-1062 (5988). T. Kamazia and S. Kawai, An algorithm for drawing general undirected graphs. Information Processing Letters 31:7-15 (1989). F . N . Paulisch and W. F. Tichy, EDGE: An extensible graph editor. Software-Practice and Experience 20 (S 1) :63-88 (1990). E. Tin and V. Akman, BABY-SIT: Towards a situation-theoretic computational environment. In CTtrrent Issues in Mathematical Linguistics, C. Martin-Vide, Ed., Elsevier Science B.V., Arrusterdam, 1994, pp. 299-308. M . W . Mislove, L. S. Moss, and F. J. Olcs, Partial sets. In Situation Theor T and its Applications /, R. Copper, K. Mukai, and J. Perry, Eds., number 22 in CSLI Lecture Notes, Center for the Study of Language and Information, Stanford, CA, 1990, pp. 117-131. L.S. Moss, Review of The Liar: A n Essay on Truth and Circularity. Bulletin of the American Mathematical Society 20(2):216-225 (1989). P. Suppes and J. Sheehan, CAI course in axiomatic set theory. In University-Level Computer-Assisted Instruction at Stanford: 1968-1980, P. Suppes, Ed., Institute for Mathematical Studies in the Social Sciences, Stanford University, Stanford, CA, 1981, pp. 3--80. J. Barwise and J. Etchemendy, The Language of First-Order Logic (including the Macintosh version of Tarski's World ~.0), 3rd ed. Number 23 in CSLI Lecture Notes. Center for the ,~tudy of Language and Information, Stanford, CA, 1993.

12. 13. 54.

15. 16. 17. 18.

19. 20.

21. 22. 23. 24. 25. 26.

27.

28. 29.

30.

HYPERSOLVER: A G R A P H I C A L T O O L F O R SET T H E O R Y 31.

32.

61

W. Zadrozny, Cardinalities and well orderings in a common-sense set theory. In Proceedings of the First International Conference on Principles of Knowledge Representation and Reasoning, R. J. Brachman, H. J. Levesque, and R. Reiter, Eds. Morgan Kaufmann, San Mateo, CA, 1989, pp. 486-497. J. McCarthy, Artificial intelligence needs more emphasis on basic research: President's quarterly message. A I Magazine 4:5 (1983).

Received 1 February 1993; revised 30 October 1994