2013-09-04 06:15:37 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#pragma once
|
2013-09-13 10:35:29 +00:00
|
|
|
#include "kernel/expr.h"
|
2013-09-04 06:15:37 +00:00
|
|
|
|
|
|
|
namespace lean {
|
2013-09-13 20:46:22 +00:00
|
|
|
/**
|
|
|
|
\brief Base class for values that have a hierarchical attached to it.
|
|
|
|
*/
|
2013-09-04 06:15:37 +00:00
|
|
|
class named_value : public value {
|
|
|
|
name m_name;
|
|
|
|
public:
|
|
|
|
named_value(name const & n):m_name(n) {}
|
|
|
|
virtual ~named_value() {}
|
|
|
|
virtual name get_name() const { return m_name; }
|
|
|
|
};
|
|
|
|
|
2013-09-13 20:46:22 +00:00
|
|
|
/**
|
|
|
|
\brief Base class for values that have a hierarchical name and a type
|
|
|
|
attached to it.
|
|
|
|
*/
|
2013-09-04 06:15:37 +00:00
|
|
|
class const_value : public named_value {
|
|
|
|
expr m_type;
|
|
|
|
public:
|
|
|
|
const_value(name const & n, expr const & t):named_value(n), m_type(t) {}
|
|
|
|
virtual ~const_value() {}
|
|
|
|
virtual expr get_type() const { return m_type; }
|
|
|
|
};
|
|
|
|
|
2013-09-13 20:46:22 +00:00
|
|
|
/**
|
|
|
|
\brief Base class for values that have a hierarchical name attached to it, and
|
|
|
|
have type Type().
|
|
|
|
*/
|
2013-09-04 06:15:37 +00:00
|
|
|
class type_value : public named_value {
|
|
|
|
public:
|
|
|
|
type_value(name const & n):named_value(n) {}
|
|
|
|
virtual expr get_type() const { return Type(); }
|
|
|
|
};
|
|
|
|
}
|