stable(1)

NAME
stable - compute stable models of logic programs

SYNOPSIS
stable [options] [file]

DESCRIPTION
The program stable computes stable models of logic programs. It accepts logic programs in smodels format, usually generated by make-stable or lparse .

OPTIONS

-s strfile, --stratification=strfile
    Read the stratification from strfile. Stratification is in DeReS stratification format, as produced by stratify.

-F, --full-lookahead
    Perform full lookahead. This option causes stable to spend more time in lookahead, in the hopes of reducing the total number of choice points. This option is the default.

-S, --sloppy-lookahead
    Do not perform full lookahead. This option will most likely be removed soon.

-1, --single
    Compute a single stable model. This is the default.

-a, --all
    Compute all stable models.

-c N, --count=N
    Compute the first N stable models.

-t, --time
    Perform timing. The CPU time in seconds used by parsing and computation, as well as the CPU time used in finding each model (as measured by clock(3)) is displayed to stdout after the computation. This is the default.

-n, --no-time
    Do not display timing information.

-V, --verbose
    Display extra information to stderr. This flag causes stable to print a message to stderr upon entering each phase of processing.

-m, --messages
    Display only error messages to stderr. Display stable models (and possibly timing information, depending on the state of the -t and -n flags) to stdout.

-q, --quiet
    Display nothing to stderr; display stable models and possibly timing information to stdout.

-qq, --very-quiet
    Display nothing to stderr. Also do not display stable models to stdout; count them only. Timing information may still be printed, depending on the state of the -t and -n flags.

-v, --version
    Print version information to stdout. The information indicates the version numbers of lderes, liblp, and lpsms.

-h, --help
    Display usage information to stdout.

EXAMPLE USAGE
stable -t -q -c 9 -S prog1.org -s prog1.str Compute the first nine extensions of the program in prog1.ord, using sloppy lookahead and the stratification in prog1.str; display the extensions and timing information, but no other status messages, to stdout. sderes -qq -1 prog2.ord Determine whether prog2 has at least one extension; display timing information, but not the stable model or anything else. Use full lookahead without stratification.

AUTHOR
stable was written by Neil Moore <neil@cs.uky.edu>, but is closely based on the algorithms used in smodels. smodels was written by Patrik Simons <Patrik.Simons@hut.fi>. stable is Copyright © 1999 The University of Kentucky. See the file COPYRIGHT in the lpsms distribution for details.

BUGS
stable measures forced atoms and conflicts differently than does smodels. Sometimes (actually, quite often) it is better to not use stratification; the backchaining in the smodels algorithm allows for the choice of an atom in a higher stratum to expand more atoms in lower strata. Stratification simply forces stable to expand on some atom in the lower stratum, even when a higher stratum would have given better results. In general, this results in many more choice points than are actually necessary. Additionally, stable keeps the original stratification throughout the computation. It would be best to recompute the stratification periodically based on the simplified program. For example, if the atom p has been forced or chosen true, the stratum in which appears as a rule head may be split up, as edges involving p may be ignored in the stratification graph. stable should support the smodels compute statement; then simplify would not be required for programs with global constraints (headless rules). Finally, stable is in many cases much slower than smodels. Most of this is probably due to implementation details, and can be easily fixed.

SEE ALSO
lderes(1), sderes(1), stratify(1), simplify(1), make-stable(1).
smodels is available from http://saturn.tcs.hut.fi/pub/smodels/. A discussion of the algoritm may be found in:
P. Simons. `Towards constraint satisfaction through logic programs and the stable model semantics'. Research Report 47, Helsinki University of Technology, Helsinki, Finland, August 1997.
This report is available at http://www.tcs.hut.fi/Publications/reports/A47.ps.gz.