Prechádzať zdrojové kódy

Project structure change + licenses

rparedis 2 rokov pred
rodič
commit
47cea5ff2d
100 zmenil súbory, kde vykonal 1221 pridanie a 303 odobranie
  1. 1 0
      .gitignore
  2. 6 0
      .idea/copyright/GNU_GPLv3.xml
  3. 7 0
      .idea/copyright/profiles_settings.xml
  4. 0 0
      core/__init__.py
  5. 0 0
      experiments/transformation.py
  6. 15 0
      pytcore/core/__init__.py
  7. 16 1
      core/himesis.py
  8. 15 4
      core/match_algo.py
  9. 15 0
      pytcore/rules/__init__.py
  10. 19 8
      rules/arule.py
  11. 16 5
      rules/brule.py
  12. 17 6
      rules/bsrule.py
  13. 17 6
      rules/crule.py
  14. 17 6
      rules/frule.py
  15. 18 7
      rules/lfrule.py
  16. 16 5
      rules/lqsrule.py
  17. 18 7
      rules/lrule.py
  18. 18 7
      rules/lsrule.py
  19. 19 8
      rules/ndarule.py
  20. 18 7
      rules/query.py
  21. 15 4
      rules/sequence.py
  22. 17 6
      rules/srule.py
  23. 18 7
      rules/xfrule.py
  24. 18 7
      rules/xrule.py
  25. 18 7
      rules/xsrule.py
  26. 15 0
      state/__init__.py
  27. 15 0
      state/base.py
  28. 16 1
      state/devstate.py
  29. 16 1
      state/igraphstate.py
  30. 17 2
      state/neo4jstate.py
  31. 16 1
      state/pystate.py
  32. 17 2
      state/rdfstate.py
  33. 15 0
      pytcore/state/test/__init__.py
  34. 17 0
      pytcore/state/test/conftest.py
  35. 15 0
      pytcore/state/test/fixtures/__init__.py
  36. 36 0
      pytcore/state/test/fixtures/state.py
  37. 15 0
      state/test/test_create_dict.py
  38. 15 0
      state/test/test_create_edge.py
  39. 37 0
      pytcore/state/test/test_create_node.py
  40. 15 0
      state/test/test_create_nodevalue.py
  41. 15 0
      state/test/test_delete_edge.py
  42. 15 0
      state/test/test_delete_node.py
  43. 15 0
      state/test/test_read_dict.py
  44. 15 0
      state/test/test_read_dict_edge.py
  45. 15 0
      state/test/test_read_dict_keys.py
  46. 15 0
      state/test/test_read_dict_node.py
  47. 15 0
      state/test/test_read_edge.py
  48. 15 0
      state/test/test_read_incoming.py
  49. 15 0
      state/test/test_read_outgoing.py
  50. 15 0
      state/test/test_read_reverse_dict.py
  51. 15 0
      state/test/test_read_value.py
  52. 20 0
      pytcore/tcore/__init__.py
  53. 35 0
      pytcore/tcore/composer.py
  54. 27 0
      pytcore/tcore/composite_primitive.py
  55. 33 0
      pytcore/tcore/control_primitive.py
  56. 17 6
      tcore/iterator.py
  57. 19 8
      tcore/matcher.py
  58. 15 4
      tcore/messages.py
  59. 31 0
      pytcore/tcore/primitive.py
  60. 16 5
      tcore/resolver.py
  61. 17 8
      tcore/rewriter.py
  62. 17 7
      tcore/rollbacker.py
  63. 24 0
      pytcore/tcore/rule_primitive.py
  64. 17 6
      tcore/selector.py
  65. 18 7
      tcore/synchronizer.py
  66. 15 0
      pytcore/util/__init__.py
  67. 2 7
      util/infinity.py
  68. 35 0
      pytcore/util/seeded_random.py
  69. 67 0
      pytcore/util/tconstants.py
  70. 0 0
      rules/__init__.py
  71. 0 0
      state/test/__init__.py
  72. BIN
      state/test/__pycache__/__init__.cpython-38.pyc
  73. BIN
      state/test/__pycache__/conftest.cpython-38-pytest-7.2.1.pyc
  74. BIN
      state/test/__pycache__/test_create_dict.cpython-38-pytest-7.2.1.pyc
  75. BIN
      state/test/__pycache__/test_create_edge.cpython-38-pytest-7.2.1.pyc
  76. BIN
      state/test/__pycache__/test_create_node.cpython-38-pytest-7.2.1.pyc
  77. BIN
      state/test/__pycache__/test_create_nodevalue.cpython-38-pytest-7.2.1.pyc
  78. BIN
      state/test/__pycache__/test_delete_edge.cpython-38-pytest-7.2.1.pyc
  79. BIN
      state/test/__pycache__/test_delete_node.cpython-38-pytest-7.2.1.pyc
  80. BIN
      state/test/__pycache__/test_read_dict.cpython-38-pytest-7.2.1.pyc
  81. BIN
      state/test/__pycache__/test_read_dict_edge.cpython-38-pytest-7.2.1.pyc
  82. BIN
      state/test/__pycache__/test_read_dict_keys.cpython-38-pytest-7.2.1.pyc
  83. BIN
      state/test/__pycache__/test_read_dict_node.cpython-38-pytest-7.2.1.pyc
  84. BIN
      state/test/__pycache__/test_read_edge.cpython-38-pytest-7.2.1.pyc
  85. BIN
      state/test/__pycache__/test_read_incoming.cpython-38-pytest-7.2.1.pyc
  86. BIN
      state/test/__pycache__/test_read_outgoing.cpython-38-pytest-7.2.1.pyc
  87. BIN
      state/test/__pycache__/test_read_reverse_dict.cpython-38-pytest-7.2.1.pyc
  88. BIN
      state/test/__pycache__/test_read_value.cpython-38-pytest-7.2.1.pyc
  89. 0 2
      state/test/conftest.py
  90. 0 0
      state/test/fixtures/__init__.py
  91. BIN
      state/test/fixtures/__pycache__/__init__.cpython-38.pyc
  92. BIN
      state/test/fixtures/__pycache__/state.cpython-38.pyc
  93. 0 21
      state/test/fixtures/state.py
  94. 0 22
      state/test/test_create_node.py
  95. 0 3
      tcore/__init__.py
  96. 0 24
      tcore/composer.py
  97. 0 16
      tcore/composite_primitive.py
  98. 0 22
      tcore/control_primitive.py
  99. 0 20
      tcore/primitive.py
  100. 0 0
      tcore/rule_primitive.py

