Skip to main content

logic_eval/prove/
common.rs

1use crate::{Name, VAR_PREFIX};
2use core::hash::Hash;
3
4pub trait Atom: Clone + Eq + Hash {
5    fn is_variable(&self) -> bool;
6}
7
8impl<'int> Atom for any_intern::Interned<'int, str> {
9    fn is_variable(&self) -> bool {
10        self.starts_with(VAR_PREFIX)
11    }
12}
13
14impl<'int> Atom for Name<any_intern::Interned<'int, str>> {
15    fn is_variable(&self) -> bool {
16        self.starts_with(VAR_PREFIX)
17    }
18}