[[option.mode.INST]]
name = "inst"
help = "print instantiations during solving"
+ description = "With ``-o inst``, cvc5 prints information about quantifier instantions for individual quantifers."
+ example-file = "regress1/quantifiers/qid-debug-inst.smt2"
[[option.mode.SYGUS]]
name = "sygus"
help = "print enumerated terms and candidates generated by the sygus solver"
+ description = "With ``-o sygus``, cvc5 prints information about the internal SyGuS solver including enumerated terms and generated candidates."
+ example-file = "regress0/sygus/print-debug.sy"
[[option.mode.TRIGGER]]
name = "trigger"
help = "print selected triggers for quantified formulas"
+ description = "With ``-o trigger``, cvc5 prints the selected triggers when solving a quantified formula."
+ example-file = "regress1/quantifiers/qid-debug-inst.smt2"
[[option.mode.RAW_BENCHMARK]]
name = "raw-benchmark"
help = "print the benchmark back on the output verbatim as it is processed"
+ description = "With ``-o raw_benchmark``, cvc5 prints the benchmark back just as it has been parsed."
+ example-file = "regress0/datatypes/datatype-dump.cvc.smt2"
# Stores then enabled output tags.
[[option]]
return '\n'.join(res)
+################################################################################
+# sphinx documentation for --output @ docs/output_tags_generated.rst
+
+
+def generate_sphinx_output_tags(modules, src_dir, build_dir):
+ """Render help for the --output option for sphinx."""
+ base = next(filter(lambda m: m.id == 'base', modules))
+ opt = next(filter(lambda o: o.name == 'outputTag', base.options))
+
+ # The programoutput extension has weird semantics about the cwd:
+ # https://sphinxcontrib-programoutput.readthedocs.io/en/latest/#usage
+ cwd = '/' + os.path.relpath(build_dir, src_dir)
+
+ res = []
+ for name,info in opt.mode.items():
+ info = info[0]
+ if 'description' not in info:
+ continue
+ res.append('{} (``-o {}``)'.format(name, info['name']))
+ res.append('~' * len(res[-1]))
+ res.append('')
+ res.append(info['description'])
+ if 'example-file' in info:
+ res.append('')
+ res.append('.. command-output:: bin/cvc5 -o {} ../test/regress/{}'.format(info['name'], info['example-file']))
+ res.append(' :cwd: {}'.format(cwd))
+ res.append('')
+ res.append('')
+
+ return '\n'.join(res)
+
+
################################################################################
# main code generation for individual modules
# main code generation
-def codegen_all_modules(modules, build_dir, dst_dir, tpls):
+def codegen_all_modules(modules, src_dir, build_dir, dst_dir, tpls):
"""Generate code for all option modules."""
short, cmdline_opts, parseinternal = generate_parsing(modules)
help_common, help_others = generate_cli_help(modules)
if os.path.isdir('{}/docs/'.format(build_dir)):
write_file('{}/docs/'.format(build_dir), 'options_generated.rst',
generate_sphinx_help(modules))
+ write_file('{}/docs/'.format(build_dir), 'output_tags_generated.rst',
+ generate_sphinx_output_tags(modules, src_dir, build_dir))
data = {
# options/options.h
# Generate code
for module in modules:
codegen_module(module, dst_dir, module_tpls)
- codegen_all_modules(modules, build_dir, dst_dir, global_tpls)
+ codegen_all_modules(modules, src_dir, build_dir, dst_dir, global_tpls)
# Generate output file to signal cmake when this script was run last
open(os.path.join(dst_dir, 'options/options.stamp'), 'w').write('')