+ 1 - 0
.gitignore

@@ -2,5 +2,6 @@ __pycache__/
 venv/
 build/
 dist/
+.pytest_cache/
 *.egg-info
 *.log

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 6 - 0
.idea/copyright/GNU_GPLv3.xml


+ 7 - 0
.idea/copyright/profiles_settings.xml

@@ -0,0 +1,7 @@
+<component name="CopyrightManager">
+  <settings default="GNU GPLv3">
+    <module2copyright>
+      <element module="Project Files" copyright="GNU GPLv3" />
+    </module2copyright>
+  </settings>
+</component>

+ 0 - 0
core/__init__.py


transformation.py → experiments/transformation.py


+ 15 - 0
pytcore/core/__init__.py

@@ -0,0 +1,15 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+

+ 16 - 1
core/himesis.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 """
 Core logic for Himesis. Based on the code in AToMPM and earlier work by Marc Provost.
 
@@ -10,7 +25,7 @@ the syllable "Hi" stands for "Hierarchical".
 """
 
 import uuid, copy
-from state.base import State
+from pytcore.state.base import State
 
 
 class HConstants:

+ 15 - 4
core/match_algo.py

@@ -1,9 +1,20 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
 import sys
-from .himesis import Himesis
+from pytcore.core.himesis import Himesis
 
 
 class Priority(object):

+ 15 - 0
pytcore/rules/__init__.py

@@ -0,0 +1,15 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+

+ 19 - 8
rules/arule.py

