options.md
April 18, 2020 ยท View on GitHub
Command line interface
The main Lambdapi executable is called lambdapi, and it can be invoked using
lambdapi COMMAND .... To see the list of the supported commands, simply run
lambdapi --help or lambdapi help. To get the documentation of a specific
command run lambdapi COMMAND --help. It will contain the list of flags that
are supported for the command.
The available commands are:
help: display the main help message.version: give the current version of Lambdapi.check: runs the main type-checking mode on input source files.init: creates a new Lambdapi package. For more information have a look at the getting started section.install: installs the specified files according to package configuration.uninstall: uninstalls the specified package.parse: runs the parsing-only mode on input source files.beautify: runs the parser and pretty-printer on input source files.lsp: runs the Lambdapi LSP server.decision-tree: prints the decision tree for rule filtering of a symbol in the Dot language on standard output. For more information on the graph and how to read them, seesrc/core/tree_graphviz.ml.
Note: the parse and beautify commands can trigger the compilation of
dependencies if the required object files (.lpo extension) are not present.
Note the commands that expect files are not limited to a single one. The given files are all handled independently (in the order they are given). The program immediately stops on the first failure, without going to the next file (if any).
Input files
The commands check, parse and beautify expect input files with either
the standard .lp extension, or the legacy (Dedukti) .dk extension. The
appropriate parser is selected automatically.
Note: the beautify command outputs only standard syntax, and hence it
can be used to convert legacy syntax files (with the .dk extension) into the
Lambdapi syntax.
Common flags
The commands check, parse, beautify, lsp and decision-tree all support
the following command line arguments and flags.
Configuration flags
-
--gen-objor-cinstructslambdapito generate object files for every checked module (including dependencies). Object files have the extension.lpoand they are automatically read back when necessary if they exist and are up to date (they are regenerated otherwise). -
--verbose NUMsets the verbosity level to the given natural number (the default value is 1). A value of 0 should not print anything, and the higher values (up to 3) print more and more information. -
--lib-root DIRsets the library root, that is, the folder corresponding to the entry point of the Lambdapi package system. This is the folder under which every package is installed, and a default value is only known if the program has been installed. In development mode,--lib-root libmust be given (assuming Lambdapi is run at the root of the repository). -
--map-dir MOD:DIRmaps an arbitrary directoryDIRunder a module pathMOD(relative to the root directory). This option is mainly useful during the development of a package (before it has been installed). However it can also be accessed using a package configuration file (lambdapi.pkg) at the root of the library's source tree. More information on that is given in the section about the module system. -
--keep-rule-orderforces the rewriting engine to try and apply the rules in the order of their declaration.
Debugging flags
-
--debug FLAGSenables the debugging modes specified by every character ofFLAGS. Details on available character flags are obtained using--help. -
--timeout NUMgives up type-checking after the given number of seconds. Note that the timeout is reset between each file, and that the parameter of the command is expected to be a natural number.
Confluence checking
Lambdapi provides an option --confluence CMD to check the confluence of the
rewriting system by calling an external prover with the command CMD. The
given command receives HRS
formatted text on its standard input, and it is expected to output on the
first line of its standard output either YES, NO or MAYBE.
As an example, echo MAYBE is the simplest possible (valid) confluence-check
that one may use.
For now, only the CSI^ho
confluence checker has been tested with Lambdapi. It can be called using the
flag --confluence "path/to/csiho.sh --ext trs --stdin".
To inspect the .trs file generated by Lambdapi, one may use the following
dummy command: --confluence "cat > output.trs; echo MAYBE".
Termination checking
Lambdapi provides an option --termination CMD to check the termination of
the rewriting system by calling an external prover with the command CMD. The
given command receives XTC
formatted text on its standard input, and it is expected to output on the
first line of its standard output either YES, NO or MAYBE.
As for confluence, echo MAYBE is the simplest possible (valid) command for
checking termination.
To the best of our knowledge, the only termination checker that is compatible
with all the features of Lambdapi is SizeChangeTool.
It can be called using the flag --termination "path/to/sct.native --no-color --stdin=xml"
If no type-level rewriting is used Wanda
can also be used. However, it does not directly accept input on its standard
input, so it is tricky to have Lambdapi call it directly. Alternatively, one
can first generate a .xml file as described below.
To inspect the .xml file generated by Lambdapi, one may use the following
dummy command: --termination "cat > output.trs; echo MAYBE".
Specific flags for the "check" command
-
--too-long FLOATgives a warning for each interpreted source file command taking more than the given number of seconds to be checked. The parameterFLOATis expected to be a floating point number. -
--recompileforces the compilation of the files given on the command line even if they have an up-to-date object file.
Specific flags for the "lsp" command
-
--standard-lsprestricts to standard LSP protocol (no extension). -
--lsp-log-file FILEsets the log file for the LSP server. If not given, the file/tmp/lambdapi_lsp_log.txtis used.
Specific flags for the "install" and "uninstall" commands
--dry-runprints the system commands that should be called instead of running them.