This is an extension of the Maude strategy language for narrowing (instead of rewriting).
The prototype can be used in two ways, as an extended Maude interpreter or as a command-line tool. For the first option, execute
$ ./snarrow.py [<Maude file>]
and the typical Maude prompt will appear. In addition to the standard Maude commands, it understands snarrow [[<number>]] [in <module name> :] <initial term> using <strategy> .
.
Its syntax as a command-line tool is
$ ./snarrow.py <Maude file> [-m <module name>] <initial term> <strategy> [--max-sols <number>]
The output will coincide with that of the equivalent snarrow
command.
The command relies on the Python implementation of the strategy language contained in the umaudemc package, which can be installed with pip install umaudemc
.
--no-unify-test
does not change matching by unification in thematch
test (matching is always applied withxmatch
andamatch
).unify
is syntactic sugar formatch
even if this option is enabled.--no-unify-matchrew
does not change matching by unification in thematchrew
combinator (matching is always applied forxmatchrew
andamatchrew
).unifynarrow
is syntactic sugar formatchrew
even if this option is enabled.--no-conditional
disables narrowing with conditional rules, which is enabled by default. Conditional rules are applied by adding the equational conditions to the narrowing problem of the main pattern, and doing strategy-controlled narrowing search for the rewriting conditions. Rules with rewriting conditions only are never disabled, since the user cannot apply them inadvertently because of their explicit syntax.--no-filtered
disables variant filtering.
Any (perhaps unconditional) rule in the module can be applied, even those not including the narrowing
attribute. The strategy all
does a narrowing step using any unconditional rule.
Several test cases on the Maude files of the test
directory can be executed with ./test.sh
. The output of this script should coincide with the test.expected
file. Namely, there is a Prolog-like logic programming interpreter implementing cut and negation by means of strategies.