From f367c5d72c630de88e15e4e7b8d489359b88fe4a Mon Sep 17 00:00:00 2001 From: Artur Meski Date: Wed, 28 Dec 2016 22:43:26 +0100 Subject: [PATCH] network of automata --- rs/__init__.py | 1 + rs/reaction_system_with_autnet.py | 11 +++++++++++ rs/reaction_system_with_automaton.py | 4 ---- rs_testing.py | 8 ++++---- smt/smt_checker_rs_na.py | 8 +++----- 5 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 rs/reaction_system_with_autnet.py diff --git a/rs/__init__.py b/rs/__init__.py index 54061b4..b500f08 100644 --- a/rs/__init__.py +++ b/rs/__init__.py @@ -8,3 +8,4 @@ from rs.extended_context_automaton import ExtendedContextAutomaton from rs.network_of_context_automata import NetworkOfContextAutomata from rs.reaction_system_with_automaton import ReactionSystemWithAutomaton +from rs.reaction_system_with_autnet import ReactionSystemWithNetworkOfAutomata \ No newline at end of file diff --git a/rs/reaction_system_with_autnet.py b/rs/reaction_system_with_autnet.py new file mode 100644 index 0000000..76ea2d5 --- /dev/null +++ b/rs/reaction_system_with_autnet.py @@ -0,0 +1,11 @@ + +class ReactionSystemWithNetworkOfAutomata(object): + + def __init__(self, reaction_system, context_automata): + self.rs = reaction_system + self.cas = context_automata + + def show(self, soft=False): + self.rs.show(soft) + self.cas.show() + \ No newline at end of file diff --git a/rs/reaction_system_with_automaton.py b/rs/reaction_system_with_automaton.py index 6e8332f..9690ce2 100644 --- a/rs/reaction_system_with_automaton.py +++ b/rs/reaction_system_with_automaton.py @@ -1,9 +1,5 @@ -from sys import exit -from colour import * - from rs.reaction_system_with_concentrations import ReactionSystemWithConcentrations from rs.context_automaton_with_concentrations import ContextAutomatonWithConcentrations -from rs.network_of_context_automata import NetworkOfContextAutomata class ReactionSystemWithAutomaton(object): diff --git a/rs_testing.py b/rs_testing.py index eacb77f..ac1dcae 100644 --- a/rs_testing.py +++ b/rs_testing.py @@ -4,8 +4,8 @@ import rs_examples def run_tests(): - # test_extended_automaton() - process() + test_extended_automaton() + # process() def test_extended_automaton(): @@ -33,11 +33,11 @@ def test_extended_automaton(): na = NetworkOfContextAutomata([c1,c2]) - rna = ReactionSystemWithAutomaton(r,na) + rna = ReactionSystemWithNetworkOfAutomata(r,na) rna.show() - checker = SmtCheckerRS(rna) + checker = SmtCheckerRSNA(rna) def process(): diff --git a/smt/smt_checker_rs_na.py b/smt/smt_checker_rs_na.py index 58ce3fb..9acac7c 100644 --- a/smt/smt_checker_rs_na.py +++ b/smt/smt_checker_rs_na.py @@ -10,12 +10,10 @@ import resource class SmtCheckerRSNA(object): """SMT-based Model Checking for Reaction Systems with Network of Automata""" - def __init__(self, rsca): - - rsca.sanity_check() + def __init__(self, reaction_system_with_netaut): - self.rs = rsca.rs - self.ca = rsca.ca + self.rs = reaction_system_with_netaut.rs + self.ca = reaction_system_with_netaut.cas self.v = [] self.v_ctx = []