瀏覽代碼

Slight improvement to matching of error pattern in power window case
study

Yentl Van Tendeloo 8 年之前
父節點
當前提交
6ea51f1d69
共有 1 個文件被更改,包括 22 次插入1 次删除
  1. 22 1
      models/matches.mvc

+ 22 - 1
models/matches.mvc

@@ -6,6 +6,25 @@ A B {
     Composite schedule {
         {Contains} Failure failure {}
         {Contains} Success success {}
+        {Contains} Query query {
+            LHS {
+                Pre_Query/Place {
+                    label = "2"
+                }
+                Pre_ReachabilityGraph/Place {
+                    label = "3"
+                }
+
+                constraint = $
+                    Boolean function constraint(host_model : Element, mapping : Element):
+                        Boolean names_match
+                        Boolean tokens_match
+                        names_match = value_eq(read_attribute(host_model, mapping["2"], "name"), read_attribute(host_model, mapping["3"], "name"))
+                        tokens_match = value_eq(read_attribute(host_model, mapping["2"], "tokens"), read_attribute(host_model, mapping["3"], "tokens"))
+                        return bool_and(names_match, tokens_match)!
+                    $
+            }
+        }
         {Contains} ForAll match {
             LHS {
                 Pre_Query/Place {
@@ -50,7 +69,9 @@ A B {
             }
         }
     }
-    Initial (schedule, match) {}
+    Initial (schedule, query) {}
+    OnSuccess (query, match) {}
+    OnFailure (query, failure) {}
     OnSuccess (match, success) {}
     OnFailure (match, failure) {}
 }