Buenas tardes,
I have encountered a problem with my teacher in the Prolog class. My teacher says that we can make a resolution with the following program
mag(paris,mag_a).
mag(paris,mag_b).
mag(lyon,mag_c).
mag(lyon,mag_d).
liste(M):-mag(V,M),write(M),write( situe_a ),write(V),nl,fail.
liste(M):-write(fin liste).
served by the following goal:
liste(X)
and which gives the following result:
mag_a situe a paris
mag_b situe a paris
mag_c situe a lyon
mag_d situe a lyon
fin liste
true.
But, in swish.swi, the software that compiles Prolog online says that it is not possible to do that:
So who can I believe?
I don't understand what is the problem you want to solve, but I think there is a syntax error in the last line. If you send two parameters to write they should be separated by commas.
Namely,