% script_demo_unix: Demo script for hard puzzle (IHT grid, Unix dict.)

% All menu selections are systematically redone, in case they are
% modified by the user during runs (e.g. to add/remove breakpoints).

% All runs in this demo must be aborted by the user, as there are too
% many solutions to wait for.


:- module(script_demo_unix).

:- export script/0.

script :-

  wprintf("Demo Unix",[]),
  sleep(2),

  wprintf("First run",[]),			% Same as 1st, no propagation

  toggle(@breakpoint_menu,start,		on),
  toggle(@breakpoint_menu,solution_found,	on),
  toggle(@breakpoint_menu,constraint_setup,	on),
  toggle(@breakpoint_menu,choice_point,		off),
  toggle(@breakpoint_menu,backtrack_step,	off),
  toggle(@breakpoint_menu,propagation_step,	off),
  toggle(@breakpoint_menu,letter_display,	off),

  select(@grid_menu,				grid_iht_3),
  select(@dict_menu,				dict_unix),

  select(@language_menu,			none),	% no propagation
  select(@preordering_menu,			grid),
  select(@ordering_menu,			best_word),
  select(@font_menu,				normal),

  click(@top_button),				% Start

  wprintf("Second run",[]),			% Same as 1st, consistency

  toggle(@breakpoint_menu,start,		on),
  toggle(@breakpoint_menu,solution_found,	on),
  toggle(@breakpoint_menu,constraint_setup,	on),
  toggle(@breakpoint_menu,choice_point,		off),
  toggle(@breakpoint_menu,backtrack_step,	off),
  toggle(@breakpoint_menu,propagation_step,	off),
  toggle(@breakpoint_menu,letter_display,	off),

  select(@grid_menu,				grid_iht_3),
  select(@dict_menu,				dict_unix),

  select(@language_menu,			consistency),
  select(@preordering_menu,			grid),
  select(@ordering_menu,			best_word),
  select(@font_menu,				normal),

  click(@top_button),				% Start

  wprintf("Third run",[]),			% Same as 1st, hu language

  toggle(@breakpoint_menu,start,		on),
  toggle(@breakpoint_menu,solution_found,	on),
  toggle(@breakpoint_menu,constraint_setup,	on),
  toggle(@breakpoint_menu,choice_point,		off),
  toggle(@breakpoint_menu,backtrack_step,	off),
  toggle(@breakpoint_menu,propagation_step,	off),
  toggle(@breakpoint_menu,letter_display,	off),

  select(@grid_menu,				grid_iht_3),
  select(@dict_menu,				dict_unix),

  select(@language_menu,			hu),
  select(@preordering_menu,			grid),
  select(@ordering_menu,			best_word),
  select(@font_menu,				normal),

  click(@top_button),				% Start


  wprintf("Fourth run",[]),			% Full propagation,
						% some preset grid words,
						% dynamic ordering
  toggle(@breakpoint_menu,start,		on),
  toggle(@breakpoint_menu,solution_found,	on),
  toggle(@breakpoint_menu,constraint_setup,	on),
  toggle(@breakpoint_menu,choice_point,		off),
  toggle(@breakpoint_menu,backtrack_step,	off),
  toggle(@breakpoint_menu,propagation_step,	off),
  toggle(@breakpoint_menu,letter_display,	off),

  select(@grid_menu,				grid_iht_3),
  select(@dict_menu,				dict_unix),

  select(@language_menu,			most),
  select(@preordering_menu,			grid),
  select(@ordering_menu,			best_word),
  select(@font_menu,				normal),

  click(@top_button),				% Start


  wprintf("Fifth run",[]),			% Same as 1st, show choices

  toggle(@breakpoint_menu,start,		on),
  toggle(@breakpoint_menu,solution_found,	on),
  toggle(@breakpoint_menu,constraint_setup,	on),
  toggle(@breakpoint_menu,choice_point,		on),	% Show choice points
  toggle(@breakpoint_menu,backtrack_step,	off),
  toggle(@breakpoint_menu,propagation_step,	off),
  toggle(@breakpoint_menu,letter_display,	off),

  select(@grid_menu,				grid_iht_3),
  select(@dict_menu,				dict_unix),

  select(@language_menu,			most),
  select(@preordering_menu,			grid),
  select(@ordering_menu,			best_word),
  select(@font_menu,				normal),

  click(@top_button),				% Start


  wprintf("Sixth run",[]),			% Same as 1st, full propagation,
						% but static ordering
  toggle(@breakpoint_menu,start,		on),
  toggle(@breakpoint_menu,solution_found,	on),
  toggle(@breakpoint_menu,constraint_setup,	on),
  toggle(@breakpoint_menu,choice_point,		on),	% Show choices
  toggle(@breakpoint_menu,backtrack_step,	off),
  toggle(@breakpoint_menu,propagation_step,	off),
  toggle(@breakpoint_menu,letter_display,	off),

  select(@grid_menu,				grid_iht_3),
  select(@dict_menu,				dict_unix),

  select(@language_menu,			most),
  select(@preordering_menu,			grid),
  select(@ordering_menu,			first_word),	% static
  select(@font_menu,				normal),

  click(@top_button),				% Start


  wprintf("Demo Unix completed",[]).
