Sunday 15 March 2015

prolog - Query working in the consult, but not in JPL and command line -


I am using JPL and launching some questions for self-prolongation. This question works well with all questions, but one.

This query is not working:

  emphasis (like (x, y): - element (i, [1, 2, 3], x) Element (I, [2, 3, 4], Y)). Exception in thread "main": jpl.PrologException: PrologException: error (uninstantiation_error (element (_3, '.' (2, '.' ('.' (4, []),),) (), references (: (System, / (emphasis, 2)), '2-nd logic'))  

if I query the query one.), And run it with consultation, works fine! But if I type the query in console mode, then return the same error as JPL, where is the problem?

You are very close to getting the lights.

Try - - (like (x, y): - element (i, [1, 2, 3], x ), Element (I, [2, 3], 4], Y))).

And it will work!

Your problem was the priority of the operator (: -) / 2 WRT operator (,) / 2.

No comments:

Post a Comment