/*******************************************************************\

Module: Generate Equation using Symbolic Execution

Author: Daniel Kroening, kroening@cs.cmu.edu

\*******************************************************************/

#ifndef CPROVER_GOTO_SYMEX_SYMEX_TARGET_H
#define CPROVER_GOTO_SYMEX_SYMEX_TARGET_H

#include <expr.h>
#include <symbol.h>
#include <guard.h>

#include <goto-programs/goto_program.h>

class symex_targett
{
public:
  virtual ~symex_targett() { }
  
  struct sourcet
  {
    unsigned thread_nr;
    goto_programt::const_targett pc;
  
    sourcet():thread_nr(0), pc(NULL)
    {
    }

    sourcet(goto_programt::const_targett _pc):
      thread_nr(0), pc(_pc)
    {
    }
  };
  
  typedef enum { STATE, INIT, HIDDEN } assignment_typet;

  // write to a variable - must be symbol
  // the value is destroyed
  virtual void assignment(
    const guardt &guard,
    const exprt &lhs,
    const exprt &original_lhs,
    exprt &rhs,
    const sourcet &source,
    assignment_typet assignment_type)=0;

  // just record a location
  virtual void location(
    const guardt &guard,
    const sourcet &source)=0;

  // record output
  virtual void output(
    const guardt &guard,
    const sourcet &source,
    const std::list<exprt> &args)=0;
  
  // record an assumption
  // cond is destroyed
  virtual void assumption(
    const guardt &guard,
    exprt &cond,
    const sourcet &source)=0;

  // record an assertion
  // cond is destroyed
  virtual void assertion(
    const guardt &guard,
    exprt &cond,
    const std::string &msg,
    const sourcet &source)=0;
};

bool operator < (
  const symex_targett::sourcet &a,
  const symex_targett::sourcet &b);

#endif
