simplify(1)

NAME
simplify - perform (stable-model-preserving) conversions on a logic program

SYNOPSIS
simplify [options] [file...]

DESCRIPTION
The program simplify takes as input a program in smodels 1 format, and produces as output another program in smodels 1 format. If the -K argument is not specified, it eliminates any positive and negative requirements that may have been specified in the compute statement. For example, if the compute statment is:
    compute { a, b, not c }
simplify first removes every rule with not a or not b in the body. It then adds the rules:
    Gpr00000 :- not a, not Gpr00000.
    Gpr00000 :- not b, not Gpr00000.
Then, every rule with c in its body is eliminated, and not c is removed from the body of all remaining rules. Finally, not c is appended to the body of all rules with head c. These transformations ensure that the stable models of the simplified program are those stable models of the original program which contain a, b, and not c. Note that this step is necessary for programs which will be run under lderes or sderes—the compute statement may be encoded in the output of the grounder even when it did not occur before. If -K is specified, the program is still simplified somewhat with respect to requirements (rules are still eliminated, and negative requirements are removed from bodies where they appear negatively). However, no new rules are added, and no rules are appended to. If the -u argument is specified, simplify also makes killing atoms unique. A killing rule is a rule of the form:
    f :- a, b, not c, not f.
In this rule, f is the local killing atom. An atom is a killing atom if and only if it appears in the program only as a local killing atom (possibly in different rules) simplify -u makes these unique (such that each killing rule has a different killing atom). For example, the segment:
    f :- a, b, not f.
    f :- c, not d, not f.
    f :- not e, not f.
would become
    Gka00000 :- a, b, not Gka00000.
    GKa00001 :- c, not d, not Gka00001.
    f :- not e, not f.
All the new atoms generated by simplify -u have the form Gkannnnn; because lparse takes symbols beginning with uppercase characters to be variables, there should be no conflict with the program's atom names. simplify -u performs the compute statement conversion before uniquification, so new killing atoms introduced by the conversion are also made unique Note that simplify does not currently perform any actual simplifications, other than converting logic programs extended with the smodels compute statement into pure logic programs. In fact, with the -u argument, simplify enlarges the input program (if there exist multiple killing rules). The new program, however, usually has a better stratification than the original. Finally, simplify performs a few conversions of atom names. First, the atom &false, generated by earlier versions of lparse to represent global constraints, is renamed to False. Second, if the -d command-line argument was specified, atoms of the form atom′ are renamed to !atom and atoms of the form atom′(X) are renamed to !atom(X). Note that, if the output is intended for use with sderes or lderes, this second change affects semantics---it assumes that a pair of atoms named atom and atom′ are intended to be the classical negations of each other.

OPTIONS

-u, --uniquify
    Make killing atoms unique. The default is to not do so.

-U, --no-uniquify
    Do not make killing atoms unique. This is the default.

-d, --rename-dual
    Rename atoms and predicates of the form a′ to !a.

-D, --no-rename-dual
    Do not perform such renamings.

-k, --killing-req
    Convert requirements into killing rules. This is the default, and is required for programs that will eventually be run under sderes or lderes.

-K, --no-killing-req
    Do not convert requirements.

-t, --time
    Perform timing. The CPU time in seconds (as measured by clock(3)) is displayed to stderr after the simplification 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 simplify 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 output to filename. The default is to send output to stdout.

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

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

EXAMPLE USAGE
lparse -1 prog1 | simplify -u -n -q -o prog1.out Takes the output of “lparse -1 prog1”, simplifies it along with making killing atoms unique, and puts the result in prog1.out. Displays no messages or timing information to stderr. simplify -V prog2.in Simplifies prog2.in without making killing atoms unique. Displays the transformed program to stdout, and the messages (with extra verbosity) and timing information to stderr.

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

BUGS
simplify 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.

SEE ALSO
lparse.info, in the lparse source distribution. This file describes the input format accepted by sm2dt. stratify(1), smdtconv(1), sm2dt(1), stable(1), sderes(1), lderes(1).