summaryrefslogtreecommitdiff
path: root/src/theory/strings/regexp_operation.h
blob: a47f7bd776f49549d0b3b1db5293b5656686b921 (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*********************                                                        */
/*! \file regexp_operation.h
 ** \verbatim
 ** Original author: Tianyi Liang
 ** Major contributors: none
 ** Minor contributors (to current version): none
 ** This file is part of the CVC4 project.
 ** Copyright (c) 2009-2013  New York University and The University of Iowa
 ** See the file COPYING in the top-level source directory for licensing
 ** information.\endverbatim
 **
 ** \brief Regular Expresion Operations
 **
 ** Regular Expresion Operations
 **/

#include "cvc4_private.h"

#ifndef __CVC4__THEORY__STRINGS__REGEXP__OPERATION_H
#define __CVC4__THEORY__STRINGS__REGEXP__OPERATION_H

#include <vector>
#include "util/hash.h"
#include "theory/theory.h"
#include "theory/rewriter.h"

namespace CVC4 {
namespace theory {
namespace strings {

class RegExpOpr {
	typedef std::pair< Node, CVC4::String > PairDvStr;
private:
    Node d_emptyString;
	char d_char_start;
	char d_char_end;
	Node d_sigma;
	Node d_sigma_star;
	
	std::map< Node, Node > d_compl_cache;
	std::map< Node, int > d_delta_cache;
	std::map< PairDvStr, Node > d_dv_cache;
	std::map< Node, bool > d_cstre_cache;
	//bool checkStarPlus( Node t );
	//void simplifyRegExp( Node s, Node r, std::vector< Node > &ret, std::vector< Node > &nn );
	//Node simplify( Node t, std::vector< Node > &new_nodes );
	std::string niceChar( Node r );
	int gcd ( int a, int b );

public:
	RegExpOpr();
	bool checkConstRegExp( Node r );
    //void simplify(std::vector< Node > &vec_node);
	Node mkAllExceptOne( char c );
	Node complement( Node r );
	int delta( Node r );
	Node derivativeSingle( Node r, CVC4::String c );
	bool guessLength( Node r, int &co );
	void firstChar( Node r );
	bool follow( Node r, CVC4::String c, std::vector< char > &vec_chars );
	std::string mkString( Node r );
};

}/* CVC4::theory::strings namespace */
}/* CVC4::theory namespace */
}/* CVC4 namespace */

#endif /* __CVC4__THEORY__STRINGS__REGEXP__OPERATION_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback