use crate::types::term::Term;
use crate::types::FunctionSymbol;
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct FunctionTerm(FunctionSymbol, Vec<Term>);
impl FunctionTerm {
pub fn new<I: IntoIterator<Item = Term>>(symbol: FunctionSymbol, terms: I) -> Self {
Self(symbol, terms.into_iter().collect())
}
pub const fn symbol(&self) -> &FunctionSymbol {
&self.0
}
pub fn terms(&self) -> &[Term] {
self.1.as_ref()
}
}
impl AsRef<FunctionSymbol> for FunctionTerm {
fn as_ref(&self) -> &FunctionSymbol {
&self.0
}
}
impl AsRef<Vec<Term>> for FunctionTerm {
fn as_ref(&self) -> &Vec<Term> {
&self.1
}
}