In this section, we present two types of extensions of the MGTP system in terms of constraint solving. Those extensions aimed at solving constraint satisfaction problems in MGTP efficiently. MGTP presents a general framework to represent and solve first order clauses, but sometimes it lacks the ability of constraint propagation using the problem (or domain) structures.
We consider, as an example, quasigroup (QG) existence problems in finite algebra [3]. This problem can be defined as finite-domain constraint satisfaction problems. In solving these problems, we found that the negative information should be propagated explicitly to prune redundant branches. This ability has been realized in the extension of MGTP, called CMGTP. Another example we consider here is channel routing problems in VLSI design. For these problems, it is needed to propagate intervalconstraint information as wellas negative information. This additional propagation ability has been realized in the other extension of MGTP, called IV-MGTP.
CMGTP. In 1992, MGTP succeeded in solving several open quasigroup (QG) problems on a parallel inference machine PIM/m consisting of 256 processors [13]. Later, other theorem provers or constraint solvers such as DDPP, FINDER, and Eclipse solved other new open problems more efficiently than the original MGTP. Those researches have revealed that the original MGTP lacked negative constraint propagation ability. This motivated us to develop CMGTP [28,50] that allows negated atoms in the MGTP clause to enable it to propagate negative constraints explicitly.
Quasigroup Problems. A quasigroup is a pairQ,◦ whereQis a finite set,◦a binary operation onQand for anya, b, c∈Q,
a◦b=a◦c⇒b=c a◦c=b◦c⇒a=b.
The multiplication table of this binary operation ◦ forms a Latin square (shown in Fig. 14).
QG problems we tried to solve are classified to 7 categories (called QG1, QG2, ..., QG7), each of which is defined by adding some constraints to original quasigroup constraints. For example, QG5 constraint is defined as ∀X, Y ∈Q.
((Y ◦X)◦Y)◦Y =X. This constraint is represented with an MGTP clause:
p(Y, X, A)∧p(A, Y, B)∧p(B, Y, C), X=C→. (1) From the view point of constraint propagation, rule (1) can be rewritten as follows2:
p(Y, X, A)∧p(A, Y, B)→p(B, Y, X). (2)
2 In addition, we assume functionality in the arguments ofp.
◦ 1 2 3 4 5
1 1 3 2 5 4
2 5 2 4 3 1
3 4 5 3 1 2
4 2 1 5 4 3
5 3 4 1 2 5
Fig. 14.Latin square (order 5)
p(Y, X, A)∧p(B, Y, X)→p(A, Y, B). (3) p(B, Y, X)∧p(A, Y, B)→p(Y, X, A). (4) These rules are still in the MGTP representation. To generate negative con- straints, we add extra rules containing negative atoms to the original MGTP rule, by making contrapositives of it. For example, rule (2) can be augmented by the following rules:
p(Y, X, A)∧ ơp(B, Y, X)→ ơp(A, Y, B). (5) p(A, Y, B)∧ ơp(B, Y, X)→ ơp(Y, X, A). (6) Each of the above rules is logically equivalent to (2), but has a different operationalmeaning, that is, if a negative atom is derived, it can simplify the current disjunctive clauses in the disjunction buffer D. This simplification can reduce the number of redundant branches significantly.
CMGTP Procedure. The structure of the modelgeneration processes in CMGTP is basically the same as MGTP. The differences between CMGTP and MGTP are in the unit refutation processes and the unit simplification processes with negative atoms. We can use negative atoms explicitly in CMGTP to represent constraints. If there exist P and ơP in the current modelcandidate M, then f alse is derived by the unit refutation mechanism. If for a unit clause ơPi ∈ M(Pi∈M), there exists a disjunction which includesPi(ơPi), then Pi(ơPi) is removed from that disjunction by the unit simplification mechanism.
The refutation and simplification processes added to MGTP guarantee that for any atom P ∈M,P and ơP are not in the currentM simultaneously, and disjunctions in the currentDhave already been simplified by all unit clauses in M.
Experimental Results. Table 1 compares the experimental results for QG prob- lems on CP, CMGTP and other systems. CP is an experimental program written in SICStus Prolog, that is dedicated to QG problems [50]. In CP, the domain variable and its candidates to be assigned are represented with shared variables.
The number of failed branches generated by CP and CMGTP are almost equalto DDPP and less than those from FINDER and MGTP. In fact, we
Table 1.Comparison of experimentalresults for QG5 Failed Branches
Order DDPP FINDER MGTP CP CMGTP IV-MGTP
9 15 40 239 15 15 15
10 50 356 7026 38 38 52
11 136 1845 51904 117 117 167
12 443 13527 2749676 372 372 320
confirmed that CP and CMGTP have the same pruning ability as DDPP by comparing the proof trees generated by these systems. The slight differences in the number of failed branches were caused by the different selection functions used.
For generalperformance, CP was superior to the other systems in almost every case. In particular, we obtained a new result in October 1993 that no modelexists for QG5.16 by running CP on a SPARCstation-10 for 21 days. On the other hand, CMGTP is about 10 times slower than CP. The difference in speed is mainly caused by the term memory manipulation necessary for CMGTP.
IV-MGTP. In MGTP (CMGTP), interpretations (called model candidates) are represented as finite sets of ground atoms (literals). In many situations this turns out being too redundant. Take, for example, variables I, J ranging over the domain{1, . . . ,4}, and interpret≤, + naturally. A rule like “p(I)∧ {I+J≤ 4} →q(J)” splits into three model extensions:q(1),q(2),q(3), ifp(1) is present in the current modelcandidate. Now assume we have the rule “q(I)∧q(J)∧{I= J} →.” saying thatqis functionalin its argument and, say,q(4) is derived from another rule. Then all three branches must be refuted separately.
Totally ordered, finite domains occur naturally in many problems. In such problems, situations such as the one just sketched are common. Thus we devel- oped an IV-MGTP system [19] to enhance MGTP with mechanisms to dealwith them efficiently.
Introducing Constrained Atoms into MGTP. In order to enhance MGTP with totally ordered, finite domain constraints, we adopt the notation:p(t1, . . . , tr, S1, . . . , Sm) for what we call aconstrained atom. This notation is motivated from the viewpoint of signed formula logic programming (SFLP) [37] and constraint logic programming (CLP) over finite domains [41].
Constrained atoms explicitly stipulate subsets of domains and thus are in solved form. The language of IV-MGTP needs to admit other forms of atoms, in order to be practically useful in solving problems with totally ordered domains.
An IV-MGTP atom is an expression p(t1, . . . , tr, κ1, . . . , κm), where theκi has one of the following forms:
1. {i1, . . . , ir}, where ij∈N for 1≤j≤r (κi is in solved form);
2. ]ι1, ι2[, whereιj(j= 1,2)∈N∪CVar; the intended meaning is ]ι1, ι2[ ={i∈ N|i < ι1 ori > ι2};
3. [ι1, ι2], whereιj(j= 1,2)∈N∪CVar; the intended meaning is [ι1, ι2] ={i∈ N|ι1≤i≤ι2};
4. U ∈DVar.
where CVaris a set ofconstraint variableswhich hold elements from a domain N, andDVaris a set ofdomain variableswhich hold subsets of a domainN. In this framework, since intervals play a central role, we gave the name IV-MGTP to the extension of MGTP.
For each predicate p with constrained arguments, an IV-MGTP program contains adeclarationline of the form “declarep(t, . . . , t, j1, . . . , jm)”. If thei-th place ofpist, then the i-th argument ofpis a standard term; if thei-th place of pis a positive integer j, then the i-th argument ofpis a constraint over the domain{1, . . . , j}.
Each IV-MGTP atomp(t1, . . . , tr, κ1, . . . , κm) consists of two parts: the stan- dardterm part p(t1, . . . , tr) and theconstraint partκ1, . . . , κm. Each ofrand m can be 0. The latter, m = 0, is in particular the case for a predicate that has no declaration. By this convention, every MGTP program is an IV-MGTP program. If m= 1 and the domain ofκ1 is{1,2}, the IV-MGTP programs are equivalent to CMGTP programs where{1}is interpreted as positive and{2}as negative. Hence, every CMGTP program is also an IV-MGTP program.
Model Candidates in IV-MGTP. While the deduction procedure for IV-MGTP is almost the same as for CMGTP, model candidates are treated differently. In MGTP, a list of current model candidates that represent Herbrand interpreta- tions is kept during the deduction process, and modelcandidates can be simply identified with sets of ground atoms. The same holds in IV-MGTP, only that some places of a predicate contain a ground constraint in solved form (that is:
a subset of a domain) instead of a ground term. Note that, while in MGTP one modelcandidate containing ground atoms {L1, . . . , Lr} trivially represents ex- actly one possible interpretation of the set of atoms{L1, . . . , Lr}, in IV-MGTP one modelcandidate represents many IV-MGTP interpretations which differ in the constraint parts.
Thus, modelcandidates can be conceived as sets of constrained atoms of the formp(t1, . . . , tr, S1, . . . , Sm), where the Si are subsets of the appropriate domain. If M is a modelcandidate, p(t1, . . . , tr) the ground term part, and S1, . . . , Smthe constraint part in M, then define M ( p(t1, . . . , tr) ) = S1, . . . , Sm. We say that a ground constrained atomL=p(t1, . . . , tr, i1, . . . , im) is satisfiedby M (M |=L) iff there are domain elements s1 ∈i1, . . . , sm ∈im such thats1, . . . , sm ∈M(p(t1, . . . , tr)).
Formally, a model candidate M is a partial function that maps ground in- stances of the term part of constrained atoms which is declared as “p(t, . . . , t, j1, . . . , jm)” into (2{1,...,j1}−{∅})ìã ã ãì(2{1,...,jm}−{∅}). Note thatM(p(t1, . . . , tr)) can be undefined.
Besides rejection, subsumption, and extension of a modelcandidate, in IV- MGTP there is a fourth possibility not present in MGTP, that is, model can-
didate update. We see that model candidate update is really a combination of subsumption and rejection. Consider the following example.
Example 1. LetC =p({1,2}) be the consequent of an IV-MGTP rule and as- sume M(p) ={2,3}. Neither is the single atom inC inconsistent withM nor is it subsumed byM. Yet the information contained inCis not identicalto that in M and it can be used to refineM toM(p) ={2}.
Channel Routing Problems. Channelrouting problems in VLSI design can be represented as constraint satisfaction problems, in which connection require- ments (what we callnets) between terminals must be solved under the condition that each net has a disjoint path from all others. For these problems, many spe- cialized solvers employing heuristics were developed. Our experiments are not primarily intended to compare IV-MGTP with such solvers, but to show the effectiveness of the interval/extraval representation and its domain calculation in the IV-MGTP procedure.
We consider a multi-layer channel which consists of multiple layers, each of which has multiple tracks. We assume in addition, to simplify the problem, that each routing path makes no detour and contains only one track. By this assumption, the problem can be formalized to determine the layer and the track numbers for each net with the help of constraints that express the two binary relations:not equal(neq) andabove.neq(N1, N2) means that the netN1andN2
do not share the same track.above(N1, N2) means that ifN1 andN2 share the same layer, the track number ofN1 must be larger than that ofN2.
For example, not equal constraints for nets N1 and N2 are represented in IV-MGTP as follows:
p(N1,[L, L],[T1, T1])∧p(N2,[L, L],[T21, T22])∧neq(N1, N2)
→p(N2,[L, L],]T1, T1[)
where the predicate p has two constraint domains: layer number L and track number Ti.
Experimental Results. We developed an IV-MGTP prototype system in Java and made experiments on a Sun Ultra 5 under JDK 1.2. The results are compared with those on the same problems formulated and run with CMGTP [50] (also written in Java [21]). We experimented with problems consisting of 6, 8, 10, and 12 net patterns on the 2 layers channel each of which has 3 tracks. The results are shown in Table 2.
IV-MGTP reduces the number of models considerably. For example, we found the following model in a 6-net problem:
{p(1,[1,1],[3,3]), p(2,[1,1],[1,1]), p(3,[1,1],[2,2]), p(4,[2,2],[2,3]), p(5,[2,2],[1,2]), p(6,[1,1],[2,3]) },
which contains 8 (= 1×1×1×2×2×2) CMGTP models. The advantage of using IV-MGTP is that the different feasible track numbers can be represented as
Table 2.Experimentalresults for the channelrouting problem Number of Nets = 6
IV-MGTP CMGTP
models 250 840
branches 286 882
runtime(msec) 168 95
Number of Nets = 8 IV-MGTP CMGTP
models 1560 10296
branches 1808 10302
runtime(msec) 706 470
Number of Nets = 10 IV-MGTP CMGTP
models 4998 51922
branches 6238 52000
runtime(msec) 2311 3882
Number of Nets = 12 IV-MGTP CMGTP
models 13482 538056
branches 20092 539982
runtime(msec) 7498 31681
interval constraints. In CMGTP, the above model is split into 8 different models.
Obviously, as the number of nets increases, the reduction ratio of the number of models becomes larger. We conclude that IV-MGTP can effectively suppress unnecessary case splitting by using interval constraints, and hence, reduce the totalsize of proofs.
Because CMGTP program can be transferred to IV-MGTP program, QG problems can be transferred into IV-MGTP program. IV-MGTP, however, can- not solve QG problems more efficiently than CMGTP, that is, QG problems do not receive the benefit of IV-MGTP representation and deduction process.
The efficiency or advantage by using IV-MGTP depends on the problem do- main how beneficialthe effect of interval/extravalconstraints on performance is. For problems where the ordering of the domain elements has no significance, such as the elements of a QG problem (whose numeric elements are considered strictly as symbolic values, not arithmetic values), CMGTP and IV-MGTP have essentially the same pruning effect. However, where reasoning on the arithmetic ordering between the elements is important, such as in channel routing problems, IV-MGTP outperforms CMGTP.
Completeness. MGTP provides a sound and complete procedure in the sense of standard Herbrand interpretation. The extensions, CMGTP and IV-MGTP described above, however, lost completeness [19]. The reason is essentially the same as for incompleteness of resolution and hypertableaux with unrestricted selection function [18].
It can be demonstrated with the simple exampleP={→p, ơq→ ơp, q→}.
The programP is unsatisfiable, yet deduction procedures based on selection of only antecedent (or only consequent) literals cannot detect this. Likewise, the incomplete treatment of negation in CMGTP comes up with the incorrect model {p} forP. The example can be transferred to IV-MGTP3. Assume pandqare
3 We discuss only about IV-MGTP in the rest of this section, because CMGTP can be considered as a special case of IV-MGTP. It is sufficient to say about IV-MGTP.
defined “declare p(2)” and “declare q(2)”. The idea is to represent a positive literalpwithp({2}) and a negative literalơpwithp({1}). Consider
P={→p({2}), q({1})→p({1}), q({2})→} (7) which is unsatisfiable (recall thatpandqare functional), but has an IV-MGTP model, whereM(p) ={2}, andM(q) is undefined.
In order to handle such cases, we adopt a non-standard semantics called extended interpretations which is suggested in SFLP [37]. The basic idea un- derlying extended interpretations (e-interpretations) is to introduce the disjunc- tive information inherent to constraints into the interpretations themselves. In e-interpretations, an e-interpretation of a predicate p is a partialfunction I mapping ground instances of the term part of pinto its constraint part. This means that the concepts introduced for modelcandidates can be used for e- interpretations.
An extended interpretationIdoese-satisfyan IV-MGTP ground atomL= p(t1, . . . , tr, S1, . . . , Sm) iffI(p(t1, . . . , tr)) is defined, has the valueS1, . . . , Sm , andSi ⊆Sifor all 1≤i≤m.
Using the above definition, we have proved the following completeness theo- rem [19].
Theorem 1 (Completeness).An IV-MGTP programP having an IV-MGTP model M is e-satisfiable by M (viewed as an e-interpretation).
Simple conversion of this theorem and proof makes the case of CMGTP trivial.