Commit Graph

17 Commits

Author SHA1 Message Date
Patrick Lühne 3ba80e8c9d
Minor refactoring 2018-04-27 17:38:29 +02:00
Patrick Lühne c294a29cb2
Support placeholders with #external declarations
This adds support for declaring predicates as placeholders through the
“#external” directive in the input language of clingo.

Placeholders are not subject to completion. This prevents predicates
that represent instance-specific facts from being assumed as universally
false by default negation when translating an encoding.

This stretches clingo’s usual syntax a bit to make the implementation
lightweight. In order to declare a predicate with a specific arity as a
placeholder, the following statement needs to be added to the program:

    #external <predicate name>(<arity>).

Multiple unit tests cover cases where placeholders are used or not as
well as a more complex graph coloring example.
2018-04-08 20:28:57 +02:00
Patrick Lühne 22238bb398
Switch to C++17
With C++17, optionals, an experimental language feature, were moved to
the “std” namespace. This makes C++17 mandatory and drops the now
obsolete “experimental” namespace.
2018-03-24 16:09:52 +01:00
Patrick Lühne bbbd0b65a4
Added new option --parentheses=full to make parsing the output easier. 2017-06-06 02:02:26 +02:00
Patrick Lühne 0285c1cbbb
Renamed internal variables for clarity. 2017-06-06 01:44:44 +02:00
Patrick Lühne 2bc60d3eea
Started implementing support for #show statements. 2017-06-01 04:05:11 +02:00
Patrick Lühne e998c5b7be
Removed unused variable. 2017-06-01 00:16:02 +02:00
Patrick Lühne 1c925d661b
Major refactoring to uniquely link variables to their declarations (breaks simplification and completion). 2017-05-30 03:56:35 +02:00
Patrick Lühne 838a68e230
Refactoring to prepare for implementing completion. 2017-04-05 18:15:42 +02:00
Patrick Lühne f28873617d
Implemented translation of anonymous variables. 2017-03-29 21:28:46 +02:00
Patrick Lühne 29233a7430
Fixed incorrectly named auxiliary body variable counter. 2017-03-28 17:24:41 +02:00
Patrick Lühne fc538eb7fc
Started implementing output simplifications. 2017-03-16 15:45:55 +01:00
Patrick Lühne 70cb79b233
Implemented choice rules. 2017-03-06 15:40:23 +01:00
Patrick Lühne 442fa8791a
Fixed continuous numbering of auxiliary variables. 2016-11-24 16:50:35 +01:00
Patrick Lühne 223d380a03
Indexing variables from 1 on and not 0. 2016-11-24 15:25:34 +01:00
Patrick Lühne 6af3b7b875
Made all visitors consistent in taking an Context object as an argument. 2016-11-24 00:52:28 +01:00
Patrick Lühne 29d1c15137
Implemented translation of positive body literals. 2016-11-23 05:00:33 +01:00