Scripts to reproduce experiments for reaction mining

This commit is contained in:
Artur Meski
2023-11-06 21:07:01 +00:00
parent e9589cd0d9
commit 47e03694e4
16 changed files with 774 additions and 142 deletions

17
examples/smt/mutex_param.py Normal file → Executable file
View File

@@ -42,7 +42,7 @@ def powerset(iterable, N=None):
def mutex_param_bench(cmd_args):
"""
Mutex Benchmark
Parametric
"""
@@ -77,7 +77,6 @@ def mutex_param_bench(cmd_args):
Inhib = [("s", 1)]
for i in range(n_proc):
r.add_reaction([E("out", i), E("act", i)], Inhib, [E("req", i)])
r.add_reaction([E("out", i)], [E("act", i)], [E("out", i)])
@@ -189,7 +188,7 @@ def mutex_param_bench(cmd_args):
def mutex_nonparam_bench(cmd_args):
"""
Mutex Benchmark
Parametric
"""
@@ -217,7 +216,6 @@ def mutex_nonparam_bench(cmd_args):
Inhib = [("s", 1)]
for i in range(n_proc):
r.add_reaction([E("out", i), E("act", i)], Inhib, [E("req", i)])
r.add_reaction([E("out", i)], [E("act", i)], [E("out", i)])
@@ -297,7 +295,7 @@ def mutex_nonparam_bench(cmd_args):
def mutex_nonparam_bench_oldimpl(cmd_args):
"""
Mutex Benchmark
Parametric
"""
@@ -325,7 +323,6 @@ def mutex_nonparam_bench_oldimpl(cmd_args):
Inhib = [("s", 1)]
for i in range(n_proc):
r.add_reaction([E("out", i), E("act", i)], Inhib, [E("req", i)])
r.add_reaction([E("out", i)], [E("act", i)], [E("out", i)])
@@ -407,7 +404,6 @@ def state_translate_rsc2rs(p):
def mutex_bench_main(cmd_args):
mode = cmd_args.mode
if mode == "p":
@@ -422,17 +418,16 @@ def mutex_bench_main(cmd_args):
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"scaling",
help="scaling parameter value",
)
parser.add_argument(
"mode",
choices=['p', 'np-p', 'np-np'],
choices=["p", "np-p", "np-np"],
help="Selects the mode: p - parameter synthesis (parametric implementation), np-p - non-parametric with parametric implementation (with the parameters substituted), np-np - non-parametric with non-parametric implementation (parameters substituted)",
)
@@ -447,7 +442,7 @@ def main():
)
args = parser.parse_args()
mutex_bench_main(args)