3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 02:45:51 +00:00

trying new build infrastructure on linux

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-10-23 13:10:41 -07:00
parent efff6db567
commit 1d795e9a5e
9 changed files with 41 additions and 72 deletions

View file

@ -30,49 +30,6 @@ using namespace format_ns;
#define MAX_INDENT 16
#define SMALL_INDENT 2
bool is_smt2_simple_symbol_char(char s) {
return
('0' <= s && s <= '9') ||
('a' <= s && s <= 'z') ||
('A' <= s && s <= 'Z') ||
s == '~' || s == '!' || s == '@' || s == '$' || s == '%' || s == '^' || s == '&' ||
s == '*' || s == '_' || s == '-' || s == '+' || s == '=' || s == '<' || s == '>' ||
s == '.' || s == '?' || s == '/';
}
bool is_smt2_quoted_symbol(char const * s) {
if (s == 0)
return false;
if ('0' <= s[0] && s[0] <= '9')
return true;
unsigned len = static_cast<unsigned>(strlen(s));
for (unsigned i = 0; i < len; i++)
if (!is_smt2_simple_symbol_char(s[i]))
return true;
return false;
}
bool is_smt2_quoted_symbol(symbol const & s) {
if (s.is_numerical())
return false;
return is_smt2_quoted_symbol(s.bare_str());
}
std::string mk_smt2_quoted_symbol(symbol const & s) {
SASSERT(is_smt2_quoted_symbol(s));
string_buffer<> buffer;
buffer.append('|');
char const * str = s.bare_str();
while (*str) {
if (*str == '|' || *str == '\\')
buffer.append('\\');
buffer.append(*str);
str++;
}
buffer.append('|');
return std::string(buffer.c_str());
}
format * smt2_pp_environment::pp_fdecl_name(symbol const & s, unsigned & len) const {
ast_manager & m = get_manager();
if (is_smt2_quoted_symbol(s)) {