How to Start ACLP

Here are the steps to be taken from writing an ACLP program to running it:
  • Write an ACLP program in a file ( e.g. aclp_prog.pl )
  • In ECLiPSe, load the file ( e.g aclp.pl) that contains the ACLP runtime system with the ECLiPSe query compile(aclp).
  • Load the ACLP program with the query compile(aclp_prog).
  • Execute your program by calling the ACLP metainterpreter. In the current implementation of ACLP, a program is executed by calling at the top-level of ECLiPSe one of the following three predicates:
  • aclp_solve(+Goal)
  • aclp_solve(+Goal, +Initial_hypothesis)
  • aclp_solve(+Goal, +Initial_hypothesis, ?Output_variable)
  • We can specify the Initial_hypothesis when we have partial information on the abducible predicates. An important use of this is when we want to recalculate the solution to a Goal under some new requirements by adapting the old solution. The old solution (or part of the old solution) will then form the Initial_hypothesis. An example of this is the problem of rescheduling.

    The Output_variable returns the solution to the Goal as a list of abducible hypothesis, with their domain variables constrained according to the dynamic constraints that were generated through the unfolding of the ``relevant'' part of the program and the integrity constraints. A subsequent step of labeling is also needed on these variables to have a ground solution of our initial query.

    Various other constraint predicates of ECLiPSe can be used at this stage e.g. min_max/2 or minimize/2 in order to find an optimal ground solution. One way to achieve this is by following the pattern:

    aclp_solve(Goal, Initial_hypothesis, Output_variable),
    term_variables(Output_variable, VariablesInAbducibles),
    make_cost_expression(VariablesInAbducibles, CostExpression)
    min_max(labeling(VariablesInAbducibles), CostExpression).


    Back to ACLP home page