potassco / clingo

🤔 A grounder and solver for logic programs.
https://potassco.org/clingo
MIT License
606 stars 81 forks source link

add option to preserve facts in symbol table #457

Closed rkaminsk closed 1 year ago

rkaminsk commented 1 year ago

This replaces option --keep-facts by option --preserve-facts, which accepts an argument to specify which facts to preserve in the output.

$ echo 'a. b:-a.' | clingo --text --preserve-facts=body 
a.
b:-a.

$ echo 'a. b.' | clingo --mode=gringo --preserve-facts=symtab | lpconvert --text
a.
b.

While at it, hidden option --foobar is now available as --show-preds to specify which predicates to show on the command line:

$ echo 'a. b. c.' | clingo -V0 --show-preds='a/0,b/0'
a b
SATISFIABLE