1 /*++ 2 Copyright (c) 2011 Microsoft Corporation 3 4 Module Name: 5 6 z3_replayer.h 7 8 Abstract: 9 10 Interpreter for Z3 logs 11 12 Author: 13 14 Leonardo de Moura (leonardo) 2011-09-22 15 16 Notes: 17 18 --*/ 19 #pragma once 20 21 #include<iostream> 22 #include "api/z3.h" 23 #include "util/z3_exception.h" 24 25 class z3_replayer; 26 27 typedef void (*z3_replayer_cmd)(z3_replayer &); 28 29 typedef default_exception z3_replayer_exception; 30 31 class z3_replayer { 32 struct imp; 33 imp * m_imp; 34 public: 35 z3_replayer(std::istream & in); 36 ~z3_replayer(); 37 void parse(); 38 unsigned get_line() const; 39 40 int get_int(unsigned pos) const; 41 unsigned get_uint(unsigned pos) const; 42 int64_t get_int64(unsigned pos) const; 43 uint64_t get_uint64(unsigned pos) const; 44 float get_float(unsigned pos) const; 45 double get_double(unsigned pos) const; 46 bool get_bool(unsigned pos) const; 47 Z3_string get_str(unsigned pos) const; 48 Z3_symbol get_symbol(unsigned pos) const; 49 void * get_obj(unsigned pos) const; 50 51 unsigned * get_uint_array(unsigned pos) const; 52 int * get_int_array(unsigned pos) const; 53 bool * get_bool_array(unsigned pos) const; 54 Z3_symbol * get_symbol_array(unsigned pos) const; 55 void ** get_obj_array(unsigned pos) const; 56 57 int * get_int_addr(unsigned pos); 58 int64_t * get_int64_addr(unsigned pos); 59 unsigned * get_uint_addr(unsigned pos); 60 uint64_t * get_uint64_addr(unsigned pos); 61 Z3_string * get_str_addr(unsigned pos); 62 void ** get_obj_addr(unsigned pos); 63 64 void store_result(void * obj); 65 void register_cmd(unsigned id, z3_replayer_cmd cmd, char const* name); 66 }; 67 68