Commit Graph

30 Commits

Author SHA1 Message Date
Patrick Lühne 2b62c6227d
Move Domain class to Utils header 2018-04-22 14:56:58 +02:00
Patrick Lühne b1ca027de5
Consolidate commonly used enum classes
This moves the commonly enum classes EvaluationResult, OperationResult,
and Tristate to the Utils header file to avoid code duplication.

Additionally, the SimplificationResult class is replaced by the
semantically similar OperationResult.
2018-04-21 17:34:52 +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 159717f51c
Support declaring functions as integer
This adds a new syntax for declaring functions integer:

    #external integer(<function name>(<arity)).

If a function is declared integer, it may enable some variables to be
detected as integer as well.
2018-04-20 16:37:48 +02:00
Patrick Lühne 55f7fd4ff3
Minor refactoring 2018-04-20 16:37:48 +02:00
Patrick Lühne ae918a0846
Moved Domain enum to separate header
For clarity, this moves the Domain enum class to a separate header,
because it’s not just variable-specific but also applicable to
functions, for example.
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 504f7da4c3
Add unknown variable domain
Before being able to tell whether a variable’s domain is general or
integer, it is necessary to flag it as “unknown.”
2018-04-20 16:37:48 +02:00
Patrick Lühne d2b48f9679
Move Tristate class to separate header
The Tristate class (representing truth values that are either true,
false, or unknown) is used at multiple ends. This moves it to a separate
header for reusing it properly.
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 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 14abc37116
Implemented #show statements for completed output. 2017-06-05 03:02:22 +02:00
Patrick Lühne 2bc60d3eea
Started implementing support for #show statements. 2017-06-01 04:05:11 +02:00
Patrick Lühne 957457939c
Minor formatting. 2017-06-01 00:15:48 +02:00
Patrick Lühne f78c0e4da5
Reordered constructor parameters of VariableDeclaration. 2017-05-30 16:27:45 +02:00
Patrick Lühne 9a3c85dc83
Dropping now unused body variable names. 2017-05-30 16:20:57 +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 108c51cf28
Fixed Variant move semantic issue with older compilers. 2017-04-11 16:59:58 +02:00
Patrick Lühne d999415c3d
Enforcing move semantics on all AST elements explicitly. 2017-04-11 15:55:31 +02:00
Patrick Lühne 811eb3054c
Partly implemented completion. 2017-04-06 17:46:16 +02:00
Patrick Lühne c3351206b9
Removed unused code. 2017-04-06 17:19:32 +02:00
Patrick Lühne 3c79625685
Constrained the element’s type in set element expressions to primitive terms. 2017-03-29 23:56:58 +02:00
Patrick Lühne 825cd4de39
Refactored formula simplification with Clingo’s variants. 2017-03-23 00:44:10 +01:00
Patrick Lühne fc538eb7fc
Started implementing output simplifications. 2017-03-16 15:45:55 +01:00
Patrick Lühne 73f67f5c17
Added back support for function symbols. 2017-03-15 17:01:09 +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 f139e375f1
Added initial abstract syntax tree for first-order logic formulas. 2017-03-08 01:21:03 +01:00