@@ -1,12 +1,23 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from tcore.composer import Composer
-from tcore.matcher import Matcher
-from tcore.iterator import Iterator
-from tcore.rewriter import Rewriter
-from tcore.resolver import Resolver
+from pytcore.tcore.composer import Composer
+from pytcore.tcore.matcher import Matcher
+from pytcore.tcore.iterator import Iterator
+from pytcore.tcore.rewriter import Rewriter
+from pytcore.tcore.resolver import Resolver
 
 class ARule(Composer):
     '''

+ 16 - 5
rules/brule.py

@@ -1,9 +1,20 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..tcore.composer import Composer
-from ..util.seeded_random import Random
+from pytcore.tcore.composer import Composer
+from pytcore.util.seeded_random import Random
 
 
 class BRule(Composer):

+ 17 - 6
rules/bsrule.py

@@ -1,10 +1,21 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..util.infinity import INFINITY
-from ..tcore.composer import Composer
-from .brule import BRule
+from pytcore.util.infinity import INFINITY
+from pytcore.tcore.composer import Composer
+from pytcore.rules.brule import BRule
 
 
 class BSRule(Composer):

+ 17 - 6
rules/crule.py

@@ -1,9 +1,20 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
-
-from ..tcore.composer import Composer
-from ...tconstants import TConstants as TC
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+from pytcore.tcore.composer import Composer
+from pytcore.util.tconstants import TConstants as TC
 
 class CRule(Composer):
 

+ 17 - 6
rules/frule.py

@@ -1,10 +1,21 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from util.infinity import INFINITY
-from .arule import ARule
-from tcore.resolver import Resolver
+from pytcore.util.infinity import INFINITY
+from pytcore.rules.arule import ARule
+from pytcore.tcore.resolver import Resolver
 
 
 class FRule(ARule):

+ 18 - 7
rules/lfrule.py

@@ -1,11 +1,22 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..util.infinity import INFINITY
-from .lrule import LRule
-from ..tcore.rewriter import Rewriter
-from ..tcore.resolver import Resolver
+from pytcore.util.infinity import INFINITY
+from pytcore.rules.lrule import LRule
+from pytcore.tcore.rewriter import Rewriter
+from pytcore.tcore.resolver import Resolver
 
 class LFRule(LRule):
     '''

+ 16 - 5
rules/lqsrule.py

