about summary refs log tree commit diff homepage
path: root/lib/Core/PTree.h
blob: 6456b57fa5f8d892838b7352a9bf027a56b574e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//===-- PTree.h -------------------------------------------------*- C++ -*-===//
//
//                     The KLEE Symbolic Virtual Machine
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef KLEE_PTREE_H
#define KLEE_PTREE_H

#include "klee/Expr/Expr.h"

namespace klee {
  class ExecutionState;

  class PTreeNode {
  public:
    PTreeNode *parent = nullptr;
    PTreeNode *left = nullptr;
    PTreeNode *right = nullptr;
    ExecutionState *state = nullptr;

    PTreeNode(const PTreeNode&) = delete;
    PTreeNode(PTreeNode *parent, ExecutionState *state);
    ~PTreeNode() = default;
  };

  class PTree {
  public:
    PTreeNode * root = nullptr;
    explicit PTree(ExecutionState *initialState);
    ~PTree() = default;

    static void attach(PTreeNode *node, ExecutionState *leftState, ExecutionState *rightState);
    static void remove(PTreeNode *node);
    void dump(llvm::raw_ostream &os);
  };
}

#endif /* KLEE_PTREE_H */