コード例 #1
0
ファイル: encoder.py プロジェクト: yyaan/pynusmv
 def manager(self):
     """
     :return: the Boolean Expressions manager (:class:`BeManager`) 
       contained into the variable manager, to be used by any operation on 
       BEs
     """
     if not hasattr(self, "__manager"):
         setattr(self, '__manager', BeRbcManager(_be.BeEnc_get_be_manager(self._ptr)))
     return getattr(self, '__manager')
コード例 #2
0
 def test_reserve(self):
     """
     Verifies that reserve causes no runtime errors. reserve is only
     used to manipulate the underlying RBC layer which is not exposed 
     """
     mgr = BeRbcManager.with_capacity(10)
     # cannot be verified w/o exposing RBC internals
     # (which makes little sense since BE already offers a sufficient
     # abstraction)
     mgr.reserve(12)
コード例 #3
0
ファイル: testBeManager.py プロジェクト: xgillard/pynusmv
 def test_reserve(self):
     """
     Verifies that reserve causes no runtime errors. reserve is only
     used to manipulate the underlying RBC layer which is not exposed 
     """
     mgr = BeRbcManager.with_capacity(10)
     # cannot be verified w/o exposing RBC internals 
     # (which makes little sense since BE already offers a sufficient
     # abstraction)
     mgr.reserve(12)
コード例 #4
0
 def test_reset(self):
     """
     Verifies that resetting the cache provokes no error
     -> verifies only the absence of runtime errors since it is who RBC does 
        the heavy lifting, not the manager
     """
     mgr = BeRbcManager.with_capacity(10)
     # test it doesn't hurt to call this method even though nothing is to
     # be done.
     mgr.reset()
     # conversion to CNF populates the hashes which are being reset so
     # using this manager to perform cnf conversion makes sense if we want
     # to test the reset works when it actually does something.
     (Be.true(mgr) and Be.false(mgr)).to_cnf(Polarity.POSITIVE)
     mgr.reset()
コード例 #5
0
ファイル: testBeManager.py プロジェクト: xgillard/pynusmv
 def test_reset(self):
     """
     Verifies that resetting the cache provokes no error
     -> verifies only the absence of runtime errors since it is who RBC does 
        the heavy lifting, not the manager
     """
     mgr = BeRbcManager.with_capacity(10)
     # test it doesn't hurt to call this method even though nothing is to
     # be done.
     mgr.reset()
     # conversion to CNF populates the hashes which are being reset so 
     # using this manager to perform cnf conversion makes sense if we want
     # to test the reset works when it actually does something.
     (Be.true(mgr) and Be.false(mgr)).to_cnf(Polarity.POSITIVE)
     mgr.reset()
コード例 #6
0
 def test_with_capacity(self):
     """This test verifies that no memory exception etc.. occur"""
     mgr = BeRbcManager.with_capacity(10)
     self.assertIsNotNone(mgr, "mgr should be defined")
     self.assertTrue(mgr._freeit)
     self.assertIsNotNone(mgr._ptr, "mgr _ptr should be defined")
コード例 #7
0
ファイル: testBeManager.py プロジェクト: xgillard/pynusmv
 def test_with_capacity(self):
     """This test verifies that no memory exception etc.. occur"""
     mgr = BeRbcManager.with_capacity(10)
     self.assertIsNotNone(mgr, "mgr should be defined")
     self.assertTrue(mgr._freeit)
     self.assertIsNotNone(mgr._ptr, "mgr _ptr should be defined")