@@ -1,9 +1,20 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..util.infinity import INFINITY
-from .lrule import LRule
+from pytcore.util.infinity import INFINITY
+from pytcore.rules.lrule import LRule
 
 class LQSRule(LRule):
     '''

+ 18 - 7
rules/lrule.py

@@ -1,11 +1,22 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..util.infinity import INFINITY
-from ..tcore.composer import Composer
-from ..tcore.matcher import Matcher
-from ..tcore.iterator import Iterator
+from pytcore.util.infinity import INFINITY
+from pytcore.tcore.composer import Composer
+from pytcore.tcore.matcher import Matcher
+from pytcore.tcore.iterator import Iterator
 
 
 class LRule(Composer):

+ 18 - 7
rules/lsrule.py

@@ -1,11 +1,22 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..util.infinity import INFINITY
-from .lrule import LRule
-from ..tcore.rewriter import Rewriter
-from ..tcore.resolver import Resolver
+from pytcore.util.infinity import INFINITY
+from pytcore.rules.lrule import LRule
+from pytcore.tcore.rewriter import Rewriter
+from pytcore.tcore.resolver import Resolver
 
 
 class LSRule(LRule):

+ 19 - 8
rules/ndarule.py

@@ -1,12 +1,23 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..tcore.composer import Composer
-from ..tcore.matcher import Matcher
-from ..tcore.iterator import Iterator
-from ..tcore.rewriter import Rewriter
-from ..tcore.resolver import Resolver
+from pytcore.tcore.composer import Composer
+from pytcore.tcore.matcher import Matcher
+from pytcore.tcore.iterator import Iterator
+from pytcore.tcore.rewriter import Rewriter
+from pytcore.tcore.resolver import Resolver
 
 
 class NDARule(Composer):

+ 18 - 7
rules/query.py

@@ -1,10 +1,21 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
-
-from ..tcore.composer import Composer
-from ..tcore.matcher import Matcher
-from ..tcore.iterator import Iterator
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+from pytcore.tcore.composer import Composer
+from pytcore.tcore.matcher import Matcher
+from pytcore.tcore.iterator import Iterator
 
 
 class Query(Composer):

+ 15 - 4
rules/sequence.py

@@ -1,8 +1,19 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..tcore.composer import Composer
+from pytcore.tcore.composer import Composer
 
 
 class Sequence(Composer):

+ 17 - 6
rules/srule.py

@@ -1,10 +1,21 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..util.infinity import INFINITY
-from .arule import ARule
-from ..tcore.resolver import Resolver
+from pytcore.util.infinity import INFINITY
+from pytcore.rules.arule import ARule
+from pytcore.tcore.resolver import Resolver
 
 
 class SRule(ARule):

+ 18 - 7
rules/xfrule.py

@@ -1,11 +1,22 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..util.infinity import INFINITY
-from .frule import FRule
-from ..tcore.rollbacker import Rollbacker
-from ..tcore.resolver import Resolver
+from pytcore.util.infinity import INFINITY
+from pytcore.rules.frule import FRule
+from pytcore.tcore.rollbacker import Rollbacker
+from pytcore.tcore.resolver import Resolver
 
 
 class XFRule(FRule):

+ 18 - 7
rules/xrule.py

@@ -1,11 +1,22 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..util.infinity import INFINITY
-from .arule import ARule
-from ..tcore.rollbacker import Rollbacker
-from ..tcore.resolver import Resolver
+from pytcore.util.infinity import INFINITY
+from pytcore.rules.arule import ARule
+from pytcore.tcore.rollbacker import Rollbacker
+from pytcore.tcore.resolver import Resolver
 
 
 class XRule(ARule):

+ 18 - 7
rules/xsrule.py

@@ -1,11 +1,22 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+# 
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#    
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..util.infinity import INFINITY
-from .srule import SRule
-from ..tcore.rollbacker import Rollbacker
-from ..tcore.resolver import Resolver
+from pytcore.util.infinity import INFINITY
+from pytcore.rules.srule import SRule
+from pytcore.tcore.rollbacker import Rollbacker
+from pytcore.tcore.resolver import Resolver
 
 
 class XSRule(SRule):

+ 15 - 0
state/__init__.py

@@ -2,6 +2,21 @@
 Root of the ModelVerse State package
 """
 
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 from enum import Enum
 
 class MvSKernel(Enum):

+ 15 - 0
state/base.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 from abc import ABC, abstractmethod
 from typing import Any, List, Tuple, Optional, Union
 from uuid import UUID, uuid4

+ 16 - 1
state/devstate.py

@@ -1,4 +1,19 @@
-from state.pystate import PyState
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+from pytcore.state.pystate import PyState
 from uuid import UUID
 
 

+ 16 - 1
state/igraphstate.py

@@ -1,6 +1,21 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 from typing import Any, Optional, List, Tuple
 import igraph as ig
-from state.base import State, Node, Edge, Element
+from pytcore.state.base import State, Node, Edge, Element
 
 
 class iGraphState(State):

+ 17 - 2
state/neo4jstate.py

@@ -1,8 +1,23 @@
-from typing import Any, Optional, List, Tuple, Callable, Generator
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+from typing import Any, Optional, List, Tuple, Callable
 from neo4j import GraphDatabase
 from ast import literal_eval
 
-from .base import State, Edge, Node, Element, UUID
+from pytcore.state.base import State, Edge, Node, Element, UUID
 
 
 

+ 16 - 1
state/pystate.py

@@ -1,6 +1,21 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 from typing import Any, List, Tuple, Optional
 
-from state.base import State, Node, Edge, Element
+from pytcore.state.base import State, Node, Edge, Element
 
 
 class PyState(State):

+ 17 - 2
state/rdfstate.py

@@ -1,9 +1,24 @@
-from typing import Any, List, Tuple, Optional, Generator
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+from typing import Any, List, Tuple, Optional
 from rdflib import Graph, Namespace, URIRef, Literal
 from rdflib.plugins.sparql import prepareQuery
 import json
 
-from .base import State
+from pytcore.state.base import State
 
 # Define graph datasctructures used by implementation
 # Use NewType to create distinct type or just create a type alias

+ 15 - 0
pytcore/state/test/__init__.py

@@ -0,0 +1,15 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+

+ 17 - 0
pytcore/state/test/conftest.py

@@ -0,0 +1,17 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+import pytest
+from .fixtures.state import state

+ 15 - 0
pytcore/state/test/fixtures/__init__.py

@@ -0,0 +1,15 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+

+ 36 - 0
pytcore/state/test/fixtures/state.py

@@ -0,0 +1,36 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+import pytest
+from pytcore.state.pystate import PyState
+from pytcore.state.igraphstate import iGraphState
+from pytcore.state.rdfstate import RDFState
+from pytcore.state.neo4jstate import Neo4jState
+
+
+@pytest.fixture(params=[
+    (iGraphState,),
+    (PyState,),
+    (RDFState, "http://example.org/#"),
+    (Neo4jState,)
+])
+def state(request):
+    if len(request.param) > 1:
+        state = request.param[0](*request.param[1:])
+    else:
+        state = request.param[0]()
+    yield state
+    if isinstance(state, Neo4jState):
+        state.close(clear=True)

+ 15 - 0
state/test/test_create_dict.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_create_edge.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 37 - 0
pytcore/state/test/test_create_node.py

@@ -0,0 +1,37 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+import pytest
+
+
+@pytest.mark.usefixtures("state")
+def test_create_node_different_id_simple(state):
+    id1 = state.create_node()
+    assert id1 is not None
+    id2 = state.create_node()
+    assert id2 is not None
+
+    assert id1 != id2
+
+
+@pytest.mark.usefixtures("state")
+def test_create_node_different_id_long(state):
+    results = set()
+    for i in range(1000):
+        v = state.create_node()
+        assert v is not None
+        results.add(v)
+
+    assert len(results) == 1000

+ 15 - 0
state/test/test_create_nodevalue.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_delete_edge.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_delete_node.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_read_dict.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_read_dict_edge.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_read_dict_keys.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_read_dict_node.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_read_edge.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_read_incoming.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_read_outgoing.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_read_reverse_dict.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 15 - 0
state/test/test_read_value.py

@@ -1,3 +1,18 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
 import pytest
 
 

+ 20 - 0
pytcore/tcore/__init__.py

@@ -0,0 +1,20 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+"""Python T-Core for model transformations, using Himesis and the ModelVerseState (as graph backend).
+Based on previous work on AToMPM, the Modelverse and model transformations."""
+
+__version__ = "0.0.1"
+__version_info__ = tuple((int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".")))

+ 35 - 0
pytcore/tcore/composer.py

@@ -0,0 +1,35 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+from pytcore.tcore.composite_primitive import CompositePrimitive
+
+
+class Composer(CompositePrimitive):
+    '''
+        Encapsulates T-Core primitives.
+        Both packet_in & next_in methods must be overridden to provide meaningful behaviour. 
+    '''
+    def __init__(self):
+        '''
+            Encapsulates T-Core primitives.
+            Both packet_in & next_in methods must be overridden to provide meaningful behaviour. 
+        '''
+        super(Composer, self).__init__()
+
+    def packet_in(self, packet):
+        return packet
+
+    def next_in(self, packet):
+        return packet

+ 27 - 0
pytcore/tcore/composite_primitive.py

@@ -0,0 +1,27 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+from pytcore.tcore.primitive import Primitive
+
+# Abstract class
+class CompositePrimitive(Primitive):
+    def __init__(self):
+        super(CompositePrimitive, self).__init__()
+
+    def packet_in(self, packet):
+        raise AttributeError('Method not implemented')
+
+    def next_in(self, packet):
+        raise AttributeError('Method not implemented')

+ 33 - 0
pytcore/tcore/control_primitive.py

@@ -0,0 +1,33 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+from pytcore.tcore.primitive import Primitive
+
+# Abstract class
+class ControlPrimitive(Primitive):
+    def __init__(self):
+        super(ControlPrimitive, self).__init__()
+        self.success = []   # [Packet]
+        self.fail = []      # [Packet]
+
+    def success_in(self, packet):
+        raise AttributeError('Method not implemented')
+
+    def fail_in(self, packet):
+        raise AttributeError('Method not implemented')
+
+    def reset(self):
+        self.success = []
+        self.fail = []

+ 17 - 6
tcore/iterator.py

@@ -1,10 +1,21 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from util.seeded_random import Random
-from util.infinity import INFINITY
-from .rule_primitive import RulePrimitive
+from pytcore.util.seeded_random import Random
+from pytcore.util.infinity import INFINITY
+from pytcore.tcore.rule_primitive import RulePrimitive
 #from messages import TransformationException
 
 

+ 19 - 8
tcore/matcher.py

@@ -1,14 +1,25 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
 import sys
 from copy import deepcopy
-from util.infinity import INFINITY
-from core.match_algo import HimesisMatcher
-from core.himesis import HConstants as HC
-from .rule_primitive import RulePrimitive
-from .messages import MatchSet, Match, TransformationException
+from pytcore.util.infinity import INFINITY
+from pytcore.core.match_algo import HimesisMatcher
+from pytcore.core.himesis import HConstants as HC
+from pytcore.tcore.rule_primitive import RulePrimitive
+from pytcore.tcore.messages import MatchSet, Match, TransformationException
 
 if sys.version_info[0] >= 3:
     from functools import reduce

+ 15 - 4
tcore/messages.py

@@ -1,9 +1,20 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
 import copy, traceback
-from core.himesis import Himesis
+from pytcore.core.himesis import Himesis
 
 # Abstract class
 class Message(object): pass

+ 31 - 0
pytcore/tcore/primitive.py

@@ -0,0 +1,31 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+import uuid
+
+
+# Abstract class
+class Primitive(object):
+    def __init__(self):
+        self.is_success = False      # flags weather the primitive's action resulted in a success or not
+        self.exception = None       # holds the exception object if one was raised
+        self._id = uuid.uuid4()
+
+    def cancelIn(self, cancel):
+        self.is_success = False
+        self.exception = None
+
+    def __str__(self):
+        return '%s %s' % (str(self.__class__.__name__), self._id) 

+ 16 - 5
tcore/resolver.py

@@ -1,9 +1,20 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from .rule_primitive import RulePrimitive
-from .messages import TransformationException
+from pytcore.tcore.rule_primitive import RulePrimitive
+from pytcore.tcore.messages import TransformationException
 
 
 class Resolver(RulePrimitive):

+ 17 - 8
tcore/rewriter.py

@@ -1,12 +1,21 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from .rule_primitive import RulePrimitive
-from .messages import TransformationException
-from core.himesis import Himesis
-# from ...tconstants import TConstants as TC
-# from ...utils import Utilities as utils
+from pytcore.tcore.rule_primitive import RulePrimitive
+from pytcore.tcore.messages import TransformationException
+from pytcore.core.himesis import Himesis
 
 import sys
 if sys.version_info[0] >= 3:

+ 17 - 7
tcore/rollbacker.py

@@ -1,11 +1,21 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-#import pickle, os
-from ..util.infinity import INFINITY
-from .iterator import Iterator
-from ..tcore.messages import TransformationException
+from pytcore.util.infinity import INFINITY
+from pytcore.tcore.iterator import Iterator
+from pytcore.tcore.messages import TransformationException
 
 
 class Rollbacker(Iterator):

+ 24 - 0
pytcore/tcore/rule_primitive.py

@@ -0,0 +1,24 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+from pytcore.tcore.primitive import Primitive
+
+# Abstract class
+class RulePrimitive(Primitive):
+    def __init__(self):
+        super(RulePrimitive, self).__init__()
+
+    def packet_in(self, packet):
+        raise AttributeError('Method not implemented')

+ 17 - 6
tcore/selector.py

@@ -1,10 +1,21 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..util.seeded_random import Random
-from .control_primitive import ControlPrimitive
-from .messages import Cancel, TransformationException, NIL_PACKET
+from pytcore.util.seeded_random import Random
+from pytcore.tcore.control_primitive import ControlPrimitive
+from pytcore.tcore.messages import Cancel, TransformationException, NIL_PACKET
 
 
 class Selector(ControlPrimitive):

+ 18 - 7
tcore/synchronizer.py

@@ -1,10 +1,21 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
 
-from ..util.seeded_random import Random
-from .control_primitive import ControlPrimitive
-from .messages import TransformationException, NIL_PACKET
+from pytcore.util.seeded_random import Random
+from pytcore.tcore.control_primitive import ControlPrimitive
+from pytcore.tcore.messages import TransformationException, NIL_PACKET
 
 
 class Synchronizer(ControlPrimitive):
@@ -19,7 +30,7 @@ class Synchronizer(ControlPrimitive):
             @param custom_merge: Function that defines how to merge the success packets.
                                 By default, this returns None.
         '''
