-
Couldn't load subscription status.
- Fork 0
Home
Welcome to the topylogic-git wiki!
Topylogic is a python library for creating Deterministic and Nondeterministic Finite State Machines (DFA/NFA). But, these DFA's and NFA's aren't truly finite in Topylogic. With Topylogic you can dynamically modify the machine by adding, removing, or even modifying states and transitions while your program is running.
In Topylogic you are also free to begin your program in one or many states that may transition to other states. Thus, Topylogic can either be context-free or context-switching (unthreaded vs threaded).
In Topylogic we define Vertices to be States and Edges to be state transitions. The DFA or NFA in Topylogic is known as the Graph. The Graph contains all of the information in the program. * Is it threaded?
- What do we do when a thread won't spawn?
- Do we make a new thread on state transition?
-
- What information should be saved?
-
- How often should the information be saved?
- What are the vertices?
-
- What is the current state of the machine?
-
- What should be executed?
- What are the variables that should be passed to each Vertex?
- Should it kill a vertex that is ran a certain number of times?
- Should it stop after a certain number of steps?
The Vertex contains information about what the state means and where to transition to. * What are the edges? * What are it's variables? * What variables does it share with it's edges? * What function does it execute?
The Edges contains information about itself and a path. * What vertex initiated it? * What vertex does it point to? * What are it's variables? * What function does it execute?
Once put all together, the Graph starts at some vertices, which do something, and then figures out how to transition. To transition, the edge functions must be invoked. Should an edge return True, then the Graph will call the vertex that the edge is connected to next. Of course, depending on mode, either the first edge to return True is chosen, or all edges to return True are called.
- The graph has a basic loop:
- # Run the initial set of vertices # Check the edges and determine next set # Process requests # Print information # Check if termination conditions are met and stop if so, else run next set of vertices and repeat