From d7a2d4ac2d46ae699cb03a2dfac7d3012c35ebbd Mon Sep 17 00:00:00 2001 From: Jonathan Shahen Date: Thu, 20 Oct 2016 23:49:00 -0400 Subject: [PATCH] HOTFIX: fixing compilation error - got a working positive, need to test negatives and more positives --- .../converter/to/nusmv/ConvertToNuSMV.java | 8 ++++-- .../converter/to/nusmv/nusmvTemplate.st | 28 +++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/mohawk/converter/to/nusmv/ConvertToNuSMV.java b/src/mohawk/converter/to/nusmv/ConvertToNuSMV.java index 04c3754..f2337df 100644 --- a/src/mohawk/converter/to/nusmv/ConvertToNuSMV.java +++ b/src/mohawk/converter/to/nusmv/ConvertToNuSMV.java @@ -88,9 +88,11 @@ public class ConvertToNuSMV extends ConvertTo { st.add("goalRoles", RoleTimeSlot.grabAll(m.query._roles, m.query._timeslot, m.timeIntervalHelper, m.roleHelper)); - st.add("caruleslist", stringList("CA", caRuleCount)); - st.add("crruleslist", stringList("CR", crRuleCount)); - st.add("ceruleslist", stringList("CE", ceRuleCount)); + st.add("caruleslist", stringList("CA", caRuleCount) + + ((caRuleCount > 0 & (crRuleCount > 0 | ceRuleCount > 0 | cdRuleCount > 0)) ? "," : "")); + st.add("crruleslist", stringList("CR", crRuleCount) + + ((crRuleCount > 0 & (ceRuleCount > 0 | cdRuleCount > 0)) ? "," : "")); + st.add("ceruleslist", stringList("CE", ceRuleCount) + ((ceRuleCount > 0 & (cdRuleCount > 0)) ? "," : "")); st.add("cdruleslist", stringList("CD", cdRuleCount)); st.add("users", users); diff --git a/src/mohawk/converter/to/nusmv/nusmvTemplate.st b/src/mohawk/converter/to/nusmv/nusmvTemplate.st index 0518f14..f657311 100644 --- a/src/mohawk/converter/to/nusmv/nusmvTemplate.st +++ b/src/mohawk/converter/to/nusmv/nusmvTemplate.st @@ -8,7 +8,7 @@ numtimeslots := ; -- LTLSPEC: "G p" means that a certain condition p holds in all future time instants -- -LTLSPEC G !( = TRUE}; separator=" & ">) +LTLSPEC G !( = TRUE}; separator=" & ">) VAR rule : { @@ -24,10 +24,10 @@ rule : { user : 1 .. numusers; admin: 1 .. numusers; -U : array 1..numusers of +u : array 1..numusers of array 1..numroles of array 1..numtimeslots of boolean; -RE : array 1..numroles of +e : array 1..numroles of array 1..numtimeslots of boolean; ASSIGN @@ -39,11 +39,11 @@ ASSIGN -- User , Role Assign/Revoke -next(U[][][]) := case -user= & : TRUEFALSE}; separator="\n"> -<\t>TRUE : U[][][]; +next(u[][][]) := case +user= & : TRUEFALSE;}; separator="\n"> +<\t>TRUE : u[][][]; esac; -next(U[][][]) := U[][][]; +next(u[][][]) := u[][][]; }; separator="\n"> -- Skipping @@ -57,11 +57,11 @@ esac; -- Role Enable/Disable -next(RE[][]) := case - : TRUEFALSE}; separator="\n"> -<\t>TRUE : RE[][]; +next(e[][]) := case + : TRUEFALSE;}; separator="\n"> +<\t>TRUE : e[][]; esac; -next(RE[][]) := RE[][]; +next(e[][]) := e[][]; }; separator="\n"> -- Skipping @@ -77,13 +77,13 @@ VAR : boolean;}; separator=" ">}; separator="\n"> -- RoleEnabled - : boolean;}; separator=" "> + : boolean;}; separator=" "> ------------------------------------------------------------ !> ASSIGN -- Disabling User Role Assignments -]) := FALSE;}; separator=" ">}; separator="\n"> +]) := FALSE;}; separator=" ">}; separator="\n"> -- Disabling Roles -) := FALSE;}; separator=" "> \ No newline at end of file +) := FALSE;}; separator=" "> \ No newline at end of file -- GitLab