-        super(Synchronizer, self)
+        super(Synchronizer, self).__init__()
 
         assert(threads >= 2)
         self.threads = threads

+ 15 - 0
pytcore/util/__init__.py

@@ -0,0 +1,15 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+

+ 2 - 7
util/infinity.py

@@ -1,12 +1,5 @@
 ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
 ## ##
-# infinity.py
-#                     --------------------------------
-#                            Copyright (c) 2005
-#                          Jean-Sébastien  BOLDUC
-#                             Hans Vangheluwe
-#                       McGill University (Montréal)
-#                     --------------------------------
 #
 #  - Singleton class "Inf" and unique instance "INFINITY" ---
 #    stands for infinity (to use in time advance function)
@@ -18,6 +11,8 @@
 ##  more comparison operators -- HV 12/11/2006
 ##
 ##  mul and rmul added -- Eugene 14/11/2006
+##
+##  bugfix for instantiation -- Arkadiusz Rys 25/2/2023
 ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
 ## ##
 

+ 35 - 0
pytcore/util/seeded_random.py

@@ -0,0 +1,35 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+import random
+
+class SeededRandom(random.Random):
+    '''
+        Random class wrapper, provided a seeded random number generator
+    '''
+    __instantiated = False
+    def __init__(self, seed=0):
+        '''
+            Singleton class: the single instance "INFINITY" stands for infinity.
+        '''
+        if SeededRandom.__instantiated:
+            raise NotImplementedError("singleton class already instantiated")
+
+        SeededRandom.__instantiatiated = True
+        random.Random.__init__(self)
+        self.seed(seed)
+
+
+Random = SeededRandom()

