/*++
Copyright (c) 2015 Microsoft Corporation
--*/

#include <iostream>
#include <sstream>
#include<vector>
#include"z3++.h"

using namespace z3;
 
 
 
void expr_vector_example() {
    std::cout << "expr_vector example\n";
    context c;
    const unsigned N = 10;

    expr_vector x(c);

    for (unsigned i = 0; i < N; i++) { 
        std::stringstream x_name; 
        x_name << "x_" << i;
        x.push_back(c.int_const(x_name.str().c_str()));
    }
    
    solver s(c);
    for (unsigned i = 0; i < N; i++) {
        s.add(x[i] >= 1);
    }

    std::cout << s << "\n" << "solving...\n" << s.check() << "\n";
    model m = s.get_model();
    std::cout << "solution\n" << m;
}

int main() {

    try {
        expr_vector_example(); std::cout << "\n";
        std::cout << "done\n";
    }
    catch (exception & ex) {
        std::cout << "unexpected error: " << ex << "\n";
    }
    return 0;
}
