clean-up
This commit is contained in:
@@ -135,7 +135,6 @@ class DRSGenerator:
|
||||
rcts.add(SingleReaction(reactants, ["h"], ["TF"]))
|
||||
|
||||
def generate(self):
|
||||
|
||||
print(f"# Generated for: x = {self.x}, y = {self.y}, z = {self.z}")
|
||||
|
||||
print("options { use-context-automaton; make-progressive; };")
|
||||
@@ -211,7 +210,6 @@ class DRSGenerator:
|
||||
print(aut)
|
||||
|
||||
def generate_automaton_5(self, n):
|
||||
|
||||
aut = self.automaton
|
||||
|
||||
for i in range(0, (4 * n + 1)):
|
||||
@@ -256,7 +254,6 @@ class DRSGenerator:
|
||||
print(aut)
|
||||
|
||||
def generate_formula(self):
|
||||
|
||||
disjunction = " OR ".join([f"proc{i}.TF" for i in range(1, self.y + 1)])
|
||||
conjunction = " AND ".join([f"~proc{i}.TF" for i in range(1, self.y + 1)])
|
||||
|
||||
|
||||
@@ -58,24 +58,34 @@ init_trans += "}: init -> green;\n"
|
||||
transitions += init_trans
|
||||
|
||||
for i in range(n):
|
||||
transitions += "{:s}{{ proc{:d}={{allowed}} }}: green -> red : proc{:d}.req;\n".format(8*" ", i, i)
|
||||
transitions += (
|
||||
"{:s}{{ proc{:d}={{allowed}} }}: green -> red : proc{:d}.req;\n".format(
|
||||
8 * " ", i, i
|
||||
)
|
||||
)
|
||||
|
||||
no_req_cond = "~proc0.req"
|
||||
for i in range(1, n):
|
||||
no_req_cond += " AND ~proc{:d}.req".format(i)
|
||||
|
||||
for i in range(n):
|
||||
transitions += "{:s}{{ proc{:d}={{}} }}: green -> green : {:s};\n".format(8*" ", i, no_req_cond)
|
||||
transitions += "{:s}{{ proc{:d}={{}} }}: green -> green : {:s};\n".format(
|
||||
8 * " ", i, no_req_cond
|
||||
)
|
||||
|
||||
for i in range(n):
|
||||
transitions += "{:s}{{ proc{:d}={{}} }}: red -> green : proc{:d}.leave;\n".format(8*" ", i, i)
|
||||
transitions += "{:s}{{ proc{:d}={{}} }}: red -> green : proc{:d}.leave;\n".format(
|
||||
8 * " ", i, i
|
||||
)
|
||||
|
||||
no_leave_cond = "~proc0.leave"
|
||||
for i in range(1, n):
|
||||
no_leave_cond += " AND ~proc{:d}.leave".format(i)
|
||||
|
||||
for i in range(n):
|
||||
transitions += "{:s}{{ proc{:d}={{}} }}: red -> red : {:s};\n".format(8*" ", i, no_leave_cond)
|
||||
transitions += "{:s}{{ proc{:d}={{}} }}: red -> red : {:s};\n".format(
|
||||
8 * " ", i, no_leave_cond
|
||||
)
|
||||
|
||||
out += CA_STR.format(transitions)
|
||||
|
||||
@@ -114,4 +124,3 @@ formula = "AG( proc0.in IMPLIES C[{:s}]({:s}) )".format(all_agents,subf)
|
||||
out += PROPERTY_STR.format("f4", formula)
|
||||
|
||||
print(out)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user