1

我在我的项目中使用 Tau Prolog 库,在我尝试之前它一直运行良好。

我正在尝试输出多个时间表及其相应的额外时间(上下文与此处无关)。

这是我使用 session.answers( x => console.log( pl.format_answer(x) ) ) 时控制台中的输出

// 查询目标

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

// 显示答案

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

安慰:


时间表 = [a, b, c, d, e, f, m, g], ExtraHours = 0 ;

时间表 = [a, b, c, d, e, f, j, k], ExtraHours = 0 ;

时间表= [a,b,c,d,e,f,j,x],ExtraHours = 0;

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

时间表= [a,b,c,d,e,f,k,x],ExtraHours = 0;

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

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

错误的。


我试图在 1 个列表中获取所有这些计划,但每当我尝试将结果累积到全局变量中时,结果列表只有第一个计划。有谁知道我怎样才能得到所有时间表的清单?

4

0 回答 0