Domains test
This commit is contained in:
@ -2,6 +2,8 @@ use owo_colors::{OwoColorize, colors::css::Gray};
|
||||
|
||||
use std::fmt::Display;
|
||||
|
||||
use crate::domain::Domain;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
|
||||
pub struct Variable(pub String, pub Option<usize>);
|
||||
|
||||
@ -31,6 +33,7 @@ pub enum Predicate
|
||||
{
|
||||
Variable(Variable), // Upercase variable like X
|
||||
Fixed(Functor, Vec<Predicate>),
|
||||
Domain(Domain),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
@ -135,6 +138,7 @@ impl Display for Predicate
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Predicate::Domain(domain) => write!(f, "{domain}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -174,6 +178,7 @@ impl Display for Functor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Operator
|
||||
{
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result
|
||||
|
||||
Reference in New Issue
Block a user