1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Andrew Reynolds |
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 |
|
* Equivalence class info for the theory of strings. |
14 |
|
*/ |
15 |
|
|
16 |
|
#include "cvc5_private.h" |
17 |
|
|
18 |
|
#ifndef CVC5__THEORY__STRINGS__EQC_INFO_H |
19 |
|
#define CVC5__THEORY__STRINGS__EQC_INFO_H |
20 |
|
|
21 |
|
#include <map> |
22 |
|
|
23 |
|
#include "context/cdo.h" |
24 |
|
#include "context/context.h" |
25 |
|
#include "expr/node.h" |
26 |
|
|
27 |
|
namespace cvc5 { |
28 |
|
namespace theory { |
29 |
|
namespace strings { |
30 |
|
|
31 |
|
/** |
32 |
|
* SAT-context-dependent information about an equivalence class. This |
33 |
|
* information is updated eagerly as assertions are processed by the theory of |
34 |
|
* strings at standard effort. |
35 |
|
*/ |
36 |
|
class EqcInfo |
37 |
|
{ |
38 |
|
public: |
39 |
|
EqcInfo(context::Context* c); |
40 |
30124 |
~EqcInfo() {} |
41 |
|
/** add prefix constant |
42 |
|
* |
43 |
|
* This informs this equivalence class info that a term t in its |
44 |
|
* equivalence class has a constant prefix (if isSuf=true) or suffix |
45 |
|
* (if isSuf=false). The constant c (if non-null) is the value of that |
46 |
|
* constant, if it has been computed already. |
47 |
|
* |
48 |
|
* If this method returns a non-null node ret, then ret is a conjunction |
49 |
|
* corresponding to a conflict that holds in the current context. |
50 |
|
*/ |
51 |
|
Node addEndpointConst(Node t, Node c, bool isSuf); |
52 |
|
/** |
53 |
|
* If non-null, this is a term x from this eq class such that str.len( x ) |
54 |
|
* occurs as a term in this SAT context. |
55 |
|
*/ |
56 |
|
context::CDO<Node> d_lengthTerm; |
57 |
|
/** |
58 |
|
* If non-null, this is a term x from this eq class such that str.code( x ) |
59 |
|
* occurs as a term in this SAT context. |
60 |
|
*/ |
61 |
|
context::CDO<Node> d_codeTerm; |
62 |
|
context::CDO<unsigned> d_cardinalityLemK; |
63 |
|
context::CDO<Node> d_normalizedLength; |
64 |
|
/** |
65 |
|
* A node that explains the longest constant prefix known of this |
66 |
|
* equivalence class. This can either be: |
67 |
|
* (1) A term from this equivalence class, including a constant "ABC" or |
68 |
|
* concatenation term (str.++ "ABC" ...), or |
69 |
|
* (2) A membership of the form (str.in.re x R) where x is in this |
70 |
|
* equivalence class and R is a regular expression of the form |
71 |
|
* (str.to.re "ABC") or (re.++ (str.to.re "ABC") ...). |
72 |
|
*/ |
73 |
|
context::CDO<Node> d_prefixC; |
74 |
|
/** same as above, for suffix. */ |
75 |
|
context::CDO<Node> d_suffixC; |
76 |
|
}; |
77 |
|
|
78 |
|
} // namespace strings |
79 |
|
} // namespace theory |
80 |
|
} // namespace cvc5 |
81 |
|
|
82 |
|
#endif /* CVC5__THEORY__STRINGS__EQC_INFO_H */ |