.
gf's solver has been in use for at least 20 years, in particular by many puzzle creators. It is a very powerful tool.
However, it remains a tool for experts, hard to use, due to an illegible "user manual" in pseudo-Unix style. I say pseudo-Unix, because I don't think any Unix developer would have defined a unique command "Unix", with all the real Unix commands (grep, rm, mv, cat...) appearing as options in the command line.
To make this clear, here is the official command line (where "sudoku" is the name of the program):
sudoku [ options ] [ puzzle ... | [ < ] puzzle.file ... ]
With coloin, we came to the conclusion that it would be useful to write an introductory guide to the solver. The purpose is not to cover everything, but the most useful options.
As a start, I propose to use a different, more standard syntax for the command line. It is based on what I've written in [HCCS2] (which was based on some of mith's posts).
As this forum uses square brackets for different purposes, I suggest:
1) to use chevrons (i.e. < and >) instead and to use "OR" between two options instead of the more standard "|", so as not to confuse it with the Unix pipe symbol;
2) to write the command line in a more detailed way, as:
<gsf-command-line]>= <gsf-call> <input> (<secondary-commands>)
<input> = <puzzle> OR (“ < ”) <file-name>
<puzzle> = a string of 81 characters, the usual line representation of a Sudoku puzzle, with either “0” or “.” for the empty cells
Let’s start with the core of the commands:
<gsf-call> = <sudoku-gsf> (-<main-action>) -f’<output-format>’ (-q<solveconstr>) -e’<output-requests>’
<sudoku-gsf> = the name of gsf’s program on the computer running it, including the usual starting “./” on Unix and the necessary final “.exe” on Windows;
<main-action> = E OR m OR go{-p+q} OR...; one problem here is, <main-action> can be empty and the real action can be defined by other parts of the command line
"E" will compute the expansion
“m” will launch the search for all the minimals for each puzzle in <input>
“go{-p+q}” will launch vicinity search ;;; g is the general puzzle generating option; it can take other parameters but o is the one for neighborhood search; p and q must be positive integers
<output-format> defines the type of output desired; for the present purposes, here are three usual types:
%#mc will output puzzles in minlex form (gsf minlex, not true minlex)
%#.c will output puzzles in gsf solution minlex form ⋄⋄
%C will output the solution itself
[solve-constr] = FN OR... ;;; FN stands for Naked and Hidden Singles; this defines the constraints used in the solving process in addition to “brute force”; using only FN is much faster than keeping the default (which is intended for cases when the program is used to solve or to rate puzzles; it uses many more solving techniques in order to produce a rating)
<output-requests> = <output-request>(&&< output-request>)*
<output-request> = “M>0” OR “uniq()” OR “minimal==1” OR...
M>0 ;;; requires that the output puzzles have a backdoor size greater than 0 (and be therefore not solvable with singles)
uniq() ;;; requires that the output puzzles be unique up to isomorphism among the output puzzles (very useful when generating from a batch of puzzles);
minimal==1 ;;; requires that the output puzzles be minimal
Now for the "secondary" commands (which are not specific to gsf's solver):
<secondary-commands> = (<filters>) (<output-redirect>)
<filters> = “ | sed s/0/./g ” OR... ;;; (here “|” is the Unix or Windows “pipe” function and “sed” the Unix “stream editor”; sometimes sudoku-gsf outputs puzzles with empty cells represented as “0”; this command makes sure that each “0” character is replaced with a “.”, in accordance with our preferred representation
<output-redirect> = “ > ” <output> ;;; by default, the output of sudoku-gsf is sent to the Terminal; this option allows to print it to the specified <output>file
⋄ <output> = <file-name>
<file-name> = a file name valid in the operating system; in order to make the command independent of the directory where sudoku-gsf is installed, I usually use a full path starting from the root·
.