• No results found

Abstracting Numeric Constraints with Boolean Functions

N/A
N/A
Protected

Academic year: 2019

Share "Abstracting Numeric Constraints with Boolean Functions"

Copied!
11
0
0

Loading.... (view fulltext now)

Full text

(1)

      

City, University of London Institutional Repository

Citation

:

Howe, J. M. and King, A. (2000). Abstracting Numeric Constraints with Boolean

Functions. Information Processing Letters, 75(1-2), pp. 17-23. doi:

10.1016/S0020-0190(00)00081-8

This is the unspecified version of the paper.

This version of the publication may differ from the final published

version.

Permanent repository link: http://openaccess.city.ac.uk/1696/

Link to published version

:

http://dx.doi.org/10.1016/S0020-0190(00)00081-8

Copyright and reuse:

City Research Online aims to make research

outputs of City, University of London available to a wider audience.

Copyright and Moral Rights remain with the author(s) and/or copyright

holders. URLs from City Research Online may be freely distributed and

linked to.

City Research Online:

http://openaccess.city.ac.uk/

[email protected]

(2)

Boolean Funtions

Jaob M. Howe

1

and Andy King

ComputingLaboratory, University of Kent,Canterbury, CT2 7NF

Abstrat

A simple, syntati algorithm for abstrating numeri onstraints for groundness

analysisispresentedandproved orret. Thetehnique usesneitherprojetionnor

temporaryvariables,and plugsa gap intheabstrat interpretation literature.

Key words: Abstrat interpretation; Compilers;Constraint programming.

1 Introdution

Groundness analysis is an important theme of logi programming and

ab-strat interpretation. Groundness analyses identify those program variables

