|
@@ -375,6 +375,9 @@ Element function tf_matchAll(tf_ma_transformation: Element, tf_ma_pattern : Elem
|
|
|
|
|
|
|
|
Element function mergeLHSNAC(tf_er_lhs : Element, tf_er_nac: Element):
|
|
Element function mergeLHSNAC(tf_er_lhs : Element, tf_er_nac: Element):
|
|
|
|
|
|
|
|
|
|
+ if (read_nr_out(tf_er_nac)==0):
|
|
|
|
|
+ return tf_er_lhs
|
|
|
|
|
+
|
|
|
//timing info
|
|
//timing info
|
|
|
Integer starttime
|
|
Integer starttime
|
|
|
starttime = current_time()
|
|
starttime = current_time()
|
|
@@ -388,6 +391,7 @@ Element function mergeLHSNAC(tf_er_lhs : Element, tf_er_nac: Element):
|
|
|
Boolean allow_match
|
|
Boolean allow_match
|
|
|
Integer nac_index
|
|
Integer nac_index
|
|
|
Boolean plabel_match_exists
|
|
Boolean plabel_match_exists
|
|
|
|
|
+
|
|
|
while(list_len(tf_er_lhs) > 0):
|
|
while(list_len(tf_er_lhs) > 0):
|
|
|
lhs_match = set_pop(tf_er_lhs)
|
|
lhs_match = set_pop(tf_er_lhs)
|
|
|
allow_match=True
|
|
allow_match=True
|
|
@@ -397,15 +401,18 @@ Element function mergeLHSNAC(tf_er_lhs : Element, tf_er_nac: Element):
|
|
|
nac_index = nac_index + 1
|
|
nac_index = nac_index + 1
|
|
|
lhs_match_keys = dict_keys(lhs_match)
|
|
lhs_match_keys = dict_keys(lhs_match)
|
|
|
plabel_match_exists = False //we assume that the nac prohibits all
|
|
plabel_match_exists = False //we assume that the nac prohibits all
|
|
|
- while (bool_and(read_nr_out(lhs_match_keys)>0, allow_match)):
|
|
|
|
|
|
|
+ allow_match=False
|
|
|
|
|
+ while (read_nr_out(lhs_match_keys)>0):
|
|
|
lhs_match_key = set_pop(lhs_match_keys)
|
|
lhs_match_key = set_pop(lhs_match_keys)
|
|
|
if dict_in(nac_match, lhs_match_key):
|
|
if dict_in(nac_match, lhs_match_key):
|
|
|
plabel_match_exists = True //the assumption is disproved, which means we can continue looking
|
|
plabel_match_exists = True //the assumption is disproved, which means we can continue looking
|
|
|
- if (element_eq(nac_match[lhs_match_key]["hn"],lhs_match[lhs_match_key]["hn"])):
|
|
|
|
|
- allow_match = False
|
|
|
|
|
|
|
+ if bool_not(element_eq(nac_match[lhs_match_key]["hn"],lhs_match[lhs_match_key]["hn"])):
|
|
|
|
|
+ allow_match = True
|
|
|
if bool_not(plabel_match_exists): //if the assumption is not disproved, the nac prohibits all matches and no matches should remain after merge
|
|
if bool_not(plabel_match_exists): //if the assumption is not disproved, the nac prohibits all matches and no matches should remain after merge
|
|
|
|
|
+ log("plabel match didn't seem to exist")
|
|
|
return create_node()
|
|
return create_node()
|
|
|
if (allow_match):
|
|
if (allow_match):
|
|
|
|
|
+ log("allow match")
|
|
|
list_append(final_matches, lhs_match)
|
|
list_append(final_matches, lhs_match)
|
|
|
|
|
|
|
|
//timing info
|
|
//timing info
|