aspecification, converts it into a logic description and finall , into a  rolog program. If the rules of the program are not correct with respect to the initial specification, the s s tem performs transformations such as reordering literals in a clause, adding t  pe checking literals and so on. e oeck and e harlier (199) mention this reordering, but do not specif an ordering algorithm di erent from the simple generate and test method. ortesi, harlier, and   ossi (1997) present an anal   er for verif ing the correctness of a   rolog e program relative to a specification which provides a list of input/output annotations for the arguments and parameters that can be used to establish program termination. gain, no ordering algorithm is givene plicitl . The purpose of the DAC algorithm is complementar to the purpose of FOLON, and it could serve as an au iliar aid to make the resulting rolog program more e  cient.

ecentl , the   ercur  language was developed at the   niversit  of   elbourne ( omog i et al., 199 a, 199 b). ercur is a strongl t ped and strongl moded language. T pe and mode declarations should be supplied b  the programmer (though recent releases of the The ercur s stem alread support partial inference of t pes and modes omog i et al.,
199 a). The compiler checks that mode declarations for all predicates are satisfied if necessar , it reorders subgoals in the rule bod  to ensure mode correctness (and re ects the program if neither ordering satisfies the mode declaration constraints). hen the compiler performs this reordering, it does not consider the e  cienc  issue.  It often happens that sseeeral orderings of a rule bod satisf the mode declaration constraints in such cases the   ercur  compiler could call the static version of the DAC algorithm to select the most e cient ordering. nother alternative is to augment the DAC algorithm b mode declaration checks, as was shown in  igure 1  .

Note that ercur is a purel declarative logic programming language, and is therefore more suitable for subgoal reordering than  rolog. It has no non logical constructs that could destro the declarative semantics which give logic programs their power in ercur even I/   is declarative.

The third t pe of relevant     is the cost analysis of logic programs ( ebra in, raem et al., 199 e e b r et al., 1997). ortesi et al. (1997) describe a cost formula 199 similar to uation to select a lowest cost ordering. owever, the used a generate and test approach which can sometimes be prohibitivel e pensive. tatic anal sis of cost and nmber of solutions can be used to obtain the control values, instead of learning them.

The e cienc of logic programs can also be increased b methods of program transformation ( ettorossi     roietti, 199 , 199 ).   ne of the most popular approaches is the rules  strategies   approach, which consists in starting from an initial program and then appl ing one or more elementar transformation rules. Transformation strategies are meta rules which prescribe suitable se uences of applications of transformation rules.

nnnt of the possible transformation rules is the goal rearrangement rule which transforms a program b  transposing two ad acent subgoals in a rule bod .    bviousl , an  ordering of a rule bod can be transformed into an other ordering b a finite number of such transpositions. Thus, static subgoal ordering can be considered a special case of program transformation where onl the goal rearrangement rule is used. n the other hand, d namic and semi d  namic ordering methods cannot be represented b  simple transformation rules, since the make use of run time information (e pressed in bindings that rule bod subgoals