whih at run time will be bound to terms that ontain no variables (ground

terms)[1,3℄.Foronstraintlanguages, likeCLP(R) [7℄, ananalogousproblem

isdeduing whihvariables are denite, that is,ompletelyxed by the store

[2,4,5℄. Groundness and deniteness are strongly related, and groundness is

oftenused for both onepts.

Little has been written about how to abstrat numeri onstraints, that is,

taking a numeri onstraint as input and omputing as output a Boolean

formula that aurately desribes the grounding behaviour of the onstraint.

For example, [4,5℄ just give some example groundness abstrations in a

ta-ble; no algorithmfor alulating an abstration for anarbitrary onstraint is

desribed. In addition, [2℄ also explains the r^ole of temporary variables and

projetion in abstration. The proedure is as follows: rst, a numeri

on-straint, for instane, w = x +y z, is written in three-variable form, for

example, w = x+v;v = yz, where v is a fresh, temporary variable.

Se-ond, table lookup is used to map three-variable forms to Boolean formulae,

1

(3)

1

(w^v))^(v (w^x)) and f

2

= (v (y^z)). The grounding behaviour

of the onstraint w =x+v;v =yz is desribed by f

1

^f

2

. Third,

tempo-raryvariablesare removed by projetion, forexample,v anbeeliminatedby

9v:(f 1

^f

2

)=(w (x^y^z))^(x (w^y^z)).

The third step an be omitted but this typially only defers projetion. F

ur-thermore, retainingthe temporaryvariables an degrade the time and spae

eÆieny of many the representations of Boolean funtions [1,3,5,6,8,9℄ that

have been proposed for groundness analysis. Projetion is partiularly

inon-venient for the analysis of [6℄ beause variable elimination is not required

elsewhere in the analysis. This paperaddresses these problems by presenting

asimple,syntatialgorithmforabstrating numerionstraintsthat neither

uses projetion nor introdues temporary variables. The algorithm gives

ab-strations whih are guaranteed to be atleast as preise as those given using

the three variable formmethod.

The paper is organised as follows: Setion 2 presents a semantis for

(non-Herbrand) CLP(R) onstraints. Abstration is alsoformalised. Setion 3

de-tailsthree-variable form. Setion4 explains how abstration an be reast as

the problem of reognising those variables ina numerionstraint whihwill

take a unique value when the others are grounded. Setion 5onludes.

2 Abstrat Interpretation

2.1 Conrete Domain

Let R denotethe real numbers and let

N

denote the set of funtor symbols

of CLP(R) [7℄, f+, , =, , abs , aros , arsin, os , max, min, pow , sing,

where is unary minus. (Binary subtration x y abbreviates x +( y),

thus is not modeled diretly). Let ? 2= R denote a speial symbol reserved

for error handling and let V denote a denumerable set of variables. Let X

?

denote X[f?g. Put = R

?

[

N

and

V

= [V. Let T and T

V

denote

the (ground) and (non-ground)terms generated from and

V

respetively.

A valuation isa total map, :V !R

?

, and the set of valuationsis denoted

. Let D be an interpretation of the symbols of . D(d) =d for all d 2R

? .

Eah symbol f 2

N

of arity n is interpreted by D as a map f : R

n ?

! R

? .

For example, + : R

?

R

?

! R

?

maps numbers d

1

;d

2

2 R to their sum,

otherwise, if either d

1

= ? or d

2

= ?, it maps to ?. The other symbols

in

N

are interpreted in the usual way, exept in the following three ases:

(d=0) = ? for every d 2 R

?

, arsin(d) = ?i :( 1 d 1);aros(d) =

(4)

1 2 1 2

and d

1

= d

2

; D interprets d

1

d

2

in the obvious way. Let C denote the

set of onstraints generated by T

V

and , whih is losed under onjuntion

(^), existentialquantiation(9)and renaming().Avaluation, ,naturally

extends to terms and onstraints using the interpretation D. Entailment of

onstraints, j=, is dened by

1

j=

2

i 8 2 : (

1

) ) (

2

). Equivalene,

,isdenedby

1

2

i

1

j=

2

and

2

j=

1

.hC=;j=;^iisa(bounded)meet

semi-lattiewiththebottomandtopelementsfalseandtrue,wherej=and^

are liftedtoequivalene lasses of onstraints. LetP(X)denote the powerset

ofX.Forthepurposesofabstratinterpretation,theonretedomainistaken

tobethe lattie hP(C= );;[;\i.

Inommonwithmanyonstraintsolvers,thesolverofCLP(R)[7℄ispartialin

thesensethatitanonlydetetthesatisability/unsatisabilityofonstraints

that beome linear. To modelthis, let L denote the set of linear onstraints,

that is (where d 2 R), true;false,

P n i=1

d i

x

i

= d,

P n i=1

d i

x

i

d 2 L.

L is losed under onjuntion, existential quantiation and renaming. The

transition system ( (LC)

2

is dened by: h;d^d

0

i ( h

00

;d

0

i i there

exists

0

2 L suh that j= ^

i2I (x

i

= d

i

), d^^

i2I (x

i

=d

i )

0

and

00

^

0

(whereIisapossiblyemptyindexset).Forexample,htrue;(y =xsin (z)^z =

=2)i ( h2z = ;y = xsin(z)i ( h(x = y^2z = );truei. Let (

?

abbreviate zero ormore (transitions. The transitionsystem (is onuent

in that if htrue;i (

? h

0

;d

0

i 6( and htrue;i (

? h

00

;d

00

i 6(, then

0

00

and d

0

d

00

. Let f : L ! L be a map suh that f() =f(

0

) i

0

. This

gives the (deterministi) map ( hf(

0

);d

0

i where htrue;i (

? h

0

;d

0

i 6(.

This isneessary toformulateabstration asa mapping.Let C

=

denote those

2 C of form (t = t

0

) and suh that 6( h

0

;d

0

i with

0

j= false. Let

var(o)denotethe (free) variablesinsyntatiobjeto andletmvar(o) denote

the variable ourrenes in syntati objet o (as a multiset), for example,

mvar(f(u;v;v)) = fu;v;vg. Let M

#

denote the set of singularly ourring

elements of the multiset M.Finally,let M(X)=fMjM

#

2P(X)g.

2.2 Abstrat Domain

Groundness and groundness dependenies are often represented by Boolean

funtions[1,3℄.LetXdenoteanitesetofvariables,andletBool

X

denotethe

setofBooleanformulaeoverX.Eahf 2Bool

X

representsanjXj-aryBoolean

funtion, so funtion and formulaare used interhangeably. The formula ^Y

is sometimes written Y. A Boolean funtion f is positive i X j= f. Let

Pos

X

denote the set of positive Boolean funtions over X, augmented with

thelogialonstantfalse. hPos

X

;j=;_;^iisaompletelattie{theabstrat

domain.9fy

1

;:::;y

n

g:f abbreviates 9y

1

:::9y

(5)

The onretisationmap, X

:Pos

X

!P(C=), details how formulae represent

onstraints.Conretisation is dened by

X

(f)=f[℄

j8

0

2C:(^

0

)6false)assign

X

(^

0

)j=fg

Here, assign

X

:C!Bool

X

is given by assign

X

() =Y^(^f:y j y 2X nYg)

and Y = fy 2 X j 9d 2 R: ( h

0

;d

0

i^

0

j= (y = d)g. The abstration

map,

X

:P(C=)!Pos

X

,isdened by

X

(C)=^ff 2Pos

X

jC

X

(f)g.

X

() abbreviates

X (f[℄

g).

Proposition 1

X

;

X

form a Galois insertion.

Proof. Bythe denition of

X

, thereisa Galoisonnetion.Toshowthat it

isaninsertion,itissuÆienttodemonstratethat

X

isinjetive.Supposethat

X

(f 1

) =

X (f

2

) and f

1

6= f

2

. Then there exists g = X

1

^(^f:xjx 2 X

2 g),

where X =X

1

[X

2

and X

1

\X

2

=;, suh that (without lossof generality)

g j= f

1

, but g 6j= f

2

. Let = ^fx = 1 j x 2 X

1

g. Piking

0

= true, it

is seen that assign

X

(^

0

) = g. Thus [℄

2

X (f

1

), but [℄

=

2

X (f

2

). A

ontradition. Therefore

X

is injetive. 2

3 Computing Abstrations With Projetion

C is not nite and thus

X (

X

) annot be interpreted as an algorithm for

omputing

X

(f) (

X

()) forarbitrary f 2Pos

X

(2C). This motivatesthe

translation of aonstraint intothree-variableform.

Denition 2 C

2

is the least binary relation suh that:

(1) ( ^ t = t

0

) ( ^x = t ^ x = t

0

) if t 62 V [R, t

0

62 V [R and

x62var(^t=t

0 );

(2) (^t = t

0

) (^t = t

00

^y = t

i

) if t 2 V [R, t

0

= f(t

1

;:::;t

i

;:::;t

n ),

t 00

=f(t

1

;:::;y;:::;t

n

), where t

i

62V [R, and y62var(^t=t

0 );

(3) (^t=t

0

) (^t

0

=t) if t62V [R and t

0

2V [R.

Proposition 3 nitely terminates.

Example 4 (x=((sin(y)=2)z)+7) (x=u+7^u=(sin(y)=2)z)

(x=u+7^u =vz^v =sin(y)=2) (x=u+7^u =vz^v =w=2^w=

(6)

Three-variable groundnessabstration forCLP(R) tbl X () tbl X ()

t=dt

0

V $V

0

t=t

0 t 00 V (V 0 ^V 00 )

t=t

0 +t 00 f 2 (V;V 0 ;V 00

) t= t

0

V $V

0

t=t

0

=d V $V

0

t=d=t

0

V $V

0

t=t

0 =t 00 f 1 (V;V 0 ;V 00

) t=pow(t

0

;t

00

) V (V

0

^V

00 )

t=os (t

0

) V V

0

t=sin(t

0

) V V

0

t=aros (t

0

) V $V

0

t=arsin(t

0

) V $V

0

t=min(t

0

;t

00

) V (V

0

^V

00

) t=max(t

0

;t

00

) V (V

0

^V

00 )

t=abs(t

0

) V V

0

tt

0 true

where d 2 R n f0g; t;t

0

;t

00

2 R [V; V = var(t);V

0

= var(t

0

);V

00

= var(t

00 );

f 1

(x;y;z)=(x (y^z))^(y (x^z))andf

2

(x;y;z) =f

1

(x;y;z)^(z (x^y))

Aonstraint2C issaidtobeinthree-variableformi6 .Let

?

abbrevi-atezeroormoreredutions.Thisleadstothefollowingabstrationtehnique:

Denition 5 The abstration map

tvf X

:C!Pos

X

is dened as follows.

Sup-pose (h

0

;d

0

i. If

0

j=false then

tvf X

()=false,else

tvf X ()= tvf X 0 ( 0 ^d 0 ) where tvf X 0 ()= 8 > > < > > : tvf X 0 ( 0 )^ tvf X 0 ( 00

) if =

0

^

00

9(var( 0

)nvar()):

tvf X 0 ( 0 ) if ? 0

6 and 6=

00 ^ 000 tbl X () otherwise.

The redution ( h

0

;d

0

i an be performed using CLP(R) mahinery [7℄.

Table 1 denes

tbl X

() for a (non-ompound) three-variable onstraint . To

see that

tvf X

is well-dened, let

?

1

6 and

?

2

6 . A renaming

: Y

1

! Y

2

exists with Y

1

= var(

1

) n var(), Y

2

= var(

2

) n var() and

( 1

)=

2

. Moreover, 9Y

2 : tvf X ( 2

)= 9(Y

1 ): tvf X (( 1

)) =9(Y

1 ):( tvf X ( 1 ))= 9Y 1 : tvf X ( 1

)sineisbijetiveand var((

tvf X

( 1

)))n(Y

1

)=var(

tvf X

( 1

))nY

1 .

Intuitively,

tvf X

is well-dened sine any extra variables introdued by are

eliminated. Observe

X

()j=

tvf X

() for all 2C.

Proposition 6 Table 1 is safe, that is,

X

() j=

tbl X

(), where is in

three-variable form,6=

0

^

00

and var()X.

Proof. Safety isdemonstratedonlyforthe asex=yz;otherasesmay be

treated similarly. Let fx;y;zg X. Assume, for the sake of a ontradition,

that thereexists

0

2C suhthat assign

X

(x=yz^

0

)6j=x (y^z).Thus

assign X

(x=yz^

0

)=(:x)^y^z andhtrue;x=yz^

0 i( ? h 00 ;d 00 iwhere 00

j=(y =d

1

)^(z =d

2

).Hene h

00 ;d 00 i( ? h 000 ;d 000 i where 000

j=(x=d

1

d

2 )

whihontraditsassign

X

(x=yz^

0

(7)

Observe that X

6=

X

sine

X

(x y(1=x) = 0) = true and

X (x

y(1=x)) = (y x). Moreover, it should be noted that the table does not

aurately desribe the grounding behaviour of some unusual (and spei)

onstraints inthree-variable form. For example,

X

(x=min(y;y))=x$y,

whereas

tbl X

(x = min(y;y)) = x y. In pratie it is expeted that suh

onstraints will not our, however, the table ould be extended to inlude

these extra ases.

4 Computing Abstrations Without Projetion

Abstration may be reast as the problem of reognising those variables in

a onstraint whih will take a unique value when the other variables in the

expression are grounded. This is ahieved preisely by the map det

. The

approah is formulated in terms of approximationsto det

, and is at least as

aurate as the three-variable formmethod.

Denition 7 The map det

: C

=

! P(V) is given by x 2 det

() i 8 :

var()nfxg!R:9!d 2R

?

:()(x=d).

An abstration map ould be dened in terms of det

. However, omputing

thismayrequirenon-trivialsymbolimanipulationof.Forexample,det

(x=

y(1=z))=fx;yg requires the reognitionthat y(1=z)y=z. To build an

abstration map in terms of a simple pattern reogniser (together with ()

det

is approximated by a lass of maps Det.

Denition 8 Det istheleastsetof mapsdet:C

=

!P(V)thatsatisfy(where

f 2

N ):

safety: det () det

();

preision1: if =(x=t) and 6 , then mvar()

#

\det

()det ();

preision2: if y2det (x=t) and y2= var(t

0

), then y2det (t=t

0 );

preision3: let = (t = f(t

1

;:::;t

i

;:::;t

n

)) and

0

= (t = f(t

1

;:::;y;:::;t

n )),

with y 2= var(), if y 2 det (

0

), then det(y = t

i

) nvar(

0

) det () and

det( 0

)nvar(y =t

i

)det() .

The onditions in denition 8 relate to the abstration map in the following

way. The safety ondition ensures

X

() j=

det X

() if det 2 Det. Preision 1

guarantees

det X

() j=

tvf X

() for a non-ompound three-variable onstraint

and the ompositionality properties of preision 2 and preision 3 (with

preision1) ensures that

det X

()j=

tvf X

() for arbitrary .

Proposition 9 det

(8)

Proof. Onlypreision3isnon-trivial.Suppose thatx2det (y =t i

)nvar(

0 ).

It is demonstrated that x 2 det

(). Sine y 2 det

() and x 62 var(

0

), and

given : var()nfxg !R, it an be seen that there is a unique d 2 R suh

that (

0

)(y =d). Put

0

=[fy7!dg. Hene:

(t=f(t

1

;:::;t

i

;:::;t

n ))

0

(t=f(t

1

;:::;t

i

;:::;t

n ))

0

(t =f(t

1

;:::;y;:::;t

n

)^y =t

i )

0

(y =t

i )

x=d

0

sine x2det

(y =t

i )

Hene x2det

(). Similarly,the seond ondition holds. 2

An abstrationmap, parameterised by det , an now bedened.

Denition 10 Theabstrationmap

det X

:C!Pos

X

isdenedasfollows.

Sup-pose(h

0

;d

0

i.If

0

j=false then

det X

()=false,else

det X ()= det X 0 ( 0 ^d 0 ) where det X 0 () = 8 > > < > > :

true if =(tt

0 ) det X 0 ( 0 )^ det X 0 ( 00

) if =(

0 ^ 00 ) ^ v2det()

(v (var()nfvg)) otherwise

Theorem 11 If 2C and det2Det, then

X

()j=

det X

()j=

tvf X

().

Proof. The rst entailmentisestablished by demonstratingtheany Boolean

formulathat isentailed by

det X

isalsoentailed by

X

. Theseond entailment

isestablished by demonstratingthat eah redution resultsin aonstraint

whose

det X

abstration is not stronger than that of the previous onstraint.

The base ase demonstrates that

det X

()j=

tvf X

() for inthe lookup table.

Consider 2 C suh that ( h

0

;d

0

i. If

0

j=false, the result is immediate.

Letdet2Det.

To show

X

()j=

det X (), onsider 0 ^d 0 = 1 ^:::^ n .If X ( i

)j=

det X 0 ( i ), then X

() j=

det X

(). Suppose, for a ontradition, that

X (

i

) 6j=

det X 0 ( i ), for some i

. Then there exists f

x

= x Y, where x 2 det (

i

) and Y =

var( i

)nfxg, suh that 9

00 2 C:assign X ( i ^ 00

) 6j= f

x

and

i

^

00

6 false.

Hene assign X ( i ^ 00

) j= (:x) ^Y. Thus for every y 2 Y there is e 2 R

suh that i ^ 00 ( ? h 000 ;d 000 i and 000

j= (y = e); indeed, it may be assumed

that 8y 2 Y:9e 2 R:

0 00

j= (y = e). By safety, sine x 2 det (

i

), for some

e 0 2 R, i ^ 000

j= (x = e

0 ). Therefore, i ^ 00 ( ? h 000 ;d 000 i ( ? h 0000 ;d 0000 i and 0000

j=(x=e

0

). A ontradition. Thus

X (

i

)j=f

x

and the result follows.

To show

det X

() j=

tvf X (). Let 0 ^d 0 = 1 ^:::^ n

. It is enough to show

that

det X

( i

)j=

tvf X

( i

(9)

ase, onsider =(t=f(t 1

;:::;t

n

)),wheref 2

N

and 6 (the ase is

obvious). Suppose

tvf X

( 00

) j=(x Y), where x 2= Y. By inspetion of Table

1, x 2 (mvar(

00 ))

#

. By Proposition 6,

X (

00

) j=

tvf X ( 00 ). Hene X ( 00

) j=

(x Y). Let :var(

00

)nfxg!R and put

000

=^fy=(y)jy2Yg. Hene

either 00 ^ 000 ( ? h 0000 ;d 0000 i and 0000

j= false, in whih ase x 2 det

( 00 ), sine ( 00

) (x =?), or

00 ^ 000 ( h 00000 ;d 00000 i and 00000

j=(x =e), in whih

ase (x = e) (

00

^

000

) (

00

) and x 2 det

(

00

). Sine x 2 det

(

00

), by

preision 1, x 2 det(

00

). By inspetion of Table 1, Y = var(

00

)nfxg. Hene

det X

( 00

)j=

tvf X

( 00

).

For the indutive ase, suppose

i

00 ?

000

6 . By hypothesis,

det X

( 00

)j=

9(var( 000

)nvar(

00 )): tvf X ( 000

), so it is enough to show

det X

( i

) j= 9(var(

00 )n var( i )): det X ( 00 ).

(1) Toshow

det X

(t =t

0

)j=9x:

det X

(x=t ^ x =t

0

).Sine9x:

det X

(x=t ^ x =t

0 )

= 9x:(

det X

(x=t)^

det X

(x=t

0 ))

= 9x:((^

v2det(x=t)

v (var(x =t)nfvg))

^(^

u2det(x=t 0

)

u (var(x=t

0

)nfug)))=f

Suppose f j= (y Y). To show ^

v2det(t=t 0

)

(v var(t = t

0

)nfvg) j=

(y Y), suppose, without loss of generality, y 2 det (x = t

0

). Sine

x2 det (x=t

0

), y 2= var(x =t

0

). Bypreision 2,y 2det (t =t

0

) and thus

the result follows.

(2) Toshow

det X

(t=t

0

)=9y:

det X

(t=t

00

^y=t

i

),wheret

0

=f(t

1

;:::;t

i

;:::;t

n ), t 00 = f(t 1

;:::;y;:::;t

n

) and y 2= var(t

0

). Sine 9y:

det X

(t = t

00

^ y = t

i )

= 9y:(

det X

(t=t

00

)^

det X

(y=t

i )) = 9y:((^ v2det(t=t 00 )

v (var(t=t

00

)nfvg)))

^(^

u2det(y=t i

)

u (var(y =t

i

)nfug)))

Usingpreision3,the resultan beestablishedanalogouslytothe

previ-ous ase.

(3) To show

det X

(t = t

0 ) = det X (t 0

= t), where t

0

2 R [V and t 2= R [V.

Immediate. 2

Next, a spei map in det

1

2Det is desribed. The map syntatially

iden-ties those variables that our one in a numeri onstraint expression and

whih take a unique value when the variablesare grounded.

Denition 12 The map det

1

: C

=

! P(V) is dened by: det

1

(t = t

0

) =

(det 1

(t)[det

1 (t

0 ))

#

, where det

1

:T

V

(10)

ExamplegroundnessabstrationsforX=fw;x;y;zg i 0 i tvf X ( i ) det 1 X ( i ) det X ( i ) X ( i )

w=x(y+z)

1 f 1 f 1 f 1 f 1

w=x+w x=0 f

2 f 2 f 2 f 2

w=x=0 false f

3 f 3 f 3 f 3

w=x+x=w

4 f 4 f 4 f 5 f 5

(wx^abs(x)w)

5 f 4 f 4 f 4 f 6 det 1 (t)=

ftg if t 2V

det 1

(t 0

) if t = t; t =dt

0

; t=t

0

=d ort =d=t

0

det 1

(t 0

)[det

1 (t

00

) if t =t

0 +t 00 det 1 (t 0

)[det

1 (t

0

)[det

1 (t

00

)[det

1 (t

00

) if t =t

0

t

00

; t=pow(t

0

;t

00 )

t=min(t

0

;t

00

) ort =max(t

0 ;t 00 ) det 1 (t 0

)[det

1 (t

00

)[det

1 (t

00

) if t =t

0 =t 00 det 1 (t 0

)[det

1 (t

0

) if t =abs(t

0

); t=os (t

0

)or t=sin(t

0 ) det 1 (t 0

) if t =aros(t

0

)or t=arsin(t

0 )

Proposition 13 det

1

2Det.

Example 14 Consider =(x+v =xy+z=w)and suppose (htrue;i.

Observethat det

1

()=(det

1

(x+v)[det

1

(xy+z=w))

#

=(det

1

(x)[det

1 (v)[ det 1 (x)[det 1 (x)[det 1

(y)[det

1 (y)[det 1 (z)[det 1 (w)[det 1 (w)) #

=fv;w;w;x;

x;x;y;y;zg

#

=fv;zg.Hene

det1

X

()=(v w^x^y^z)^(z v^w^x^y).

Example 15 Table 2 details the abstrations for various onstraints where

f 1

= w (x^y ^z), f

2

= x, f

3

= false, f

4

= true f

5

= x w, f

6 =

w$ x. The abstration algorithmsare dened interms of (. It is assumed

that i ( h 0 ;d 0 i and 0 i = 0 ^d 0

. In pratie, ( is evaluated by posting the

onstraint to the store and then retrieving it. The net eet is to evaluate

groundterms and togroup together like terms.For example,2x=os()

z+x+max(2;3)(hx= z+3;truei.This(isused inthis example.Note

that

X (

i

) j=

det

X (

i

) j=

det 1 X

( i

) j=

tvf X

( i

). The abstrations for

1

;

2

;

3

all agree, illustrating that all methods give good auray. The abstrations

of

4

show that det

1

an stillbe strengthened.

X (

5

) shows that, in general,

systemsofinequations needtobeonsideredtoomputethebest abstration.

Note that if a weaker ( were used, a stronger det ould be dened to give

abstrationsof a similarstrength. The three variableform methodwould not

(11)

This paper has desribed a simple algorithm for abstrating numeri

on-straints. This method does not introdue temporary variables, utilises

avail-ableCLP(R)mahinery,andisatleastaspreiseasthethree-variablemethod.

Whilstotherworkshavegiven preisedenitionsofabstration,theyhavenot

addressedhowtoeÆientlyomputethemap.Thispaperplugsthishole.The

algorithman be easilyimplemented and has been used with the analyser in

[8℄. Future work will look at the more general ase of mixing Herbrand and

linear onstraints.

Referenes

[1℄T. Armstrong, K. Marriott, P. Shahte, and H. Sndergaard. Two Classes of

BooleanFuntionsforDependenyAnalysis.SieneofComputerProgramming,

31(1):3{45, 1998.

[2℄N. Baker and H. Sndergaard. Deniteness Analysis for CLP(R). Australian

Computer SieneCommuniations, 15(1):321{332, 1993.

[3℄M. Codishand B. Demoen. Analyzing Logi Programs Using \Prop"-ositional

Logi Programsand aMagi Wand. Journal of Logi Programming, 25(3):249{

274,1995.

[4℄M. Gara de la Banda. Independene, Global Analysis, and Parallelism in

DynamiallySheduled Constraint LogiProgramming. PhDthesis,Universidad

Politeniade Madrid,1994.

[5℄M. Gara de la Banda, M. Hermenegildo, M. Bruynooghe, V. Dumortier,

G. Janssens, and W. Simoens. GlobalAnalysis of Constraint Logi Programs.

ACM Transations on Programming Languages and Systems, 18(5):564{614,

1996.

[6℄A. Heaton, M. Abo-Zaed, M. Codish, and A. King. A Simple Polynomial

GroundnessAnalysis forLogi Programs. Journal of Logi Programming, 2000.

Forthoming.

[7℄N. Heintze, J. Jaar, S. Mihaylov, P. Stukey, and R. Yap. The CLP(R)

Programmer's Manual Version1.1, 1991.

[8℄J. M. Howe and A. King. Implementing Groundness Analysis with Denite

BooleanFuntions.InG.Smolka,editor,EuropeanSymposiumonProgramming,

volume 1782 of Leture Notes in Computer Siene, pages 200{214.

Springer-Verlag, 2000.

[9℄A.King,J. Smaus,and P.Hill. QuotientingShare forDependenyAnalysis. In

S.D. Swierstra, editor, European Symposium on Programming, volume 1576 of

References

Related documents

This paper will provide analysis of the Australian regulator's training register to argue that the regulation of training and education standards for financial advisers in Australia

The potential long-term complications however are quite challenging for the oncologic team and the patient who survives oral cancer, primarily due to the highly specialized

5 ” Total farm revenue includes the actual production value of the crop; insurance indemnities; any other di- saster assistance; 15% of the DP for the farm; all loan

(2012), modelled rates of change of pH and electrical conductivity were minimal and the snow column mature. The zeta potential is principally a function of pH and.. Kulessa et al.

This determines the necessity of ensuring com- plete correspondence of processing modes, struc- tural shapes and parameters of the operating roller elements, as well as the

In addition to affecting the type of securities offered, macroeconomic conditions also can affect the structure of securities; in particular, poor financial conditions potentially

Microstructure studies clearly reveal that uniform distribution of SiC and fly ash particles in matrix in both as cast and heat treated hybrid composites shows excellent bond

This dissertation under-pins these device application with studies of their electronic structures using derivative X-ray Absorption Spectroscopy (XAS) and derivative