Commit Graph

20 Commits

Author SHA1 Message Date
Patrick Lühne 43d2c153c7
Represent predicate parameters explicitly
This adds a vector of Parameter structs to PredicateDeclaration. In this
way, the domain of each parameter can be tracked individually.
2018-04-28 01:48:39 +02:00
Patrick Lühne 618189368c
Split functions from their declarations
This splits occurrences of functions from their declaration. This is
necessary to flag integer functions consistently and not just single
occurrences.
2018-04-27 17:59:10 +02:00
Patrick Lühne d0debc6ad1
Split predicates from their declarations
This refactoring separates predicates from their declarations. The
purpose of this is to avoid duplicating properties specific to the
predicate declaration and not its occurrences in the program.
2018-04-27 17:55:59 +02:00
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