37 lines
986 B
Python
37 lines
986 B
Python
class Concept:
|
|
"""
|
|
Default concept object
|
|
A concept is a the base object of our universe
|
|
Everything is a concept
|
|
"""
|
|
|
|
concepts_id = 0
|
|
|
|
def __init__(self, name, is_builtin=False):
|
|
self.name = name
|
|
self.is_builtin = is_builtin
|
|
self.pre = None # list of pre conditions before calling the main function
|
|
self.post = None # list of post conditions after calling the main function
|
|
self.main = None # main method
|
|
self.id = Concept.concepts_id
|
|
Concept.concepts_id = Concept.concepts_id + 1
|
|
|
|
self.props = [] # list of Property for this concept
|
|
self.functions = {} # list of helper functions
|
|
|
|
def __str__(self):
|
|
return f"({self.id}){self.name}"
|
|
|
|
def __repr__(self):
|
|
return f"({self.id}){self.name}"
|
|
|
|
|
|
class Property:
|
|
"""
|
|
Defines a behaviour of Concept
|
|
"""
|
|
|
|
def __init__(self, concept, value):
|
|
self.concept = concept
|
|
self.value = value
|