summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-05-25 11:02:16 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-05-25 11:02:16 +0200
commit150afedd22804f54f06054cff15c351d6ee2ecd0 (patch)
tree22ff1c567b8918afd3975200297c3cc77113b36b
parent1dc44dfb63eda6e9588461d10995124d7fdcd03c (diff)
Trying to figure out why some predicates are empty
... in IDP.
-rw-r--r--src/hastabel/PropertyParser.g47
-rw-r--r--src/hastabel/World.java2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/hastabel/PropertyParser.g4 b/src/hastabel/PropertyParser.g4
index 581c445..5e2ef50 100644
--- a/src/hastabel/PropertyParser.g4
+++ b/src/hastabel/PropertyParser.g4
@@ -252,17 +252,21 @@ regex_special_predicate [Variable current_node]
(WS)* R_PAREN
{
+ final Type string_type;
final Expression[] params;
final hastabel.lang.Predicate string_matches;
params = new Expression[2];
+ string_type = WORLD.get_types_manager().get("string");
string_matches =
WORLD.get_predicates_manager().get("string_matches");
- if (string_matches == null)
+ if ((string_type == null) || (string_matches == null))
{
WORLD.invalidate();
}
+ string_type.mark_as_used();
+ string_matches.mark_as_used();
params[0] = ($id_or_string_or_fun.value);
params[1] =
@@ -273,7 +277,6 @@ regex_special_predicate [Variable current_node]
WORLD.invalidate();
}
- string_matches.mark_as_used();
$result = string_matches.as_formula(Arrays.asList(params));
}
diff --git a/src/hastabel/World.java b/src/hastabel/World.java
index aaa66e4..422f6ed 100644
--- a/src/hastabel/World.java
+++ b/src/hastabel/World.java
@@ -31,7 +31,7 @@ public class World extends LogicWorld
types_mgr = new Types();
- string_type = types_mgr.declare(null, "String");
+ string_type = types_mgr.declare(null, "string");
strings_mgr = new Strings(string_type, this);
variables_mgr = new Variables();