Commit Graph

39 Commits

Author SHA1 Message Date
Patrick Lühne 69688d1d39
Add integer simplification rule
This adds the rule “(F in G) === (F = G) if F and G are integer
variables” to the simplification rule tableau
2018-04-29 22:28:42 +02:00
Patrick Lühne e0509f725a
Replace SimplificationResult with OperationResult
This replaces the SimplificationResult enum class with OperationResult.
The rationale is that this type, which just reports whether or not an
operation actually changed the input data, is not simplification-
specific and will be used for integer variable detection as well.
2018-04-27 23:37:13 +02:00
Patrick Lühne 48cf8ee3e0
Minor refactoring
Reorders some include directives lexicographically.
2018-04-27 23:35:43 +02:00
Patrick Lühne f7d99c82fa
Move Tristate class to Utils header
The Tristate class (representing truth values that are either true,
false, or unknown) will be used at multiple ends. This moves it to a
separate header in order to reuse it properly.
2018-04-27 23:19:42 +02:00
Patrick Lühne 797660d6de
Add new simplification rule
This adds the rule “(not F [comparison] G) === (F [negated comparison]
G)” to the simplification rule tableau.
2018-04-11 21:39:27 +02:00
Patrick Lühne 40ddee8444
Add new simplification rule
This adds the rule “(not F or G) === (F -> G)” to the simplification
rule tableau.
2018-04-10 22:34:47 +02:00
Patrick Lühne 6f7b021712
Add new simplification rule
This adds the rule “(not (F and G)) === (not F or not G)” to the
simplification rule tableau.
2018-04-10 22:34:47 +02:00
Patrick Lühne 23624007ec
Add new simplification rule
This adds the rule “not not F === F” to the simplification rule tableau.
2018-04-10 22:34:47 +02:00
Patrick Lühne 6d7b91c391
Add new simplification rule
This adds the rule “(F <-> (F and G)) === (F -> G)” to the
simplification rule tableau.
2018-04-10 22:34:47 +02:00
Patrick Lühne b88393655a
Iteratively apply simplification tableau rules
With this change, the tableau rules for simplifying formula are applied
iteratively until a fixpoint is reached.
2018-04-10 22:34:47 +02:00
Patrick Lühne c4c3156e77
Move simplification rule to tableau
This moves the rule “[primitive A] in [primitive B] === A = B” to the
simplification rule tableau.
2018-04-10 22:34:47 +02:00
Patrick Lühne 107dae7287
Move simplification rule to tableau
This moves the rule “exists () (F) === F” to the simplification rule
tableau.
2018-04-10 22:34:47 +02:00
Patrick Lühne 827d6e40fe
Move simplification rule to tableau
This moves the rule “[conjunction of only F] === F” to the
simplification rule tableau.
2018-04-10 22:34:47 +02:00
Patrick Lühne 4a85fc4b23
Move simplification rule to tableau
This moves the rule “exists ... ([#true/#false]) === [#true/#false]” to
the simplification rule tableau along with “[empty conjunction] ===
2018-04-10 22:34:46 +02:00
Patrick Lühne 7e3fc007c8
Move simplification rule to tableau
This moves the rule “exists X (X = t and F(X)) === exists () (F(t))” to
the simplification rule tableau.
2018-04-10 22:34:46 +02:00
Patrick Lühne 5c5411c0ff
Implement simplification rule tableau
This implements a tableau containing simplification rules that can be
iteratively applied to input formulas until they remain unchanged.

First, this moves the rule “exists X (X = Y) === #true” to the tableau
as a reference implementation.
2018-04-10 22:34:46 +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 5f8c144628
Fixed regression in simplifying predicates with more than one argument. 2017-06-12 18:27:39 +02:00
Patrick Lühne 7ae0a1f289
Removed unnecessary parentheses after simplification. 2017-06-05 03:58:39 +02:00
Patrick Lühne 3b26580815
Minor formatting. 2017-06-05 03:54:17 +02:00
Patrick Lühne 4fd143ef64
Added simplification rule “exists X (X = Y)” → “#true.” 2017-06-05 02:41:17 +02:00
Patrick Lühne 7bf5d3867d
Minor clarification on side effects of a function. 2017-06-05 00:19:43 +02:00
Patrick Lühne ab71e8eb0a
Minor refactoring. 2017-06-04 20:55:25 +02:00
Patrick Lühne 1917f18b6a
Added back simplification support. 2017-05-30 04:06:56 +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 6e7abb283e
Fixed minor incorrect variable references. 2017-04-10 17:50:19 +02:00
Patrick Lühne 5940fc4a3b
Removed workarounds thanks to a fix in clingo. 2017-04-01 03:13:52 +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 dbb106c40b
Fixed typo in comment. 2017-03-29 23:18:59 +02:00
Patrick Lühne 3df4d5a2a2
Fixed incorrectly simplified rules with comparisons. 2017-03-28 17:13:15 +02:00
Patrick Lühne cae0948763
Completed implementing simplification with deep variable replacement. 2017-03-23 15:02:06 +01:00
Patrick Lühne 42e0217409
Applying simplification to more cases. 2017-03-23 14:40:21 +01:00
Patrick Lühne 574130a8ec
Minor clarifications in simplification code annotations. 2017-03-23 13:44:55 +01:00
Patrick Lühne 188a24f5b5
Added some annotations to the simplification code. 2017-03-23 13:39:34 +01:00
Patrick Lühne ddbd4061e4
Moved recursive formula visitor to separate header file. 2017-03-23 13:28:09 +01:00
Patrick Lühne 13ed0b013a
Made substitution of variables with terms fully recursive. 2017-03-23 01:00:54 +01:00
Patrick Lühne 825cd4de39
Refactored formula simplification with Clingo’s variants. 2017-03-23 00:44:10 +01:00
Patrick Lühne bf8cf75369
Implemented advanced simplification (some formulas not covered yet). 2017-03-17 02:42:48 +01:00
Patrick Lühne fc538eb7fc
Started implementing output simplifications. 2017-03-16 15:45:55 +01:00