summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-05-31 17:08:11 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-05-31 17:08:11 +0200
commit246b7f81ee28b38ce1f37cdb7cf72b6692a759df (patch)
tree36881c5455283c0d3fd599f6e4868fc4f54a482f
parent03132ff40b40fb5bbde27617e644f35623c3b8ee (diff)
downloadhastabel2idp-master.zip
hastabel2idp-master.tar.bz2
Prepares for solution printing...HEADmaster
-rw-r--r--src/hastabel2idp/HastabelResult.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/hastabel2idp/HastabelResult.java b/src/hastabel2idp/HastabelResult.java
index cc2528b..d723976 100644
--- a/src/hastabel2idp/HastabelResult.java
+++ b/src/hastabel2idp/HastabelResult.java
@@ -4,7 +4,9 @@ import hastabel2idp.OutputFile;
import hastabel.World;
import hastabel.Strings;
+
import hastabel.lang.Type;
+import hastabel.lang.Variable;
import java.util.List;
@@ -45,6 +47,7 @@ public class HastabelResult
)
{
add_solution_to_level(predicate, signature);
+ add_solution_naming_to_level(world, predicate);
add_solution_to_model
(
world.get_strings_manager(),
@@ -85,6 +88,38 @@ public class HastabelResult
level.insert_newline();
}
+ private void add_solution_naming_to_level
+ (
+ final World world,
+ final String predicate
+ )
+ {
+ boolean is_first;
+
+ is_first = true;
+
+ level.write("add_naming ");
+ level.write(predicate);
+ level.write("(");
+
+ for (final Variable var: world.get_variables_manager().get_all_seeked())
+ {
+ if (is_first)
+ {
+ is_first = false;
+ }
+ else
+ {
+ level.write(", ");
+ }
+
+ level.write(var.get_name());
+ }
+
+ level.write(")");
+ level.insert_newline();
+ }
+
private void add_solution_to_model
(
final Strings strings_manager,