Skip to content

Commit

Permalink
Add code for off-line reconstruction of candidate trees
Browse files Browse the repository at this point in the history
The new module offline_analysis allows for the reconstruction of a candidate
tree from the events of a log file for post-mortem analysis or conversion to a
different log format required by an analysis tool.

The reconstruction of the tree itself and refinement of candidate nodes from
actions on the nodes can be done incrementally and in an interleaved fashion as
log messages are processed. The general outline of this process is:

  let mut tree = CandidateTree::new();

  // Iterate over all messages from the log file
  for ... {
    match message {
      Message::Node { ... } => {
        tree.extend(...);
      }

      Message::Trace { ... } => {
        // Iterate over all events of the trace message
        for event ... {
          match event {
            Event::Kill(...) => {
              // Declare candidate as a deadend
              tree.get_node(curr_node_id).declare_deadend(...);
	      ...
            }

            Event::Implementation(...) => {
              // Declare candidate as implementation (fully specified candidate)
              tree.get_node(curr_node_id).declare_implementation(...);
       	      ...
            }

            ...
          }
        }
      }

      Message::Evaluation { ... } => {
        ...
        // Update score
        t.get_node(...).set_score(...);
      }
    }
  }
  • Loading branch information
andidr committed Mar 20, 2019
1 parent 60bb402 commit 6f8a36f
Show file tree
Hide file tree
Showing 3 changed files with 483 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Expand Up @@ -21,4 +21,5 @@ pub mod device;
pub mod explorer;
pub mod ir;
pub mod model;
pub mod offline_analysis;
pub mod search_space;
1 change: 1 addition & 0 deletions src/offline_analysis/mod.rs
@@ -0,0 +1 @@
pub mod tree;

0 comments on commit 6f8a36f

Please sign in to comment.