Commit Graph

27 Commits

Author SHA1 Message Date
Patrick Lühne 0ce4e54d1a
Fix precedence of interval operator
The interval operator has a lower precedence than, for example, binary
operations. This was unexpected and incorrectly implemented in the
output functions. For now, this is fixed by enclosing intervals in
parentheses to avoid misinterpretations.

The existing unit tests are adjusted to the updated output format.
2018-05-04 17:06:28 +02:00
Patrick Lühne a2c4d87852
Prefix integer variables with “N”
This prefixes integer variables with “N” to distinguish them from
general variables in the output in analogy to common mathematical
notations.
2018-04-29 22:28:42 +02:00
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 e15a6b2e88
Remove Constant class
Constants are not a construct present in Clingo’s AST and were
unintentionally made part of anthem’s AST. This removes the unused
classes for clarity.
2018-04-27 17:08:41 +02:00
Patrick Lühne 04094eee23
Remove unnecessary parentheses
The unary modulus operation does not require extra parentheses to be
printed in cases like “|X + Y|”. This adds a new option to the printing
routine to omit parentheses in cases where the parent expression already
defines a parenthesis-like scope (currently only with unary operations).
2018-04-12 00:59:03 +02:00
Patrick Lühne 8c250f5c59
Support modulus operation (absolute value)
This adds support for computing the absolute value of a term along with
an according unit test.
2018-04-12 00:38:48 +02:00
Patrick Lühne eaabeb0c55
Support exponentiation operator
Because of a bug in the Clingo API, the exponentation operator was not
properly exposed to anthem. This updates Clingo to a version with a
fixed API and adds proper support for exponentation within anthem along
with a matching unit test.
2018-04-10 22:29:55 +02: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 957457939c
Minor formatting. 2017-06-01 00:15:48 +02:00
Patrick Lühne 0d8b1e94da
Refactored error handling. 2017-05-31 18:03:19 +02:00
Patrick Lühne 7aad8380d1
Refactored logging interface. 2017-05-30 17:19:26 +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 f28873617d
Implemented translation of anonymous variables. 2017-03-29 21:28:46 +02:00
Patrick Lühne c63d74092e
Removed unnecessary assertion. 2017-03-28 17:33:32 +02:00
Patrick Lühne 825cd4de39
Refactored formula simplification with Clingo’s variants. 2017-03-23 00:44:10 +01:00
Patrick Lühne 9e6d135781
Implemented explicit syntax tree representation for first-order formulas. 2017-03-15 16:00:43 +01:00
Patrick Lühne 259ec5ae2f
Fixed minor typos in include guards. 2016-11-29 03:32:50 +01:00
Patrick Lühne a0cf6e21e4
Implemented command-line option for setting the output log priority. 2016-11-24 23:25:53 +01:00
Patrick Lühne 5816207af7
Renamed “note” to “info.” 2016-11-24 22:58:13 +01:00
Patrick Lühne f6e6b6fd60
Fixed bug in color support detection. 2016-11-24 15:01:15 +01:00
Patrick Lühne eff3b45089
Added Logger constructors to write output to arbitrary streams. 2016-11-24 13:54:40 +01:00
Patrick Lühne 8a587eb57a
Removed unnecessary default constructors. 2016-11-24 13:46:11 +01:00
Patrick Lühne 098f2bf813
Implemented syntax highlighting for consequent part. 2016-11-24 03:16:37 +01:00
Patrick Lühne 018559b8cf
Started implementing color output (currently for head only). 2016-11-24 02:42:32 +01:00
Patrick Lühne e6a9ee1cc7
Started implementing improved output utilities. 2016-11-24 00:21:01 +01:00