From 904094281b062aff3445ca41fec57e4cfd0f563d Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Tue, 10 Nov 2020 14:06:35 -0800 Subject: Initial code release --- runtime/README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 runtime/README.md (limited to 'runtime/README.md') diff --git a/runtime/README.md b/runtime/README.md new file mode 100644 index 0000000..e080a99 --- /dev/null +++ b/runtime/README.md @@ -0,0 +1,33 @@ +# Triplet Structure Runtime + +This folder contains a triplet structure runtime implementation. The goal of +the runtime is to take a Triplet Structure (see ``../ts_lib.py``), parse the +"operational" nodes (eg. rules and tactics), then apply the rules so that some +goal is achieved (eg. getting rid of TOP nodes). + +At a high level: +- `runtime.py` operates as the main data structure which keeps track of the + information needed and produced during the execution. +- `solver.py` has methods that allow for existential queries on the + corresponding Structure. For example, you might look for nodes 1, 2 such that + facts (1, 2, "/:Mapper:TOP") and (2, 1, 2) both hold in the structure. +- `pattern.py` is essentially a higher-level interface to the Solver. Each + `Pattern` instance corresponds to a single pattern/existential query. +- `production_rule.py` can be thought of as an _even higher_ level interface to + the `Patterns`. Each `ProductionRule` corresponds to one ``/RULE` node in the + Structure. ProductionRules can have relatively complicated mapping + strategies, eg. "find an assignment satisfying ... but not ..." +- `assignment.py` describes a satisfying assignment to a `ProductionRule`. + `Assignment`s are an intermediate step between matching a pattern and then + constructing the actual delta corresponding to the match/rule. +- `delta.py` describes `TSDeltas`, which describe a modification (add/remove + nodes/facts) to the structure. They are produced by `Assignments` which are + produced by `ProductionRules`. +- `tactic.py` describes `Tactic`s, which are essentially heuristics that + control the application of rules (and other tactics). +- `interactive.py` is an interactive REPL for manually/semi-automatically + applying rules, tactics, etc. to the structure. +- `shadow_input.py` is used by `interactive.py` to allow the user to record, + save, and replay their commands. +- `utils.py` contains helper methods for the rest of the runtime. Most useful + is the Translator, which cleans up some common operations with dictionaries. -- cgit v1.2.3