#include "qbf_literal.hpp"
#include <sstream>
#include <cmath>
#include <boost/foreach.hpp>
#include <cassert>
#include <iostream>

QBF_Literal::QBF_Literal(Literal* p)
    : literal(p)
{
    p->add_parent(this);
}

QBF_Literal::~QBF_Literal(void)
{
}

std::string QBF_Literal::toString()
{
    std::ostringstream os;
    os << "QPC" << id;
    return os.str();
}

void QBF_Literal::update()
{
    QBF::update();
}

bool QBF_Literal::eval()
{
//    total_size+=1;
    return literal->eval();
}

void QBF_Literal::propagate(unsigned long assigner_id, bool b)
{
    status = b;
    if(parent != NULL)
	parent->propagate(assigner_id, b);
}

void QBF_Literal::reset_status()
{
    QBF::reset_status();
}

void QBF_Literal::update_prob()
{
    prob = 0.5;
}

void QBF_Literal::update_size()
{
    size = 1;
}

void QBF_Literal::update_child_cost()
{
    // do nothing.
}
