add evaluation for terms

Co-authored-by: rvcas <x@rvcas.dev>
This commit is contained in:
Kasey White
2022-07-06 02:11:46 -04:00
committed by Kasey White
parent 795d9ee028
commit 0bf93e59b5
4 changed files with 220 additions and 168 deletions

View File

@@ -1,9 +1,19 @@
use thiserror::Error;
use super::ExBudget;
use crate::ast::{NamedDeBruijn, Term};
use super::{ExBudget, Value};
#[derive(Error, Debug)]
pub enum Error {
#[error("Over budget mem: {} & cpu: {}", .0.mem, .0.cpu)]
OutOfExError(ExBudget),
#[error("Invalid Stepkind: {0}")]
InvalidStepKind(u8),
#[error("Cannot evaluate an open term: {0:#?}")]
OpenTermEvaluated(Term<NamedDeBruijn>),
#[error("The provided Plutus code called 'error'.")]
EvaluationFailure,
#[error("Attempted to instantiate a non-polymorphic term: {0:#?}")]
NonPolymorphicInstantiation(Value),
}