How to Retrieve All Outputs from SWISH Prolog?

How to Retrieve All Outputs and Understand Variable Creation as we can do it in web version of swi prolog?

That is a flag: SWI-Prolog -- Environment Control (Prolog flags)

It is max_depth, under answer_write_options

Examples:

?- set_prolog_flag(answer_write_options, [quoted(true), portray(true), spacing(next_argument), max_depth(5), attributes(portray)]),
numlist(1, 20, L).
L = [1, 2, 3, 4|...].

0 means no limit:

?- set_prolog_flag(answer_write_options, [quoted(true), portray(true), spacing(next_argument), max_depth(0), attributes(portray)]),
numlist(1, 20, L).
L = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20].

1 Like

Thank you a lot for your reply!

when I run it using:
pic.1

it works.

But when I am trying to use command line:

swipl -s swish.pl -g β€œset_prolog_flag(answer_write_options, [quoted(true), portray(true), spacing(next_argument), max_depth(0), attributes(portray)]),
solution(Y1, Y2, Y3, Y4, Y5, Y6, Y7, Y8, Y9, Y10, Y11, Y12, Y13, Y14, Y15, Y16, Y17, Y18, Y19, Y20, Y21, Y22, Y23, Y24, Y25, Y26, Y27, Y28, Y29, Y30, Y31, Y32, Y33, Y34, Y35, Y36, Y37, Y38, Y39, Y40, Y41, Y42, Y43, Y44, Y45, Y46, Y47, Y48, Y49, Y50, Y51, Y52, Y53, Y54, Y55, Y56, Y57, Y58, Y59, Y60, Y61, Y62, Y63, Y64, Y65, Y66, Y67, Y68, Y69, Y70, Y71, Y72, Y73, Y74, Y75, Y76, Y77, Y78, Y79, Y80, Y81, Y82, Y83, Y84, Y85, Y86, Y87, Y88, Y89, Y90, Y91, Y92, Y93, Y94, Y95, Y96, Y97, Y98, Y99, Y100, Y101, Y102, Y103, Y104, Y105, Y106, Y107, Y108, Y109, Y110, Y111, Y112, Y113, Y114, Y115, Y116, Y117, Y118, Y119, Y120, Y121, Y122, Y123, Y124, Y125, Y126, Y127, Y128, Y129, Y130, Y131, Y132, Y133, Y134, Y135, Y136, Y137, Y138, Y139, Y140, Y141, Y142, Y143, Y144, Y145, Y146, Y147, Y148, Y149, Y150, Y151, Y152, Y153, Y154, Y155, Y156, Y157, Y158, Y159, Y160, Y161, Y162, Y163, Y164, Y165, Y166, Y167, Y168, Y169, Y170, Y171, Y172, Y173, Y174, Y175, Y176, Y177, Y178, Y179, Y180, Y181, Y182, Y183, Y184, Y185, Y186, Y187, Y188, Y189, Y190, Y191, Y192, Y193, Y194, Y195, Y196, Y197, Y198, Y199, Y200, Y201, Y202, Y203, Y204, Y205, Y206, Y207, Y208, Y209, Y210, Y211, Y212, Y213, Y214, Y215, Y216, Y217, Y218, Y219, Y220, Y221, Y222, Y223, Y224, Y225, Y226, Y227, Y228, Y229, Y230, Y231, Y232, Y233, Y234, Y235, Y236, Y237, Y238, Y239, Y240, Y241, Y242, Y243, Y244, Y245, Y246, Y247, Y248, Y249, Y250, Y251, Y252, Y253, Y254, Y255, Y256, Y257, Y258, Y259, Y260, Y261, Y262, Y263, Y264, Y265, Y266, Y267, Y268, Y269, Y270, Y271, Y272, Y273, Y274, Y275, Y276, Y277, Y278, Y279, Y280, Y281, Y282, Y283, Y284, Y285, Y286, Y287, Y288, Y289, Y290, Y291, Y292, Y293, Y294, Y295, Y296, Y297, Y298, Y299, Y300, Y301, Y302, Y303, Y304, Y305, Y306, Y307, Y308, Y309, Y310).”

it prints nothing, when I am trying to prints variables explicitly it prints inner values (smth like _1239).

could you please help me to rich the same behavior using command line only as at the pic.1?