+ 67 - 0
pytcore/util/tconstants.py

@@ -0,0 +1,67 @@
+#  Copyright 2023 Modelling, Simulation and Design Lab (MSDL)
+#  at the University of Antwerp (http://msdl.uantwerpen.be/).
+#
+#  Licensed under the GNU Public License v3 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#     https://www.gnu.org/licenses/gpl-3.0.en.html
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+#   either express or implied. See the License for the specific
+#   language governing permissions and limitations under the
+#   License.
+
+class TConstants :
+	#possible completion statuses
+	NOT_APPLICABLE = 'NotApplicable'
+	SUCCEEDED 		= 'Success'
+	FAILED			= 'Failure'
+
+	''' hergin :: motif-integration :: start '''
+	EXCEPTION			= 'Exception'
+	RULE_EXCEPTION_MSG				= 'EXCEPTION :: rule exception on '
+
+	MODE_DEBUG = 'debug'
+	MODE_RELEASE = 'release'
+
+	''' hergin :: motif-integration :: end '''
+
+	#inter-rule delay in PLAY mode
+	INTER_RULE_DELAY 		= 0.05
+
+	#the delay between verifications that all changelogs pertaining to the last executed rule have been handled
+	WAIT_ON_CHLOG_DELAY	= 0.02
+
+	#console output for various rule/transformation completion cases
+	RULE_SUCCESS_MSG				= 'rule succeeded'
+	''' hergin :: motif-integration :: modify fail message '''
+	RULE_FAILURE_MSG				= 'rule failed'
+	RULE_NOT_APPLICABLE_MSG		= 'WARNING :: rule was not applicable'
+	TRANSFORMATION_DONE			= 'transformation(s) terminated with status :: '
+	TRANSFORMATION_STOPPED 		= 'transformation stopped'
+	REMOTE_APPLICATION_FAILURE = 'ERROR :: rule effects could not be applied :: '
+	NO_NEXT_RULE					= 'ERROR :: failed to choose next rule :: '
+
+	#console output for various debugging messages
+	DEBUGGING_ON		= 'transformation debugging has been enabled'
+	DEBUGGING_OFF		= 'transformation debugging has been disabled'
+	DEBUGGING_HALT		= 'WARNING :: popping up transformation debugging window,'+ \
+							' resume transformation with "play" or "step" buttons'+ \
+							' from current window'
+
+	#supported designer code languages
+	JAVASCRIPT	= 'JAVASCRIPT'
+	PYTHON		= 'PYTHON'
+
+	#metamodel paths
+	RULEMM	= '/Formalisms/__Transformations__/TransformationRule/'+ \
+				'TransformationRule'
+	TRANSFMM	= '/Formalisms/__Transformations__/Transformation/Transformation'
+
+	''' hergin :: motif-integration '''
+	MOTIFMM	= '/Formalisms/__Transformations__/Transformation/MoTif'
+	TCOREMM = '/Formalisms/__Transformations__/Transformation/T-Core'
+
+

