Commit 0b20cb7c authored by Jaime Arias's avatar Jaime Arias
Browse files

fix: add quotes to ap in pmc-sog formulas

parent 765da79c
......@@ -75,7 +75,8 @@ def generate_spot_formulas(model_name, model_instance, n, paths):
f'{model_instance}.pnml')
atomic_propositions = get_atomic_propositions(pnml_file)
atomic_propositions = '==1 '.join(atomic_propositions['places'])
atomic_propositions = " ".join(
[f"{ap}==1" for ap in atomic_propositions['places']])
command = f'{paths["randltl"]} -L -s -p -n{n} --ltl-priorities="{ignored_operators}" {atomic_propositions}'
......@@ -144,7 +145,11 @@ def write_formula(model_name, model_instance, formula, identifier):
with open(os.path.join(base, filename_ltsmin), 'w') as ltsmin, \
open(os.path.join(base, filename_pmcsog), 'w') as pmcsog:
pmcsog_formula = formula.replace('==1', '')
# remove ==1 and add " to atomic propositions
pmcsog_formula = re.sub(pattern=r'\((\w*\d*)==1\)',
repl='("\\1")',
string=formula)
ltsmin.write(formula)
pmcsog.write(pmcsog_formula)
......@@ -155,7 +160,7 @@ def generate_formulas(model_name,
timeout,
paths,
save=True):
"""Generates N satified and N violated formulas"""
"""Generates N satisfied and N violated formulas"""
true_formulas = []
false_formulas = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment