ministic priority meta-interpreter mechanism (like the
one defined in (Pereira et al., 1992)), can, without
grounding, identify each deterministic call in turn,
and therefore produce an evaluation in polynomial
time without recourse to backtracking, Smodels in-
stead is forced to ground every variable in the pro-
gram, having even to resort to each variable’s domain
to do so. Meta-interpretation allows guiding an eval-
uation without the spacial multiplication of the pro-
gramme, and without analyzing each variable’s do-
main, a priceless feature when integrated into XSB-
Prolog.
It is also not possible to define dynamic constructs
during computation, which greatly limits expression
of certain aspects of the theory. These limitations
were deeply felt during development of this imple-
mentation and greatly conditioned the use of this se-
mantics throughout.
These disadvantages had a direct impact in the
process of choosing the tool in which to implement
each of the referred subproblems or, more appropri-
ately, in preferring XSB–Prolog over SModels, even
for the combinatorial ones. For instance, the dynamic
construct definition disadvantage is patent in subprob-
lem 1, in the problem of determining the horizontal
and vertical partitions of the hv-graph, and in deter-
mining the minimal modular dimensions of each di-
vision, simply because it cannot be known a priori the
exact number of elements we are referring to, and,
even if they were known, it would probably be very
difficult to code anyway. On top of that, the derivation
algorithm can transform a polynomial problem into
an exponential one, as exemplified by subproblem 5
related to the determination of the coordinates of the
external skeleton of the layout, which can be solved
in polynomial time and, if translated into SModels,
would turn exponential.
5 CLOSING REMARKS AND
FUTURE WORK
The implementation presented in this article corre-
sponds only to a limited subset of the rather com-
plete theory presented in (Pereira, 1974). As men-
tioned earlier, only the planar topological aspect of
the problem-solving theory was considered, i.e. a
planar rendering of the graph was assumed. The ex-
tensions required to restrain the dimensions of each
space and each adjacency to specified intervals were
clearly out of scope of this work, but they are unavoid-
able in order to obtain a practical and general usable
solution to the problem.
Only one of the subproblems mentioned was im-
plemented in Smodels; however, also the subprob-
lem related to determining the orientation of the la-
bels could be implemented in it. This subproblem, as
implemented in XSB–Prolog, is one of the most com-
plex parts of the program and, if it were implemented
in Smodels, the relevant part of the code would be
much more concise, logical and substantially reduced
in size and complexity. Unfortunately, because of the
disadvantages mentioned, we found the time com-
plexity of the obtained code substantially increased,
as did the number of layouts obtained, but unneces-
sarily since the new solutions are just symmetrical
variations! For example, given a triangular adjacency
graph, the distinct number of solutions (modulo sym-
metry) is 6 in the current implementation, but would
turn to 24 if developed in Smodels, with no really new
solutions.
A possible solution for this problem is in the uti-
lization not of the usual Stable Models Semantics but
of a revised one, which enjoys relevancy and cumula-
tivity, as mentioned and defined in (Pereira and Pinto,
2005a) and (Pereira and Pinto, 2005b), which are
properties required for an efficient and more declar-
ative implementation for the instance at hand.
Regarding the generalization of the problem in-
stance tackled, future work includes dynamically ob-
taining alternative planar representations of an adja-
cency graph, albeit from an initially non-planar one,
respecting some constraints, and so allowing for a
more flexible interface with a human user, who does
not have to produce a planar representation; addition
of range intervals for each dimension, thereby restrict-
ing the possible values associated with each space and
taking a significant step towards real requisites; al-
lowing dimensional range overlap of spaces in order
to view and detect problematic design points; intro-
duction of layout restrictions guaranteeing elimina-
tion of unwanted layouts; interconnection with Auto-
CAD, thus enabling a more formal presentation of the
layouts, which are currently represented in HTML.
This application is a perfect example of the ben-
efits of a joint collaboration of the Well Founded Se-
mantics and the Stable Models Semantics aiming at
theory building for problem solving.
Having implemented the solution in this hybrid
way we can thus gain more declarativeness by rele-
gating every task to the system where we can more
easily programme it and, also obtaining a much more
efficient solution by relegating each task to the system
that more easily solves it.
Future research in this double approach can un-
doubtedly provide a more declarative, simple and
logical approach to problems on the basis of Logic
Programming. Some major steps have already been
ICEIS 2007 - International Conference on Enterprise Information Systems
368