+ 0 - 0
rules/__init__.py


+ 0 - 0
state/test/__init__.py


BIN
state/test/__pycache__/__init__.cpython-38.pyc


BIN
state/test/__pycache__/conftest.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_create_dict.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_create_edge.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_create_node.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_create_nodevalue.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_delete_edge.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_delete_node.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_read_dict.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_read_dict_edge.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_read_dict_keys.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_read_dict_node.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_read_edge.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_read_incoming.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_read_outgoing.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_read_reverse_dict.cpython-38-pytest-7.2.1.pyc


BIN
state/test/__pycache__/test_read_value.cpython-38-pytest-7.2.1.pyc


+ 0 - 2
state/test/conftest.py

@@ -1,2 +0,0 @@
-import pytest
-from .fixtures.state import state

+ 0 - 0
state/test/fixtures/__init__.py


BIN
state/test/fixtures/__pycache__/__init__.cpython-38.pyc


BIN
state/test/fixtures/__pycache__/state.cpython-38.pyc


+ 0 - 21
state/test/fixtures/state.py

@@ -1,21 +0,0 @@
-import pytest
-from state.pystate import PyState
-from state.igraphstate import iGraphState
-from state.rdfstate import RDFState
-from state.neo4jstate import Neo4jState
-
-
-@pytest.fixture(params=[
-    (iGraphState,),
-    (PyState,),
-    (RDFState, "http://example.org/#"),
-    (Neo4jState,)
-])
-def state(request):
-    if len(request.param) > 1:
-        state = request.param[0](*request.param[1:])
-    else:
-        state = request.param[0]()
-    yield state
-    if isinstance(state, Neo4jState):
-        state.close(clear=True)

