00001 //===-- PTree.h -------------------------------------------------*- C++ -*-===// 00002 // 00003 // The KLEE Symbolic Virtual Machine 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 00010 #ifndef __UTIL_PTREE_H__ 00011 #define __UTIL_PTREE_H__ 00012 00013 #include <klee/Expr.h> 00014 00015 #include <utility> 00016 #include <cassert> 00017 #include <iostream> 00018 00019 namespace klee { 00020 class ExecutionState; 00021 00022 class PTree { 00023 typedef ExecutionState* data_type; 00024 00025 public: 00026 typedef class PTreeNode Node; 00027 Node *root; 00028 00029 PTree(const data_type &_root); 00030 ~PTree(); 00031 00032 std::pair<Node*,Node*> split(Node *n, 00033 const data_type &leftData, 00034 const data_type &rightData); 00035 void remove(Node *n); 00036 00037 void dump(std::ostream &os); 00038 }; 00039 00040 class PTreeNode { 00041 friend class PTree; 00042 public: 00043 PTreeNode *parent, *left, *right; 00044 ExecutionState *data; 00045 ref<Expr> condition; 00046 00047 private: 00048 PTreeNode(PTreeNode *_parent, ExecutionState *_data); 00049 ~PTreeNode(); 00050 }; 00051 } 00052 00053 #endif
1.5.8