GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/smt/model_blocker.h Lines: 1 1 100.0 %
Date: 2021-11-07 Branches: 0 0 0.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds, Mathias Preiner, Gereon Kremer
4
 *
5
 * This file is part of the cvc5 project.
6
 *
7
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8
 * in the top-level source directory and their institutional affiliations.
9
 * All rights reserved.  See the file COPYING in the top-level source
10
 * directory for licensing information.
11
 * ****************************************************************************
12
 *
13
 * Utility for blocking the current model.
14
 */
15
16
#include "cvc5_private.h"
17
18
#ifndef __CVC5__THEORY__MODEL_BLOCKER_H
19
#define __CVC5__THEORY__MODEL_BLOCKER_H
20
21
#include <vector>
22
23
#include "expr/node.h"
24
#include "options/smt_options.h"
25
#include "smt/env_obj.h"
26
27
namespace cvc5 {
28
29
namespace theory {
30
class TheoryModel;
31
}
32
33
/**
34
 * A utility for blocking the current model.
35
 */
36
26
class ModelBlocker : protected EnvObj
37
{
38
 public:
39
  ModelBlocker(Env& e);
40
  /** get model blocker
41
   *
42
   * This returns a disjunction of literals ~L1 V ... V ~Ln with the following
43
   * properties:
44
   * (1) L1 ... Ln hold in the current model (given by argument m),
45
   * (2) if mode is set to "literals", L1 ... Ln are literals that occur in
46
   * assertions and propositionally entail all non-unit top-level assertions.
47
   * (3) if mode is set to "values", L1 ... Ln are literals of the form x=c,
48
   * where c is the value of x in the current model.
49
   * (4) if exprToBlock is not empty, L1 ... Ln are literals of the form t=c,
50
   * where c is the value of t in the current model. If exprToBlock is
51
   * non-empty, then L1 ... Ln are t1=c1 ... tn=cn where exprToBlock is
52
   * { t1 ... tn }; if exprToBlock is empty, then t1 ... tn are the free
53
   * variables of assertions.
54
   *
55
   * We expect exprToBlock to be non-empty only if mode is
56
   * BlockModelsMode::VALUES.
57
   *
58
   * For example, if our input is:
59
   *    x > 0 ^ ( y < 0 V z < 0 V w < 0 )
60
   * and m is { x -> 1, y -> 2, z -> -1, w -> -1 }, then this method may
61
   * return ~(z < 0) or ~(w < 0) when set to mode "literals".
62
   *
63
   * Notice that we do not require that L1...Ln entail unit top-level assertions
64
   * since these literals are trivially entailed to be true in all models of
65
   * our input. In other words, we do not return ~(x < 0) V ~(w < 0) since the
66
   * left disjunct is always false.
67
   */
68
  Node getModelBlocker(
69
      const std::vector<Node>& assertions,
70
      theory::TheoryModel* m,
71
      options::BlockModelsMode mode,
72
      const std::vector<Node>& exprToBlock = std::vector<Node>());
73
}; /* class TheoryModelCoreBuilder */
74
75
}  // namespace cvc5
76
77
#endif /* __CVC5__THEORY__MODEL_BLOCKER_H */