pub fn substitute(term: &Term, sub: &Term, index: usize) -> Term
substitute sub for the variable at index.
sub
index