<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Programming in Java with Restricted Intensional Sets</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Maximiliano Cristia</string-name>
          <email>cristia@cifasis-conicet.gov.ar</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gianfranco Rossi</string-name>
          <email>gianfranco.rossi@unipr.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universidad Nacional de Rosario and CIFASIS</institution>
          ,
          <addr-line>Rosario</addr-line>
          ,
          <country country="AR">Argentina</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Universita degli Studi di Parma</institution>
          ,
          <addr-line>Parma</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Intensional sets are sets given by a property rather than by enumerating their elements, similar to set comprehensions available in speci cation languages such as B and MiniZinc. In a previous paper [3] we have presented a decision procedure for a rst-order logic language which provides Restricted Intensional Sets (RIS), i.e. a sub-class of intensional sets that are guaranteed to denote nite|though unbounded|sets. In this paper we show how RIS can be exploited as a convenient programming tool also in a more conventional setting, namely, an imperative O-O language. We do this by considering a Java library, called JSetL [14], that integrates the notions of logical variable, (set) uni cation and constraints that are typical of constraint logic programming languages into the Java language. We show how JSetL is naturally extended to accommodate for RIS and RIS constraints, and how this extension can be exploited, on the one hand, to support a more declarative style of programming, and on the other hand, to e ectively enhance the expressive power of the constraint language provided by the library.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction and motivations</title>
      <p>
        Intensional sets, also called set comprehensions, are sets described by providing
