1

I am using the Tau Prolog library in my project and it has been working fine till I tried this.

I am attempting to output multiple schedules and their corresponding extra hours (the context is not relevent here).

Here is the output in the console when I use session.answers( x => console.log( pl.format_answer(x) ) );

// Query the goal

session.query("getSchedules(123,Schedule,ExtraHours).");

// Show answers

session.answers(x => console.log(pl.format_answer(x)));

CONSOLE:


Schedule = [a, b, c, d, e, f, m, g], ExtraHours = 0 ;

Schedule = [a, b, c, d, e, f, j, k], ExtraHours = 0 ;

Schedule = [a, b, c, d, e, f, j, x], ExtraHours = 0 ;

Schedule = [a, b, c, d, e, f, j, g], ExtraHours = -2 ;

Schedule = [a, b, c, d, e, f, k, x], ExtraHours = 0 ;

Schedule = [a, b, c, d, e, f, k, g], ExtraHours = -2 ;

Schedule = [a, b, c, d, e, f, x, g], ExtraHours = -2 ;

false.


I am trying to get all these schedules in 1 list but whenever I try to accumulate the results in a global variable, the resulting list only has the 1st schedule. Does anyone know how I can get a list with all the schedules?

Nadeen Amr
  • 11
  • 2

0 Answers0