about summary refs log tree commit diff homepage
path: root/lib/SMT/main.cpp
blob: 31fa311d58f7a08da8d8990f39f3648ee4e5fa92 (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
#include "SMTParser.h"

#include "klee/ExprBuilder.h"

using namespace klee;

int main(int argc, char** argv) {
  if (argc != 2) {
    cout << "Usage: " << argv[0] << " <smt-filename>\n";
    return 1;
  }
  
  enum BuilderKinds {
    DefaultBuilder,
    ConstantFoldingBuilder,
    SimplifyingBuilder
  } BuilderKind = SimplifyingBuilder;

  ExprBuilder *Builder = 0;
  switch (BuilderKind) {
  case DefaultBuilder:
    Builder = createDefaultExprBuilder();
    break;
  case ConstantFoldingBuilder:
    Builder = createDefaultExprBuilder();
    Builder = createConstantFoldingExprBuilder(Builder);
    break;
  case SimplifyingBuilder:
    Builder = createDefaultExprBuilder();
    Builder = createConstantFoldingExprBuilder(Builder);
    Builder = createSimplifyingExprBuilder(Builder);
    break;
  }
  
  klee::expr::SMTParser smtParser(argv[1], Builder);
  smtParser.Parse();
  int result = smtParser.Solve();
  
  cout << (result ? "UNSAT":"SAT") << "\n"; 
}