+ 0 - 22
state/test/test_create_node.py

@@ -1,22 +0,0 @@
-import pytest
-
-
-@pytest.mark.usefixtures("state")
-def test_create_node_different_id_simple(state):
-    id1 = state.create_node()
-    assert id1 is not None
-    id2 = state.create_node()
-    assert id2 is not None
-
-    assert id1 != id2
-
-
-@pytest.mark.usefixtures("state")
-def test_create_node_different_id_long(state):
-    results = set()
-    for i in range(1000):
-        v = state.create_node()
-        assert v is not None
-        results.add(v)
-
-    assert len(results) == 1000

+ 0 - 3
tcore/__init__.py

@@ -1,3 +0,0 @@
-"""Python T-Core for model transformations, using Himesis and the ModelVerseState (as graph backend). Based on previous work on AToMPM, the Modelverse and model transformations."""
-__version__ = "0.0.0"
-__version_info__ = tuple((int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".")))

+ 0 - 24
tcore/composer.py

@@ -1,24 +0,0 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
-
-from .composite_primitive import CompositePrimitive
-
-
-class Composer(CompositePrimitive):
-    '''
-        Encapsulates T-Core primitives.
-        Both packet_in & next_in methods must be overridden to provide meaningful behaviour. 
-    '''
-    def __init__(self):
-        '''
-            Encapsulates T-Core primitives.
-            Both packet_in & next_in methods must be overridden to provide meaningful behaviour. 
-        '''
-        super(Composer, self).__init__()
-
-    def packet_in(self, packet):
-        return packet
-
-    def next_in(self, packet):
-        return packet

+ 0 - 16
tcore/composite_primitive.py

@@ -1,16 +0,0 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
-
-from .primitive import Primitive
-
-# Abstract class
-class CompositePrimitive(Primitive):
-    def __init__(self):
-        super(CompositePrimitive, self).__init__()
-
-    def packet_in(self, packet):
-        raise AttributeError('Method not implemented')
-
-    def next_in(self, packet):
-        raise AttributeError('Method not implemented')

+ 0 - 22
tcore/control_primitive.py

@@ -1,22 +0,0 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
-
-from .primitive import Primitive
-
-# Abstract class
-class ControlPrimitive(Primitive):
-    def __init__(self):
-        super(ControlPrimitive, self).__init__()
-        self.success = []   # [Packet]
-        self.fail = []      # [Packet]
-
-    def success_in(self, packet):
-        raise AttributeError('Method not implemented')
-
-    def fail_in(self, packet):
-        raise AttributeError('Method not implemented')
-
-    def reset(self):
-        self.success = []
-        self.fail = []

+ 0 - 20
tcore/primitive.py

@@ -1,20 +0,0 @@
-'''This file is part of AToMPM - A Tool for Multi-Paradigm Modelling
-Copyright 2011 by the AToMPM team and licensed under the LGPL
-See COPYING.lesser and README.md in the root of this project for full details'''
-
-import uuid
-
-
-# Abstract class
-class Primitive(object):
-    def __init__(self):
-        self.is_success = False      # flags weather the primitive's action resulted in a success or not
-        self.exception = None       # holds the exception object if one was raised
-        self._id = uuid.uuid4()
-
-    def cancelIn(self, cancel):
-        self.is_success = False
-        self.exception = None
-
-    def __str__(self):
-        return '%s %s' % (str(self.__class__.__name__), self._id) 

+ 0 - 0
tcore/rule_primitive.py


Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov