#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, serde::Serialize, serde::Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ValidationLimits {
triple_term_nesting: usize,
rules: usize,
body_literals: usize,
skolem_depth: usize,
}
impl ValidationLimits {
pub const STANDARD_TRIPLE_TERM_NESTING: usize = 4;
pub const STANDARD_RULES: usize = 65_536;
pub const STANDARD_BODY_LITERALS: usize = 1_024;
pub const STANDARD_SKOLEM_DEPTH: usize = 64;
#[must_use]
pub const fn standard() -> Self {
Self {
triple_term_nesting: Self::STANDARD_TRIPLE_TERM_NESTING,
rules: Self::STANDARD_RULES,
body_literals: Self::STANDARD_BODY_LITERALS,
skolem_depth: Self::STANDARD_SKOLEM_DEPTH,
}
}
#[must_use]
pub const fn with_triple_term_nesting(mut self, limit: usize) -> Self {
self.triple_term_nesting = limit;
self
}
#[must_use]
pub const fn with_rules(mut self, limit: usize) -> Self {
self.rules = limit;
self
}
#[must_use]
pub const fn with_body_literals(mut self, limit: usize) -> Self {
self.body_literals = limit;
self
}
#[must_use]
pub const fn with_skolem_depth(mut self, limit: usize) -> Self {
self.skolem_depth = limit;
self
}
#[must_use]
pub const fn triple_term_nesting(&self) -> usize {
self.triple_term_nesting
}
#[must_use]
pub const fn rules(&self) -> usize {
self.rules
}
#[must_use]
pub const fn body_literals(&self) -> usize {
self.body_literals
}
#[must_use]
pub const fn skolem_depth(&self) -> usize {
self.skolem_depth
}
}
impl Default for ValidationLimits {
fn default() -> Self {
Self::standard()
}
}