Commit 2d344319 authored by Jeff Smits's avatar Jeff Smits

Implemented "closures" for strategy arguments

parent 7744051c
......@@ -187,7 +187,7 @@ fn write_primitive_libs(file: &mut BufWriter<File>,
"\
pub fn eval_prim_ref<'a>(prim_ref: (Libs, usize),
context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef>
......@@ -243,7 +243,7 @@ fn write_primitives(file: &mut BufWriter<File>,
#[inline]
fn {}<'a>(offset: usize,
context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef>
......
use error::{Result, Error};
use factory::{ATermFactory, ATerm, ATermRef};
use preprocess::SDefT;
use preprocess::StrategyDef;
use primitives::{Primitives, eval_prim_ref};
use primitives::ssl::State;
......@@ -37,7 +37,7 @@ impl<'a> MutContext<'a> {
pub fn call_primitive(&self,
prim_name: &str,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -58,7 +58,7 @@ impl<'a> MutContext<'a> {
}
// Should really return a &SDefT, but I can't figure out lifetimes that borrowck will accept :(
pub fn get_strategy(&self, strat_name: &str) -> Result<SDefT> {
pub fn get_strategy(&self, strat_name: &str) -> Result<StrategyDef> {
self.scopes
.borrow()
.iter()
......@@ -140,7 +140,7 @@ impl StackTracer {
impl fmt::Display for StackTracer {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
for (n, name) in self.stack.iter().enumerate() {
if n == self.current_depth {
if n == self.current_depth-1 {
writeln!(f, "{} <==", name)?;
} else {
writeln!(f, "{}", name)?;
......@@ -153,18 +153,18 @@ impl fmt::Display for StackTracer {
#[derive(Debug, Default, Clone)]
pub struct Scope<ATerm> {
pub term: HashMap<String, Option<ATerm>>,
pub strategy: HashMap<String, SDefT>,
pub strategy: HashMap<String, StrategyDef>,
}
impl<ATerm> Scope<ATerm> {
pub fn from_sdefts<I>(sdefts: I) -> Scope<ATerm>
where I: IntoIterator<Item = SDefT>
where I: IntoIterator<Item =StrategyDef>
{
Scope {
term: HashMap::default(),
strategy: sdefts
.into_iter()
.map(|sdeft| (sdeft.name.clone(), sdeft))
.map(|sdeft| (sdeft.name(), sdeft))
.collect(),
}
}
......
......@@ -3,7 +3,7 @@ use context::MutContext;
use error::{Result, Error};
use factory::{ATermFactory, ATerm, ATermRef};
use preprocess;
use preprocess::{SDefT, preprocess};
use preprocess::{StrategyDef, preprocess};
use primitives::Primitives;
use aterm::{ATerm as A, Term, ATermFactory as ATF};
......@@ -92,7 +92,7 @@ pub trait Eval<'a> {
fn eval(&self, context: &MutContext<'a>, current: ATermRef) -> Result<ATermRef>;
}
impl<'a> Eval<'a> for SDefT {
impl<'a> Eval<'a> for StrategyDef {
fn eval(&self, context: &MutContext<'a>, current: ATermRef) -> Result<ATermRef> {
self.eval(context, Vec::new(), Vec::new(), current)
}
......@@ -104,6 +104,7 @@ impl<'a> Eval<'a> for preprocess::Strategy {
use context;
match *self {
Let(ref defs, ref body) => {
// TODO: Figure out if sdefts in let need to save a scopes-stack pointer thingy
context
.scopes
.borrow_mut()
......@@ -115,13 +116,15 @@ impl<'a> Eval<'a> for preprocess::Strategy {
result
}
CallT(ref name, ref sargs, ref targs) => {
let sdeft = context
.get_strategy(name)?;
println!("Calling {}", name);
let sdeft = context.get_strategy(name)?;
let no_of_scopes = context.scopes.borrow().len();
let sargs = sargs
.into_iter()
.cloned()
.map(SDefT::from_strategy)
.collect();
.enumerate()
.map(|(n,s)| StrategyDef::from_strategy(context, name.clone(), n, s, no_of_scopes))
.collect::<Result<_>>()?;
let targs = targs
.into_iter()
.map(|build_term| build_term.build(context))
......@@ -130,16 +133,18 @@ impl<'a> Eval<'a> for preprocess::Strategy {
}
CallDynamic(ref term_name, ref sargs, ref targs) => {
let strategy_name = context.get_term(term_name)?;
let sdeft = b(&strategy_name)
let no_of_scopes = context.scopes.borrow().len();
let strategy_name = b(&strategy_name)
.get_string()
.ok_or(Error::UndefinedStrategy(format!("Invocation target is invalid (cannot \
be evaluated): {}", strategy_name)))
.and_then(|s| context.get_strategy(&s))?;
be evaluated): {}", strategy_name)))?;
let sdeft = context.get_strategy(&strategy_name)?;
let sargs = sargs
.into_iter()
.cloned()
.map(SDefT::from_strategy)
.collect();
.enumerate()
.map(|(n,s)| StrategyDef::from_strategy(context, strategy_name.clone(), n, s, no_of_scopes))
.collect::<Result<_>>()?;
let targs = targs
.into_iter()
.map(|build_term| build_term.build(context))
......@@ -164,6 +169,7 @@ impl<'a> Eval<'a> for preprocess::Strategy {
strat2.eval(context, current)
}
GuardedLChoice(ref s_if, ref s_then, ref s_else) => {
// TODO: restore unbound variables if s_if binds some
match s_if.eval(context, current.clone()) {
Ok(current) => s_then.eval(context, current),
Err(Error::StrategyFailed) => s_else.eval(context, current),
......@@ -171,20 +177,28 @@ impl<'a> Eval<'a> for preprocess::Strategy {
}
}
PrimT(ref name, ref sargs, ref targs) => {
let no_of_scopes = context.scopes.borrow().len();
let sargs = sargs
.into_iter()
.cloned()
.map(SDefT::from_strategy)
.collect();
.enumerate()
.map(|(n,s)| StrategyDef::from_strategy(context, name.clone(), n, s, no_of_scopes))
.collect::<Result<_>>()?;
let targs = targs
.into_iter()
.map(|build_term| build_term.build(context))
.collect::<Result<_>>()?;
context.call_primitive(name, sargs, targs, current)
}
Some(ref strat) => eval_some(strat, context, current),
One(ref strat) => eval_one(strat, context, current),
All(ref strat) => eval_all(strat, context, current),
Some(ref strat) => {
eval_some(strat, context, current)
},
One(ref strat) => {
eval_one(strat, context, current)
},
All(ref strat) => {
eval_all(strat, context, current)
},
ImportTerm(ref modname) => {
// This primitive really is interwoven with SSL like this :(
use primitives::ssl;
......@@ -335,30 +349,27 @@ fn eval_all<'a>(strat: &preprocess::Strategy,
-> Result<ATermRef> {
use aterm::Term::*;
use aterm::TermPlaceholder as TP;
{
let aterm = b(&current).as_inner();
let annos = &aterm.annotations;
match aterm.term {
Application(ref name, ref r) => {
return all_rec(r, strat, context)
.map(|r| Application(name.clone(), r))
.map(|t| context.factory.with_annos(t, annos.into_iter().cloned()))
}
List(ref r) => {
return all_rec(r, strat, context)
.map(List)
.map(|t| context.factory.with_annos(t, annos.into_iter().cloned()))
}
Placeholder(TP::Application(ref r)) => {
return all_rec(r, strat, context)
.map(TP::Application)
.map(Placeholder)
.map(|t| context.factory.with_annos(t, annos.into_iter().cloned()))
}
Placeholder(_) | Int(_) | Long(_) | Real(_) | Blob(_) => {}
let aterm = b(&current).as_inner();
let annos = &aterm.annotations;
match aterm.term {
Application(ref name, ref r) => {
all_rec(r, strat, context)
.map(|r| Application(name.clone(), r))
.map(|t| context.factory.with_annos(t, annos.into_iter().cloned()))
}
List(ref r) => {
all_rec(r, strat, context)
.map(List)
.map(|t| context.factory.with_annos(t, annos.into_iter().cloned()))
}
Placeholder(TP::Application(ref r)) => {
all_rec(r, strat, context)
.map(TP::Application)
.map(Placeholder)
.map(|t| context.factory.with_annos(t, annos.into_iter().cloned()))
}
Placeholder(_) | Int(_) | Long(_) | Real(_) | Blob(_) => Ok(current.clone()),
}
Ok(current)
}
fn one_rec<'a>(r: &Box<[ATermRef]>,
......
......@@ -70,7 +70,7 @@ fn main() {
let opt = Opt::from_args();
let str_path = find_str_path(opt.str_path);
// TODO: support command line arguments in opt.args
match exec(&opt.program, str_path, opt.libraries) {
match exec(opt.program, str_path, opt.libraries) {
Err(Error::InterpreterExit(i)) => { process::exit(i) },
Err(Error::StrategyFailed) => { process::exit(1) },
Err(e) => { println!("{}", e); process::exit(1) },
......@@ -78,17 +78,25 @@ fn main() {
}
}
fn exec(program_path: &str, str_path: PathBuf, library_paths: Vec<String>) -> Result<String> {
let f = ATermFactory::new();
let libraries = library_paths
.into_iter()
.map(|lib_path| read_lib(&f, str_path.as_ref(), &lib_path))
.collect::<Result<_>>()?;
let program = read_aterm(&f, &program_path)?;
let term = interpret_main(&f, program, libraries)?;
let mut result = String::new();
term.to_ascii(&mut result)?;
Ok(result)
fn exec(program_path: String, str_path: PathBuf, library_paths: Vec<String>) -> Result<String> {
use std::thread;
thread::Builder::new()
.name("Main execution thread".into())
.stack_size(8 * 1024 * 1024)
.spawn(move || {
let f = ATermFactory::new();
let libraries = library_paths
.into_iter()
.map(|lib_path| read_lib(&f, str_path.as_ref(), &lib_path))
.collect::<Result<_>>()?;
let program = read_aterm(&f, &program_path)?;
let term = interpret_main(&f, program, libraries)?;
let mut result = String::new();
term.to_ascii(&mut result)?;
Ok(result)
})?
.join()
.expect("Something went wrong with the execution thread. ")
}
fn read_input<P: AsRef<Path>>(path: &P) -> io::Result<String> {
......
......@@ -34,70 +34,105 @@ pub fn preprocess(program: ctree::Module) -> Result<Scope<ATermRef>> {
.map(TryInto::try_into)
// TODO: find nicer way to filter out external strategy definitions
.filter(Result::is_ok)
.collect::<Result<Vec<SDefT>>>()?;
.collect::<Result<Vec<StrategyDef>>>()?;
Ok(Scope::from_sdefts(defs))
}
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
pub struct SDefT {
pub name: String,
sargs: Vec<String>,
targs: Vec<String>,
body: Strategy,
pub enum StrategyDef {
Predefined {
name: String,
sargs: Vec<String>,
targs: Vec<String>,
body: Strategy,
},
Anonymous {
argument_of: String,
argument_no: usize,
body: Strategy,
no_of_scopes: usize,
},
}
pub fn c_name(string: &str, sargs: usize, targs: usize) -> String {
let name = string.replace('_', "__");
let name = name.replace('-', "_");
let name = name.replace('\'', "_p_");
let name = name.replace('"', "_q_");
let name = name.replace('\\', "_b_");
format!("{}_{}_{}", name, sargs, targs)
}
impl SDefT {
impl StrategyDef {
pub fn eval<'a>(&self,
context: &MutContext<'a>,
sargs: Vec<SDefT>,
targs: Vec<ATermRef>,
actual_sargs: Vec<StrategyDef>,
actual_targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
if sargs.len() != self.sargs.len() || targs.len() != self.targs.len() {
Err(Error::UndefinedStrategy(self.name.clone()))
} else {
context.stack_tracer.borrow_mut().push(self.name.clone());
context
.scopes
.borrow_mut()
.push(Scope {
term: self.targs
.iter()
.cloned()
.zip(targs.into_iter().map(Some))
.collect(),
strategy: self.sargs.iter().cloned().zip(sargs).collect(),
});
let result = self.body.eval(context, current);
if result.is_ok() {
context.stack_tracer.borrow_mut().pop_on_success();
} else {
context.stack_tracer.borrow_mut().pop_on_failure();
match *self {
StrategyDef::Predefined{ref name, ref sargs, ref targs, ref body} => {
if actual_sargs.len() != sargs.len() || actual_targs.len() != targs.len() {
Err(Error::UndefinedStrategy(name.clone()))
} else {
context.stack_tracer.borrow_mut().push(name.clone());
context
.scopes
.borrow_mut()
.push(Scope {
term: targs
.iter()
.cloned()
.zip(actual_targs.into_iter().map(Some))
.collect(),
strategy: sargs.iter().cloned().zip(actual_sargs).collect(),
});
let result = body.eval(context, current);
if result.is_ok() {
context.stack_tracer.borrow_mut().pop_on_success();
} else {
context.stack_tracer.borrow_mut().pop_on_failure();
}
result
}
}
StrategyDef::Anonymous {ref argument_of, ref argument_no, ref body, no_of_scopes} => {
let name = self.name();
if !(actual_sargs.is_empty() && actual_targs.is_empty()) {
Err(Error::UndefinedStrategy(name))
} else {
context.stack_tracer.borrow_mut().push(name);
let popped_scopes = context.scopes.borrow_mut().split_off(no_of_scopes);
let result = body.eval(context, current);
context.scopes.borrow_mut().extend_from_slice(&popped_scopes);
if result.is_ok() {
context.stack_tracer.borrow_mut().pop_on_success();
} else {
context.stack_tracer.borrow_mut().pop_on_failure();
}
result
}
}
result
}
}
pub fn from_strategy(body: Strategy) -> Self {
SDefT {
name: String::new(),
sargs: Vec::new(),
targs: Vec::new(),
body: body,
pub fn from_strategy(context: &MutContext, name: String, number: usize, body: Strategy, no_of_scopes: usize) -> Result<Self> {
// NOTE: this is not an optimisation but a necessary semantic distinction to allow
// strategies that take arguments to be passed as strategy arguments!
match body {
Strategy::CallT(ref name, ref sargs, ref targs)
if sargs.is_empty() && targs.is_empty() =>
context.get_strategy(name),
_ => Ok(StrategyDef::Anonymous {
argument_of: name,
argument_no: number,
body: body,
no_of_scopes: no_of_scopes,
}),
}
}
pub fn name(&self) -> String {
match *self {
StrategyDef::Predefined { ref name, .. } => name.clone(),
StrategyDef::Anonymous { ref argument_of, ref argument_no, .. } =>
format!("{}.{}", argument_of, argument_no),
}
}
}
impl TryFrom<ctree::Def> for SDefT {
impl TryFrom<ctree::Def> for StrategyDef {
type Err = Error;
fn try_from(value: ctree::Def) -> result::Result<Self, Self::Err> {
......@@ -105,7 +140,7 @@ impl TryFrom<ctree::Def> for SDefT {
ctree::Def::SDefT(name, sargs, targs, body) => {
body.try_into()
.map(|body| {
SDefT {
StrategyDef::Predefined {
name: name,
sargs: sargs.into_iter().map(|vardec| vardec.0).collect(),
targs: targs.into_iter().map(|vardec| vardec.0).collect(),
......@@ -129,7 +164,7 @@ impl TryFrom<ctree::Def> for SDefT {
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
pub enum Strategy {
Let(Vec<SDefT>, Box<Strategy>),
Let(Vec<StrategyDef>, Box<Strategy>),
CallT(String, Vec<Strategy>, Vec<BuildTerm>),
CallDynamic(String, Vec<Strategy>, Vec<BuildTerm>),
Fail,
......@@ -386,7 +421,7 @@ impl BuildTerm {
};
self.build(&dummy_context).map_err(|e| {
match e {
Error::UndefinedVariable(v) =>
Error::UndefinedVariable(_) =>
Error::CTreeParse("Found variable in static build position"),
Error::UnknownBehaviour(s) => Error::CTreeParse(s),
_ => e,
......
......@@ -3,7 +3,7 @@
use context::MutContext;
use error::Result;
use factory::ATermRef;
use preprocess::SDefT;
use preprocess::StrategyDef;
use phf;
......
......@@ -2,7 +2,7 @@ use context::MutContext;
use error::{Error, Result};
use factory::{HashTable, ATermRef};
use interpreter::to_cons_nil_list;
use preprocess::SDefT;
use preprocess::StrategyDef;
use aterm::{ATermFactory as ATF, ATerm as A};
......@@ -25,7 +25,7 @@ impl HashTableState {
}
pub fn dynamic_rules_hashtable<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -41,7 +41,7 @@ pub fn dynamic_rules_hashtable<'a>(context: &MutContext<'a>,
}
pub fn hashtable_create<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -63,7 +63,7 @@ pub fn hashtable_create<'a>(context: &MutContext<'a>,
}
pub fn hashtable_reset<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -85,7 +85,7 @@ pub fn hashtable_reset<'a>(context: &MutContext<'a>,
}
pub fn hashtable_destroy<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -93,7 +93,7 @@ pub fn hashtable_destroy<'a>(context: &MutContext<'a>,
}
pub fn hashtable_put<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -119,7 +119,7 @@ pub fn hashtable_put<'a>(context: &MutContext<'a>,
}
pub fn hashtable_remove<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -143,7 +143,7 @@ pub fn hashtable_remove<'a>(context: &MutContext<'a>,
}
pub fn hashtable_get<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -168,7 +168,7 @@ pub fn hashtable_get<'a>(context: &MutContext<'a>,
}
pub fn hashtable_keys<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -189,7 +189,7 @@ pub fn hashtable_keys<'a>(context: &MutContext<'a>,
}
pub fn table_hashtable<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -205,7 +205,7 @@ pub fn table_hashtable<'a>(context: &MutContext<'a>,
}
pub fn table_fold<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -236,7 +236,7 @@ pub fn table_fold<'a>(context: &MutContext<'a>,
}
pub fn table_keys_fold<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -264,7 +264,7 @@ pub fn table_keys_fold<'a>(context: &MutContext<'a>,
}
pub fn table_values_fold<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......
......@@ -2,14 +2,14 @@ use context::MutContext;
use error::{Error, Result};
use factory::{IndexedSet, ATermRef};
use interpreter::to_cons_nil_list;
use preprocess::SDefT;
use preprocess::StrategyDef;
use aterm::{ATermFactory as ATF, ATerm as A};
use std::cell::RefCell;
pub fn indexedSet_create<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -31,7 +31,7 @@ pub fn indexedSet_create<'a>(context: &MutContext<'a>,
}
pub fn indexedSet_reset<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -53,7 +53,7 @@ pub fn indexedSet_reset<'a>(context: &MutContext<'a>,
}
pub fn indexedSet_destroy<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -61,7 +61,7 @@ pub fn indexedSet_destroy<'a>(context: &MutContext<'a>,
}
pub fn indexedSet_put<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -91,7 +91,7 @@ pub fn indexedSet_put<'a>(context: &MutContext<'a>,
}
pub fn indexedSet_remove<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -114,7 +114,7 @@ pub fn indexedSet_remove<'a>(context: &MutContext<'a>,
}
pub fn indexedSet_getIndex<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -138,7 +138,7 @@ pub fn indexedSet_getIndex<'a>(context: &MutContext<'a>,
}
pub fn indexedSet_elements<'a>(context: &MutContext<'a>,
sargs: Vec<SDefT>,
sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......
use context::MutContext;
use error::{Error, Result};
use factory::ATermRef;
use preprocess::SDefT;
use preprocess::StrategyDef;
use aterm::{ATermFactory as ATF, ATerm as A};
pub fn is_int<'a>(_context: &MutContext<'a>,
_sargs: Vec<SDefT>,
_sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -20,7 +20,7 @@ pub fn is_int<'a>(_context: &MutContext<'a>,
}
pub fn int<'a>(context: &MutContext<'a>,
_sargs: Vec<SDefT>,
_sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -39,7 +39,7 @@ pub fn int<'a>(context: &MutContext<'a>,
}
pub fn iori<'a>(context: &MutContext<'a>,
_sargs: Vec<SDefT>,
_sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -52,7 +52,7 @@ pub fn iori<'a>(context: &MutContext<'a>,
}
pub fn xori<'a>(context: &MutContext<'a>,
_sargs: Vec<SDefT>,
_sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -65,7 +65,7 @@ pub fn xori<'a>(context: &MutContext<'a>,
}
pub fn andi<'a>(context: &MutContext<'a>,
_sargs: Vec<SDefT>,
_sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -78,7 +78,7 @@ pub fn andi<'a>(context: &MutContext<'a>,
}
pub fn shli<'a>(context: &MutContext<'a>,
_sargs: Vec<SDefT>,
_sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -91,7 +91,7 @@ pub fn shli<'a>(context: &MutContext<'a>,
}
pub fn shri<'a>(context: &MutContext<'a>,
_sargs: Vec<SDefT>,
_sargs: Vec<StrategyDef>,
targs: Vec<ATermRef>,
current: ATermRef)
-> Result<ATermRef> {
......@@ -104,7 +104,7 @@ pub fn shri<'a>(context: &MutContext<'a>,
}
pub fn addi<'a>(context: &MutContext<'a>,
_sargs: Vec<SDefT>,