pub fn substitute(tp: &mut TermPool, t: &ATermRef<'_>, new_subterm: ATerm, p: &[usize]) -> ATerm {
let new_child = substitute_rec(tp, &t.arg(new_child_index), new_subterm, p, args, depth + 1);
// TODO: When write is dropped we check whether all terms where inserted, but this clear violates that assumption.
pub fn to_untyped_data_expression(tp: &mut TermPool, t: &ATerm, variables: &AHashSet<String>) -> DataExpression {
let _expression = to_untyped_data_expression(&mut term_pool, &t, &AHashSet::from_iter(["a".to_string()]));