Commit Graph

16 Commits

Author SHA1 Message Date
Patrick Lühne d1ee6eca19
Add suffix to variables with known domain
This adds suffixes to integer and general variables, where the domain is
explicitly known.
2018-04-20 16:37:49 +02:00
Patrick Lühne 7bde7c498f
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-20 16:37:48 +02:00
Patrick Lühne f48802842e
Split functions from their declaration
This splits occurrences of functions from their declaration. This is
necessary to flag integer functions consistently and not just single
occurrences.
2018-04-20 16:37:48 +02:00
Patrick Lühne b5b05b766c
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-20 16:37:48 +02:00
Patrick Lühne 2372eb24c4
Refactor predicate representation
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-20 16:37:47 +02:00
Patrick Lühne 87dcd6ee93
Add domain specifier to variable declarations
With this change, the domain of variable declarations can be specified.
While the default is the general domain of all precomputed value, this
adds support for integer variables, for which advanced simplification
rules apply.
2018-04-20 16:37:47 +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 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