سؤال

The Sicstus Prolog manual says to user "| ?- consult(user)." to enter clauses and to "to return to top-level, type ^D.". However, I am using Windows and the manual doesn't have Windows instructions. How can I return to query mode in Windows?

هل كانت مفيدة؟

المحلول

In many Prolog systems, like SICStus 4, you can enter the fact end_of_file. to finish consultation. This fact will not be consulted, it only serves to indicate the end.

(Warning: I am not a frequent user of Wind-ows. That is, I only have rdesktop for such activity.)

Should you ever have the need to define the fact end_of_file. in your program, write end_of_file :- true. instead.

If you enter end_of_file. as a query on the toplevel, many Prolog systems stop. You can circumvent this by entering true,end_of_file. instead.

This slightly bizarre behavior is by no means standardized.

نصائح أخرى

I can't test it, but I think ^Z (Ctrl+Z) should play the same role as ^D (Ctrl+D) on Unix.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top