stratify(1)

NAME
stratify - compute a relaxed stratification of a logic program

SYNOPSIS
stratify [options] [file...]

DESCRIPTION
The program stratify computes a relaxed stratification of a logic program. A relaxed stratification is a partition of the rules in a program such that, for each rule in a given strata, no atom appearing in the head of that rule appears in any rule in a previous stratum. stratify takes as its input a file in smodels 1 format, and produces as output another file in smodels 1 format (the same program, with rules ordered as appropriate) and a stratification file in DeReS format. stratify begins by constructing a directed dependency graph from the program. If atom A appears in the body of rule R, there is an edge in the graph from R to A; if atom A appears in the head of rule R, there is an edge from R to A as well as one from A to R. stratify then computes the strongly-connected components of this graph. It then topologically sorts the resulting component dag, outputting the components in topological order.

OPTIONS

-t, --time
    Perform timing. The CPU time in seconds (as measured by clock(3)) is displayed to stderr after the stratification is performed. This is the default.

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

-V, --verbose
    Display extra status information to stderr. This flag causes stratify to print a message when entering each phase of computation.

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

-q, --quiet
    Do not display any messages (other than perhaps timing information) to stderr.

-o filename, --output=filename
    Send the output program to filename.ord and the stratification to filename.str. The default is to send the program to stdout and the stratification to filename.str, where filename is the name of the input file (or “stratify” if input is from stdin).

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

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

EXAMPLE USAGE
stratify -o p1 prog1.sm -q Stratify prog1.sm, placing the reordered program in p1.ord and the stratification in p1.str. With these options, stratify displays timing information but nothing else. lparse -1 prog2.lp | stratify -n Stratify the output of “lparse -1 prog2.lp”, printing status messages (without timing information) to stderr, the reordered program to stdout, and the stratification to stratify.str.

AUTHOR
Neil Moore <neil@cs.uky.edu> simplify is Copyright © 1998-1999 The University of Kentucky. See the file COPYRIGHT in the lpsms distribution for details.

BUGS
stratify does not currently support the smodels 2 format. lparse can produce both smodels 1 and 2 format programs, and we do not deal with smodels 2 special rule types, so support for the smodels 2 format is not a high priority. There should be a single unified format which supports specifying a stratification with the program. Then stratify and stable would need only deal with a single file.

SEE ALSO
simplify(1), smdtconv(1), sm2dt(1), stable(1), sderes(1), lderes(1).