a condition ' that is necessary and su cient for an element x to belong to
the set itself, i.e., f x : '[x] g, where x is a variable and ' is a rst-order
formula containing x. Intensional sets are widely recognized as a key feature
to describe complex problems. As a matter of fact, various speci cation (or
modeling) languages provide intensional sets as rst-class entities. For example,
some form of intensional sets are o ered by MiniZinc [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], ProB [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] and Alloy
[
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. As concerns programming languages, only relatively few of them support
intensional sets. To name some, the general-purpose programming languages
SETL [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] and Python, and the Constraint Logic Programming (CLP) languages
Godel [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] and flogg [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Also conventional Prolog systems provide some facilities
for intensional set de nition in the form of the setof built-in predicate.
      </p>
      <p>
        The processing of intensional sets in most of these proposals is based on the
availability of a set-grouping mechanism [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] capable of collecting in a set S
all the instances of x satisfying the formula '. Basically, the implementation of
set-grouping exploits the following intended semantics of intensional sets:
fx : '[x]g = S $ 8x(x 2 S ! '[x]) ^ 8x('[x] ! x 2 S)
$ 8x(x 2 S ! '[x]) ^ :9x(x 62 S ^ '[x]):
(1)
      </p>
      <p>
        An example of this approach is flogg (pronounced `setlog'), a freely available
extended Prolog system that embodies the CLP language with sets CLP(SE T )
[
        <xref ref-type="bibr" rid="ref13 ref7">7, 13</xref>
        ]. For instance, while processing the formula3 A = f1; 2g ^ S = fX : X
Ag ^ f3g 62 S, flogg rst collects in S all elements X which are subsets of the set
A, i.e. 2A, then it checks the 62 constraint on S. Though set grouping works ne
in many cases, it also have a number of more or less evident drawbacks: (i) if
the intensional set denotes an in nite set, then set-grouping may be endless; (ii)
if the formula ' contains unbound variables other than X, then set grouping
may incur the well-known problems of the general handling of negation in a
logic programming language [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]; (iii) if the set of values to be collected is not
completely determined (e.g., the solver rewrites ' to a simpli ed equi-satis able
form, without generating the actual values for x), then set-grouping may cause
the computation to be not complete (and possibly not sound).
      </p>
      <p>Example 1. The following formulas can be written in flogg using (general)
intensional sets, but flogg is not able to process them adequately, due to some of
the problems with set-grouping listed above:
{ S = f2; 4; 6g ^ S = fx : x 2 D ^ x mod 2 = 0g; i.e., S is the set of all even
numbers belonging to an unknown set D;
{ C = A \ B ^ S = fx : x 2 A ^ x 2 Bg ^ C 6= S, i.e., S is the set of all
elements in both sets A and B (A and B unknown sets).</p>
      <p>If, on the contrary, the sets involved in the above formulas are completely
speci ed sets, then flogg is able to perform set-grouping and hence to compute the
correct answers.
tu</p>
      <p>
        Set-grouping is not always necessary to deal with intensional sets. For
example, given the formula t 2 fx : 'g, one could check whether it is satis able
or not by simply checking satis ability of '(t), i.e., of the instance of ' which
is obtained by replacing x by t. A very general proposal along these lines is
CLP(fDg) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], a CLP language o ering arbitrarily nested extensional and
intensional sets of elements over a generic constraint domain D, along with basic
constraints (namely, 2, 2=, =, and 6=) dealing with intensional sets. The proposed
solver is able to eliminate occurrences of intensional sets from the constraints
without explicit enumeration of the sets. The generality of the intensional set
formers supported in this proposal, however, may cause some of the drawbacks
mentioned above (namely, problems concerned with intensional sets denoting
innite sets and with the general use of negation). As observed in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], the presence
of undecidable constraints such as fx : p(x)g = fx : q(x)g, where p and q can
have an in nite number of solutions, \prevents us from developing a parametric
3 In order to not burden the presentation too much, flogg formulas will be written
using the usual mathematical notation rather than its concrete syntax.
and complete solver". As a matter of fact, no working implementation of this
proposal has been developed.
      </p>
      <p>
        Recently, Cristia and Rossi [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] proposed a narrower form of intensional sets,
called Restricted Intensional Sets (RIS), and a complete solver to deal with
basic set-theoretical operations on them in a way similar to [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] (i.e., not using
set-grouping). RIS have similar syntax and semantics to the set comprehensions
available in the formal speci cation languages Z and B, i.e. fx : D j [x]g,
where D is a set, is a formula over a rst-order theory X , and is a term
containing x. The semantics of fx : D j [x]g is \the set of terms [x] such
that x is in D and holds for x". RIS have the restriction that D must be
a nite set and is a quanti er-free constraint in X , for which we assume a
complete solver to decide its satis ability is available. It is important to note
that, although RIS are guaranteed to denote nite sets, nonetheless, RIS can
be not completely speci ed. In particular, as the domain can be a variable or a
partially speci ed set, RIS are nite but unbounded.
      </p>
      <p>
        The work in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] is mainly concerned with the de nition of the constraint
language and its solver, and the proof of soundness and completeness of the
constraint solving procedure. In this paper, our main aim is to explore programming
with intensional sets. Speci cally, we are interested in exploring the potential
of using RIS in the more conventional setting of imperative O-O languages. To
this purpose, we consider JSetL [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], a Java library that integrates the notions
of logical variable, (set) uni cation and constraints that are typical of constraint
logic programming languages into the Java language. First, we show how JSetL
is naturally extended to accommodate for RIS. Then, we show with a number of
simple examples how this extension can be exploited, on the one hand, to support
a more declarative style of programming, and on the other hand, to e ectively
enhance the expressive power of the constraint language provided by the library.
Observe that though we are focusing on Java, the same considerations could be
easily ported to other O-O languages, such as C++.
      </p>
      <p>The paper is organized as follows. Sect. 2 introduces RIS informally through
some examples. Sect. 3 brie y reviews the JSetL library and Sect. 4 presents the
extension of JSetL with RIS. In Sect. 5 we start showing examples using JSetL
to demonstrate the usefulness of RIS and RIS constraints to support declarative
programming. Sect. 6 shows how RIS can be used to de ne and manipulate
partial functions. In Sect. 7 we consider some extensions to RIS and we present
examples showing their usefulness. Finally, in Sect. 8 we draw some conclusion.
2</p>
    </sec>
    <sec id="sec-2">
      <title>An Informal Introduction to RIS</title>
      <p>In this section we introduce RIS in an informal, intuitive way, through a number
of simple examples.</p>
      <p>The language that embodies RIS, called LRIS , is a quanti er-free rst-order
logic language which provides both RIS and extensional sets, along with basic
operations on them, as primitive entities of the language. LRIS is parametric
with respect to an arbitrary theory X , for which we assume a decision procedure
for any admissible X -formula is available. Elements of LRIS sets are the objects
provided by X , which can be manipulated through the primitive operators that
X o ers (at least, X -equality). Hence, RIS in LRIS represent untyped unbounded
nite hybrid sets, i.e., unbounded nite sets whose elements are of any sort. For
the sake of convenience, we assume that the language of X , LX , provides the
constant, function and predicate symbols of the theories of the integer numbers
and ordered pairs.</p>
      <p>LRIS provides the following set terms: a) the empty set, noted ;; b)
extensional sets, noted fx t Ag, where x, called element part, is an X -term, and A,
called set part, is an LRIS set term; and c) Restricted Intensional Sets (RIS),
noted fc : D j F P [c]g, where c, called control term, is an X -term; D, called
domain, is an LRIS set term; F , called lter, is an X -formula; and P , called
pattern, is an X -term containing c. Both extensional sets and RIS can be partially
speci ed because elements and sets can be variables. As a notational
convenience, ft1 t ft2 t ftn t tg gg (resp., ft1 t ft2 t ftn t ;g gg) is written as
ft1; t2; : : : ; tn t tg (resp., ft1; t2; : : : ; tng). When useful, the domain D can be
represented also as an interval [m; n], m and n integer constants, which is intended
as a shorthand for fm; m+1; : : : ; ng. RIS-literals are of the form A = B, A 6= B,
e 2 A or e 2= A, where A and B are set terms and e is an X -term. RIS-formulas
are built from RIS-literals using conjunction and disjunction.</p>
      <p>An extensional set fxtAg is interpreted as fxg[A. A RIS term is interpreted
as follows: if x1; : : : ; xn (n &gt; 0) are all the variables occurring in c, then fc : D j
F P [c]g denotes the set fy : 9x1 : : : xn(c 2 D ^ F ^ y =X P [c])g. Note that
x1; : : : ; xn are bound variables whose scope is the RIS term itself. Also note that
equality between y and the pattern P requires equality of the theory X .</p>
      <p>In order to devise a decision procedure for LRIS , the control term c and the
pattern P of RIS are restricted to be of speci c forms. Namely, if x and y are
variables ranging on the domain of X , then c can be either x or (x; y), while P
can be either c or (c; t) or (t; c), where t is any (uninterpreted/interpreted) X
term, possibly involving the variables in c. As it will be evident from the various
examples in the next sections, in spite of these restrictions, LRIS is still a very
expressive language.</p>
      <p>Example 2. The following are RIS-literals involving RIS terms:
{ fx : [ 2; 2] j x mod 2 = 0 xg = f 2; 0; 2g
{ (5; y) 2 fx : D j x &gt; 0 (x; x x)g, where y and D are free variables
{ (5; 0) 62 f(x; y) : fP t Rg j y 6= 0 (x; y)g, where P and R are free variables,
and fP t Rg is a set term denoting the set fP g [ R. tu
When the pattern is the control term and the lter is true, they can be
omitted (as in Z and B), although one must be present.</p>
      <p>LRIS provides a complete constraint solver which is able to decide satis
ability of any LRIS formulas. Precisely, the solver reduces any input formula
to either false (hence, is unsatis able), or to an equi-satis able disjunction
of formulas in a simpli ed form, called the solved form, which is guaranteed to
be satis able (hence, is satis able). If is satis able, the answer computed
by the solver constitutes a nite representation of all the concrete (or ground)
solutions of the input formula.</p>
      <sec id="sec-2-1">
        <title>Example 3 (Constraint solving with RIS).</title>
        <p>{ The second formula of Ex. 2 is rewritten by the LRIS solver to the solved
form formula y = 25 ^ D = f5 t N1g, where the second equality states that
D must contain 5 and something else, denoted N1.
{ The rst formula of Ex. 1 can be written using RIS as S = f2; 4; 6g ^ S =
fx : D j x mod 2 = 0g; this formula is rewritten by the solver to a solved form
formula containing the constraint D = f2; 4; 6tN1g^fx : N1 j xmod2 = 0g =
;, where the second equality states that N1 cannot contain even numbers
(note that this constraint has the obvious solution N1 = ;). tu
It is worth noting that the LRIS solver is able to correctly solve all formulas
of Ex. 1, written using RIS. Moreover, note that the formula fx : p(x)g = fx :
q(x)g, which is undecidable when p and q have an in nite number of solutions,
can be \approximated" using RIS as fx : D1 j p(x)g = fx : D2 j q(x)g, D1, D2
variables, which is a solved form formula admitting at least one solution, namely
D1 = D2 = ;; hence it is simply returned unchanged by the solver.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>JSetL</title>
      <p>
        JSetL [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] is a Java library that combines the object-oriented programming
paradigm of Java with valuable concepts of CLP languages, such as logical
variables, lists, uni cation, constraint solving and non-determinism. The library
provides also sets and set constraints like those found in CLP(SE T ). Uni cation
may involve logical variables, as well as list and set objects (i.e., set uni cation
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]). Set constraints are solved using a complete solver that accounts for partially
speci ed sets (i.e., sets containing unknown elements). Equality, inequality and
comparison constraints on integers are dealt with as Finite-Domain Constraints,
like in CLP(FD) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. JSetL has been used as one of the rst six
implementations for the standard Java Constraint Programming API de ned in the Java
Speci cation Request JSR-331 [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] (see for instance http://openrules.com/
jsr331/JSR331.UserManual.pdf). The JSetL library can be downloaded from
the JSetL's home page at http://cmt.math.unipr.it/jsetl.html.
      </p>
      <p>In JSetL a (generic) logical variable is an instance of the class LVar. Basically,
LVar objects can be manipulated through constraints, namely equality (eq),
inequality (neq), membership (in) and not membership (nin) constraints. Logical
variables can be either initialized or uninitialized. When the collection of
possible values for a logical variable reduces to a singleton, this value becomes the
value of the variable and the variable is initialized. Moreover, a logical variable
can have an optional external name (i.e., a string) which can be useful when
printing the variable and the possible constraints involving it.</p>
      <sec id="sec-3-1">
        <title>Example 4 (Logical variables).</title>
        <p>Values associated with generic logical variables can be of any type. For some
speci c domains, however, JSetL o ers specializations of the LVar data type,
which provide further speci c constraints. In particular, for the domain of
integers, JSetL o ers the class IntLVar, which extends LVar with a number of new
methods and constraints speci c for integers. In particular, IntLVar provides
integer comparison constraints such as &lt; (lt),
(le), etc.</p>
        <p>Other important specializations of logical variables are the class LCollection
and its derived subclasses, LSet (for Logical Sets) and LList (for Logical Lists).
Values associated with LSet (LList) are objects of the java.util class Set
(List). A number of constraints are provided to work with LSet (LList), which
extend those provided by LVar. In particular, LSet provides equality and
inequality constraints that account for the semantic properties of sets (namely,
irrelevance of order and duplication of elements); moreover it provides constraints
for many of the standard set-theoretical operations, such as union (union),
intersection (inters), inclusion (subset), and so on.</p>
      </sec>
      <sec id="sec-3-2">
        <title>Example 5 (Logical lists/sets).</title>
        <p>LList l = new LList(); // an uninitialized logical list
LSet r = new LSet("r"); // an uninitialized logical set</p>
        <p>// with external name "r"
LVar x = new LVar("x");
LSet s2 = r.ins(x);
LSet s1 = LSet.empty().ins(2).ins(1); // the set f1,2g</p>
        <p>// the set fxg [ r
LVar x = new LVar();</p>
        <p>// an uninitialized logical variable
LVar y = new LVar("y",1); // an initialized logical variable
// with external name "y" and value 1
ins is the element insertion method for LSet objects: s.ins(o) returns the
new logical set whose elements are those of the set s [ fog. In particular, the last
statement in Ex. 5 creates a partially speci ed set s2 with an unknown element
x and an unknown rest r (i.e., fx j rg, using a Prolog-like notation).</p>
        <p>A JSetL constraint solver is an instance of the class SolverClass.
Basically, it provides methods for adding constraints to its constraint store (e.g., the
method add) and to prove constraint satis ability (e.g., the method solve). If
solver is a solver,</p>
        <p>is the collection of constraints stored in its constraint store
(possibly empty), and c is a constraint, then solver.solve(c) checks whether
^ c is satis able or not: if it is, then the constraint store is modi ed so to
represent the computed constraint in solved form; otherwise an exception Failure
is raised.</p>
      </sec>
      <sec id="sec-3-3">
        <title>Example 6 (Constraint solving).</title>
        <p>LVar x = new LVar("x"), y = new LVar("y");
LSet s1 = LSet.empty().ins(2).ins(1); // the set f1,2g
LSet s2 = LSet.empty().ins(y).ins(x); // the set fx,yg
tu
tu
SolverClass solver = new SolverClass();
solver.solve();
x.output(); y.output();
// the constraint s1=s2 ^ x6=1
where the method output is used to print the value possibly bound to a logical
object. Executing this code fragment will output: x = 2, y = 1.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Adding RIS to JSetL</title>
      <p>tu
tu
tu
the control term.
follows:
In this section we show how RIS are added to JSetL. The new version of the
JSetL library can be downloaded from the JSetL's home page. All sample Java
programs shown in this and in the next sections have been tested using the new
version and are available on-line.</p>
      <p>
        RIS are added to JSetL by de ning a new class, named Ris. Ris extends
LSet, hence Ris objects can be used as logical sets, and all methods of LSet
are inherited by Ris. Basically, a Ris object (i.e., an instance of Ris) is created
by specifying its control term (an object of type LVar or Pair), its domain (an
object of type LSet), its lter (an object of type Constraint), and its pattern
(an object of type LVar or Pair). The pattern can be omitted if it coincides with
Example 7 (Ris object creation). The rst RIS of Ex. 2 is created in JSetL as
IntLVar x = new IntLVar();
LSet d = new LSet(new Interval(-2,2));
Constraint f = x.mod(2).eq(0);
Ris ris = new Ris(x,d,f);
// fx:[
        <xref ref-type="bibr" rid="ref2">-2,2</xref>
        ] j x mod 2 = 0
xg
where Interval and Constraint are classes provided by JSetL with their
obvious meaning.
      </p>
      <p>Constraint methods provided by Ris implement the constraints = (method
LVar and Pair are extended so to accept Ris objects as their arguments.
eq) and 6= (method neq). Moreover, the constraint methods in and nin of classes
Example 8 (RIS constraints). If ris is the Ris object created in Ex. 7, then the
following are possible RIS constraints posted on ris:</p>
      <p>
        LSet s = LSet.empty().ins(2).ins(0).ins(-2);
solver.add(ris.eq(s));
LVar y = new LVar(1);
solver.add(y.nin(ris));
// fx:[
        <xref ref-type="bibr" rid="ref2">-2,2</xref>
        ] j x mod 2 = 0
      </p>
      <p>
        xg = f-2,0,2g
// 1 nin fx:[
        <xref ref-type="bibr" rid="ref2">-2,2</xref>
        ] j x mod 2 = 0
xg
      </p>
      <p>The class Ris provides also a number of general utility methods, such as
isBound(), which returns true i the domain of the Ris object is bound to some
value, and expand which returns the LSet object representing the extensional
set denoted by the Ris object (i.e., it performs set grouping) or it raises an
exception if the domain of the Ris object is not a completely speci ed set.
Example 9. If ris is the Ris object created in Ex. 7, then the corresponding
extensional set S is computed and printed as follows:</p>
      <p>LSet S = ris.expand().setName("S");</p>
      <p>S.output();
whose execution yields S = f2,0,-2g.
tu</p>
      <p>In JSetL the language of RIS and the language of the parameter theory X
are completely amalgamated. Thus, it is possible to use constraints of the latter
together with constraints of the former, as well as to share logical variables of
both. The following in an example that uses this feature to prove a general
property about sets.</p>
      <p>Example 10. Check the property of set intersection as stated by the second
formula of Ex. 1.</p>
      <p>LSet A = new LSet(), B = new LSet(), C = new LSet();
solver.add(C.inters(A,B)); // the constraint C = A \ B
LVar X = new LVar();
Ris S = new Ris(X,A,X.in(B));
solver.add(S.neq(C));
// S = fX:A j X 2 Bg
// the constraint S 6= C
Calling solver.solve() causes an exception Failure to be thrown (i.e., the
formula is found to be false).
tu</p>
      <p>Observe that constraints in JSetL are predicates, not functions; hence we
write, for instance, C.inters(A,B), instead of C.eq(A.inters(B)), to denote
the predicate inters(A; B; C) which is true i C = A \ B.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Declarative programming with RIS</title>
      <p>
        Intensional set de nition represents a powerful tool for supporting a declarative
programming style, as pointed out for instance in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>A rst interesting application of RIS to support declarative programming is to
represent Restricted Universal Quanti ers (RUQ). The RUQ 8x 2 D : F [x] can
be easily represented by using a RIS term as follows: D = fx : D j F [x]g: Solving
this formula amounts to check whether F [x] holds for all x in D. For instance,
D = f1; 2; 3g ^ D = fx : D j x &gt; 0g is true, whereas D = f1; 2; 3g ^ D = fx :
D j x &gt; 0g is false.</p>
      <p>Since the LRIS solver can decide satis ability of such formulas, then we have
a decision procedure for a fragment of rst-order logic with quanti ers.</p>
      <p>The following are Java programs that solve simple|though not trivial|
problems using JSetL with RIS. Basically, their solution is expressed
declaratively as a formula using RUQ.</p>
      <p>Example 11. Compute and print the minimum of a set of integers S.
public static LVar minValue(LSet S)} throws Failure {</p>
      <p>IntLVar x = new IntLVar();
IntLVar y = new IntLVar();
Ris ris = new Ris(x,S,y.le(x));
solver.add(y.in(S).and(S.eq(ris)));
solver.solve();
return y; }
The method minValue posts the constraint y 2 S ^ S = fx : S j y xg. The
solver, non-deterministically binds a value from S to y and then it checks if the
property y x is true for all elements x in S. If this is not the case, the solver
backtracks and tries a di erent choice for y. A possible call to this method is:
Integer[] sampleSetElems = {8,4,6,2,10,5};
LSet R = LSet.empty().insAll(sampleSetElems);
LVar min = minValue(R).setName("min");
min.output();
and the printed answer is min = 2.</p>
      <p>It is important to observe that operations on RIS are dealt with as real
constraints. This implies, among other things, that the order in which constraints
are posted to the solver is irrelevant.</p>
      <p>
        More generally, the use of constraints allows to compute with only partial
speci ed aggregates [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. For example, the set passed to the method minValue
can be f8; 4; 6; zg, where z is an uninitialized logical variable, or even it can
contain an unknown part, e.g. (using the abstract notation), f8; 4 t Rg, where R
is an uninitialized LSet object. In the rst case, i.e., with S equal to f8; 4; 6; zg,
the solver is able to non-deterministically generate three distinct answers, one
with z = 4; min = 4, another with z 4; min = z, and the last one with
z 4; min = 4.
      </p>
      <p>Another example that shows the use of RIS to de ne a universal quanti
cation in a declarative way is the following simple instance of the well-known map
coloring problem.</p>
      <p>Example 12. Given a cartographic map of n regions r1,. . . ,rn and a set fc1; : : : ; cmg
of colors nd an assignment of colors to the regions such that no two neighboring
regions have the same color.</p>
      <p>Each region can be represented as a distinct logical variable and a map as a
set of unordered pairs (hence, sets) of variables representing neighboring regions.
An assignment of colors to regions is represented by an assignment of values (i.e.,
the colors) to the logical variables representing the di erent regions.
public static void coloring(LSet regions, LSet map, LSet colors)
throws Failure {
solver.add(regions.subset(colors));
LSet p = new LSet();
Ris ris = new Ris(p, map, p.size(2));
solver.add(map.eq(ris));
solver.solve(); }
tu
The method coloring posts the constraint regions colors ^ map = fp :
map j jpj = 2g. The rst conjunct exploits the subset constraint to
nondeterministically assign a value to all variables in regions. The second
conjunct requires that all pairs of regions in the map have cardinality equal to 2,
i.e., all pairs have distinct components. If coloring is called with regions =
fr1,r2,r3g, r1, r2, r3 uninitialized logical variables, map = ffr1,r2g,fr2,r3gg,
and colors = f"red", "blue"g, the invocation terminates with success, and r1,
r2, r3 are bound to "red", "blue", "red", respectively (actually, also the other
solution which binds r1, r2, r3 to "blue", "red", "blue", respectively, can be
computed through backtracking).</p>
      <p>This example uses a pure \generate &amp; test" approach; hence it quickly
becomes very ine cient as soon as the map becomes more and more complex.
However, it may represent a rst \prototype" whose implementation can be
subsequently re ned (e.g., by modeling the coloring problem in terms of Finite
Domain (FD) constraints and using the more e cient FD solver provided by
JSetL), without having to change its usage. On the other hand, this solution
allows to exploit the exible use of constraints and partially speci ed sets. As
a matter of fact, the same program can be used to solve related problems; e.g.,
given a map and a partially speci ed set of colors, nd which constraints the
unknown colors must obey in order to obtain an admissible coloring of the map.</p>
      <p>The next program shows another example where RIS are used to check
whether a property holds for all elements of a set, but using a di erent kind
of equality constraint.</p>
      <p>Example 13. Check whether n is a prime number or not:4
public static Boolean isPrime(int n)} {
if (n &lt;= 0) return false;
IntLVar N = new IntLVar(n);
IntLVar x = new IntLVar();
LSet D = new LSet(new Interval(2,n/2));
Ris ris = new Ris(x,D,N.mod(x).eq(0));
solver.add(ris.eq(LSet.empty()));
return solver.check(); }
tu
tu
The method isPrime posts the constraint fx : [2; N div 2] j N mod x = 0g = ;.
The equality between the RIS term and the empty set ensures that there is no
x in the interval [2; N div 2] such that N mod x = 0 holds. If, for instance, n is
101, then the call to isPrime returns true.
6</p>
    </sec>
    <sec id="sec-6">
      <title>Using RIS to de ne partial functions</title>
      <p>Another important application of RIS is to de ne (partial) functions by giving
their domains and the expressions that de ne them. In general, a RIS term of
4 s.check() di ers from s.solve() in that the latter raises an exception if the
constraint in the constraint store of s is unsatis able, whereas the former returns a
boolean value indicating whether the constraint is satis able or not.
the form fx : D j F (x; f (x))g, where f is any function symbol belonging to
the language LX , de nes a partial function. In fact, this RIS term denotes a set
of ordered pairs as its pattern is an ordered pair; besides, it is a partial function
because each of its rst components never appears twice, since they belong to
the set D.</p>
      <p>Given that RIS are sets, then, in LRIS , functions are sets. Therefore, through
standard set operators, functions can be evaluated, compared and point-wise
composed; and by means of constraint solving, the inverse of a function can also
be computed. The following examples illustrate these ideas in the context of
Java with JSetL.</p>
      <p>Example 14. The square of an integer n.</p>
      <p>IntLVar x = new IntLVar();
LSet D = new LSet();</p>
      <p>Ris Sqr = new Ris(x,D,Constraint.TRUE,new Pair(x,x.mul(x));
The Ris object Sqr de nes the set of all pairs (x; x x), where x belongs to an
(unknown) set D. This function can be \evaluated" in a point n, and the result
sent to the standard output, by executing the following code:</p>
      <p>IntLVar y = new IntLVar("y");
solver.solve(new Pair(n,y).in(Sqr));
y.output();
that is, y is the image of n through function Sqr. If, for instance, n has value 5
(e.g., int n = 5), then the printed result is y = 25. Note that the RIS domain,
D, is left underspeci ed as a variable.
If, for instance, n has value 25, the computed result is y = unknown - Domain:
f-5,5g, stating that the possible values for y are -5 and 5.</p>
      <p>The interesting aspect of using RIS for de ning functions is that RIS are sets
and sets are data. Thus, we have a simple way to deal with functions as data. In
particular, since Ris objects can be passed as arguments to a function, we can
use RIS to write generic functions that take other functions as their arguments.
The following is an example illustrating this technique.</p>
      <p>Example 15. The following method takes as its arguments an array of integers
A and a function f(x) and updates A by applying f to all its elements.
public static void mapList(int[] A,Ris f) throws Failure {
for(int i=0; i&lt;A.length; i++) {</p>
      <p>IntLVar y = new IntLVar();
solver.solve(new Pair(A[i],y).in(f));</p>
      <p>A[i] = y.getValue();
} }
If, for instance, the array passed to mapList is f3,5,7g and f is the Ris object
Sqr of Ex. 14, then the modi ed array is f9,25,49g. tu</p>
    </sec>
    <sec id="sec-7">
      <title>Extended RIS</title>
      <p>
        To guarantee that the constraint solver is indeed a decision procedure a number
of restrictions are imposed on the form of RIS in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Speci cally: (i) the control
term and pattern of RIS are restricted to be of speci c forms|roughly speaking,
variables and pairs, see Sect. 2; (ii) the lter of RIS cannot contain \local"
variables, i.e., existentially quanti ed variables declared inside the RIS term;
(iii) recursively de ned RIS such as X = fx : D j [X] g are not allowed.5
      </p>
      <p>
        Although compliance with these restrictions is important from a theoretical
point of view, in practice there are many cases in which they can be (partially)
relaxed without compromising the correct behavior of programs using RIS.
As noted in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], the necessary and su cient condition for patterns to guarantee
correctness and completeness of the constraint solving procedure is that patterns
be bijective functions. All the admissible patterns of LRIS are bijective patterns.
Besides these, however, other terms can be bijective patterns. For example, x +
n, n constant, is also a bijective pattern, though it is not allowed in LRIS .
Conversely, x x is not bijective as x and x have x x as image (note that
(x; x x) is indeed a bijective pattern allowed in LRIS ).
      </p>
      <p>
        Unfortunately, the property for a term to be a bijective pattern cannot be
easily syntactically assessed. Thus in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] we adopted a more restrictive de
nition of admissible pattern. However, from a more practical point of view, as in
JSetL, we can admit also more general patterns. In particular, we allow patterns
to be any integer logical expression involving the RIS control variable. An
integer logical expression in JSetL is created by using methods such as sum, mul,
etc., applied to IntLVar objects, and returning IntLVar objects (e.g., x.mul(x),
where x is an uninitialized IntLVar).
      </p>
      <p>If the expression used in the RIS pattern de nes a bijective function (e.g.,
x.sum(2)) then dealing with the RIS is anyway safe; otherwise, it is not safe in
general, but it may work correctly in many cases.</p>
      <p>
        Example 16. Compute the set of squares of all even number in [
        <xref ref-type="bibr" rid="ref1 ref10">1,10</xref>
        ].
      </p>
      <p>
        IntLVar x = new IntLVar(); //ris = fx:[
        <xref ref-type="bibr" rid="ref1 ref10">1,10</xref>
        ] j x mod 2=0
LSet D = new LSet(new Interval(1,10));
Ris ris = new Ris(x,D,x.mod(2).eq(0),x.mul(x));
LSet Sqrs = ris.expand();
x*xg
Executing this code will correctly bind Sqrs to f4,16,36,64,100g.
tu
      </p>
      <p>Allowing more general forms of patterns (and, possibly, control terms) is
planned as a future extension for RIS in general, and for the implementation of
RIS in JSetL, as well.
5 Note that, on the contrary, a formula such as X = fD[X] j g is an admissible
constraint, and it is suitably handled by the LRIS decision procedure.
Allowing local variables in RIS raises major problems when the formula
representing the RIS lter has to be negated during RIS constraint solving (basically,
negation of the RIS lter is necessary to assure that any element that does not
satisfy the lter does not belong to the RIS itself). In fact, this would require
that the solver is able to deal with quite complex universally quanti ed formulas,
which is usually not the case (surely, it is not the case for the JSetL solver). Thus,
to avoid such problems a priori, the RIS lter cannot contain local variables.</p>
      <p>However, as already observed for RIS patterns, in practice there are cases
in which we can relax some restrictions on RIS without losing the ability to
correctly deal with such more general RIS constraints.</p>
      <p>Thus, in JSetL, we allow the user to specify that some (logical) variables
in the RIS lter are indeed local variables. This is achieved|as a temporary
solution|by using a special syntax for the external name of the logical variable
(namely, the name must start with an underscore character).</p>
      <p>Example 17. If R is a set of ordered pairs and D is a set, then the subset of R
where all the rst components belong to D can be de ned as follows:
LSet D = new LSet();
LSet R = new LSet();
LVar x = new LVar();
LVar y = new LVar("_y");
Pair P = new Pair(x,y)</p>
      <p>Ris ris = new Ris(x,D,P.in(R),P);
If we try to solve the constraint
//ris = fx:D j 9y((x,y) 2 R
(x,y))g
solver.solve(new Pair(1,2).in(ris).and(new Pair(3,4).in(ris)))
i.e., (1; 2) 2 ris ^ (3; 4) 2 ris, then the solver terminates with success, binding
(as its rst solution) D to f1; 3 t N1g and R to f(1; 2); (3; 4) t N2g, N1, N2 new
fresh variables.
tu</p>
      <p>In the above example, y is a local variable. If y is not declared as local, then
the same call to solver.solve will terminate with failure, since y is dealt with
as a free variable and the rst constraint, (1; 2) 2 ris, binds y to 2 so that the
second constraint (3; 4) 2 ris fails.</p>
      <p>Anyway, it can be observed that many uses of local variables can be avoided
by a proper use of the control term and pattern of RIS. For example, the extended
RIS of Ex. 17 can be replaced by a RIS term without local variables as follows:
f(x; y) : R j x 2 Dg. Hence, the planned extension of the admissible control
terms and patterns for RIS can also be useful to alleviate the problem of local
variables in RIS lters.</p>
      <p>Fact = f(0; 1) t Fact 1g^
Fact 1 = fx : D
(2)
The class Ris extends the class LSet; hence it is possible, at least in principle, to
use Ris objects inside the RIS lter formula in place of LSet objects. This allows,
among other things, to de ne recursive restricted intensional sets (RRIS).</p>
      <p>Of course, the presence of recursive de nitions may compromise the
niteness of RIS and hence the decidability of the formulas involving them. Therefore
RRIS are prohibited in the base language of RIS, LRIS . In practice, however,
their availability can considerably enhance the expressive power of the language
and hence RRIS are allowed in the extended language supported by JSetL.
Programmers are responsible of guaranteeing termination.</p>
      <p>The following is an example using a RRIS. Since RRIS has not yet been
fully developed and tested in JSetL we will write programs dealing with them
by using only the abstract notation.</p>
      <sec id="sec-7-1">
        <title>Example 18 (Factorial of a number n).</title>
        <p>j 9y; z(x &gt; 0 ^ (x</p>
        <p>1; z) 2 Fact ^ y = x z (x; y))g
Note that the domain, D, is left underspeci ed, and recursion is simply expressed
as a set membership predicate over the same set being de ned: (x 1; z) 2 Fact
means that z is the factorial of x 1. If we conjoin, for example, the constraint
(5; f ) 2 Fact then the solver will return f = 120. As usual in declarative
programming, there is no real distinction between inputs and outputs. Therefore
if we conjoin to formula (2) the constraint (n; 120) 2 Fact then the solver will
return n = 5.
tu</p>
        <p>RRIS are not yet fully supported in JSetL, but their inclusion, which has
already been successfully experimented in flogg, should be feasible without major
problems.
8</p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>Conclusion and future work</title>
      <p>
        In this paper we have presented an extension of the Java library JSetL to support
RIS, and we have shown, through a number of simple examples, the usefulness
of RIS as a powerful data and control abstraction. Although e ciency is not
our main concern, the implementation of RIS in flogg has proven to be e cient
enough as to compete with mainstream tools [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Hence, we expect similar results
of the implementation of RIS in the JSetL library.
      </p>
      <p>As future work, it can be interesting: (a) on the more theoretical side, trying
to extend the language of RIS for which we are able to provide a correct and
complete solver, e.g. by enlarging the collection of set and relation operators
dealing with RIS (for now limited to equality and membership); (b) on the more
practical side, trying to incorporate in the implementation of RIS within the
JSetL library all the extensions mentioned in Sect. 7, which although falling
outside of the decision procedure, turn out to be of great interest in practice.
Acknowledgments We wish to thank Andrea Guerra and Andrea Fois for their
contribution to the implementation of RIS in JSetL. This work has been partially
supported by GNCS \Gruppo Nazionale per il Calcolo Scienti co".</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bergenti</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chiarabini</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rossi</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>Programming with Partially Speci ed Aggregates in Java</article-title>
          ,
          <source>Computer Languages, Systems &amp; Structures</source>
          ,
          <volume>37</volume>
          (
          <issue>4</issue>
          ),
          <volume>178</volume>
          {
          <fpage>192</fpage>
          (
          <year>2011</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Codognet</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Diaz</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Compiling constraints in CLP(FD)</article-title>
          .
          <source>Journal of Logic Programming</source>
          ,
          <volume>27</volume>
          (
          <issue>3</issue>
          ):
          <volume>185</volume>
          {
          <fpage>226</fpage>
          (
          <year>1996</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Cristia</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rossi</surname>
          </string-name>
          , G.:
          <article-title>A Decision Procedure for Restricted Intensional Sets</article-title>
          . In: de Moura, L. (ed.)
          <source>Automated Deduction 26th Int'l Conf. on Automated Deduction (CADE 26)</source>
          . LNCS, v.
          <volume>10395</volume>
          ,
          <fpage>185</fpage>
          -
          <lpage>201</lpage>
          . Springer (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Dovier</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pontelli</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rossi</surname>
          </string-name>
          , G.:
          <article-title>Constructive Negation and Constraint Logic Programming with Sets</article-title>
          .
          <source>New Generation Computing</source>
          ,
          <volume>19</volume>
          (
          <issue>3</issue>
          ):
          <volume>209</volume>
          {
          <fpage>255</fpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Dovier</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pontelli</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rossi</surname>
          </string-name>
          , G.:
          <article-title>Intensional sets in CLP</article-title>
          . In: Palamidessi,
          <string-name>
            <surname>C</surname>
          </string-name>
          . (ed.)
          <source>Proc. 19th Int'l Conf. on Logic Programming</source>
          , LNCS, v.
          <volume>2916</volume>
          ,
          <issue>284</issue>
          {
          <fpage>299</fpage>
          . Springer (
          <year>2003</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Dovier</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pontelli</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rossi</surname>
          </string-name>
          , G.:
          <article-title>Set uni cation</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>6</volume>
          (
          <issue>6</issue>
          ),
          <volume>645</volume>
          {
          <fpage>701</fpage>
          (
          <year>2006</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Dovier</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Piazza</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pontelli</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rossi</surname>
          </string-name>
          , G.:
          <article-title>Sets and constraint logic programming</article-title>
          .
          <source>ACM Trans. Program. Lang. Syst</source>
          .
          <volume>22</volume>
          (
          <issue>5</issue>
          ),
          <volume>861</volume>
          {
          <fpage>931</fpage>
          (
          <year>2000</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Hill</surname>
            ,
            <given-names>P.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lloyd</surname>
            ,
            <given-names>J.W.:</given-names>
          </string-name>
          <article-title>The Godel programming language</article-title>
          . The MIT Press (
          <year>1994</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Jackson</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Software Abstractions: Logic, Language, and Analysis</article-title>
          . The MIT Press (
          <year>2006</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. JSR-331: JSR-331
          <string-name>
            <given-names>Java</given-names>
            <surname>Constraint Programming</surname>
          </string-name>
          <string-name>
            <surname>API</surname>
          </string-name>
          , https://jsr331.org/.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Leuschel</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Butler</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>ProB: A model checker for B</article-title>
          . In: Keijiro,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Gnesi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Mandrioli</surname>
          </string-name>
          ,
          <string-name>
            <surname>D</surname>
          </string-name>
          . (eds.) FME. LNCS, v.
          <volume>2805</volume>
          ,
          <issue>855</issue>
          {
          <fpage>874</fpage>
          . Springer (
          <year>2003</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Nethercote</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stuckey</surname>
            ,
            <given-names>P.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Becket</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brand</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Duck</surname>
            ,
            <given-names>G.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tack</surname>
          </string-name>
          , G.:
          <article-title>Minizinc: Towards a standard CP modelling language</article-title>
          . In: Bessiere,
          <string-name>
            <surname>C. (ed.) CP</surname>
          </string-name>
          <year>2007</year>
          .
          <article-title>LNCS</article-title>
          , v.
          <volume>4741</volume>
          ,
          <issue>529</issue>
          {
          <fpage>543</fpage>
          . Springer (
          <year>2007</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Rossi</surname>
          </string-name>
          , G.: flogg (
          <year>2008</year>
          ), http://people.dmi.unipr.it/gianfranco.rossi/ setlog.Home.html.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Rossi</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Panegai</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Poleo</surname>
          </string-name>
          , E.:
          <article-title>JSetL: A Java Library for Supporting Declarative Programming in Java</article-title>
          .
          <source>Software-Practice &amp; Experience</source>
          ,
          <volume>37</volume>
          :
          <fpage>115</fpage>
          -
          <lpage>149</lpage>
          (
          <year>2006</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Schwartz</surname>
            ,
            <given-names>J. T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dewar</surname>
            ,
            <given-names>R. B. K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dubinsky</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schonberg</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          :
          <article-title>Programming with Sets: an Introduction to SETL</article-title>
          . Springer-Verlag (
          <year>1986</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Shmueli</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Naqvi</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Set Grouping and Layering in Horn Clause Programs</article-title>
          . In: Lassez,
          <string-name>
            <surname>J-L</surname>
          </string-name>
          . (ed.),
          <source>Proc. Fourth Int'l Conf. on Logic Programming</source>
          ,
          <volume>152</volume>
          {
          <fpage>177</fpage>
          . The MIT Press (
          <year>1987</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>