datalog_structural_model/
limits.rs1#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, serde::Serialize, serde::Deserialize)]
14#[serde(deny_unknown_fields)]
15pub struct ValidationLimits {
16 triple_term_nesting: usize,
17 rules: usize,
18 body_literals: usize,
19 skolem_depth: usize,
20}
21
22impl ValidationLimits {
23 pub const STANDARD_TRIPLE_TERM_NESTING: usize = 4;
25 pub const STANDARD_RULES: usize = 65_536;
27 pub const STANDARD_BODY_LITERALS: usize = 1_024;
29 pub const STANDARD_SKOLEM_DEPTH: usize = 64;
32
33 #[must_use]
35 pub const fn standard() -> Self {
36 Self {
37 triple_term_nesting: Self::STANDARD_TRIPLE_TERM_NESTING,
38 rules: Self::STANDARD_RULES,
39 body_literals: Self::STANDARD_BODY_LITERALS,
40 skolem_depth: Self::STANDARD_SKOLEM_DEPTH,
41 }
42 }
43
44 #[must_use]
46 pub const fn with_triple_term_nesting(mut self, limit: usize) -> Self {
47 self.triple_term_nesting = limit;
48 self
49 }
50
51 #[must_use]
53 pub const fn with_rules(mut self, limit: usize) -> Self {
54 self.rules = limit;
55 self
56 }
57
58 #[must_use]
60 pub const fn with_body_literals(mut self, limit: usize) -> Self {
61 self.body_literals = limit;
62 self
63 }
64
65 #[must_use]
67 pub const fn with_skolem_depth(mut self, limit: usize) -> Self {
68 self.skolem_depth = limit;
69 self
70 }
71
72 #[must_use]
74 pub const fn triple_term_nesting(&self) -> usize {
75 self.triple_term_nesting
76 }
77
78 #[must_use]
80 pub const fn rules(&self) -> usize {
81 self.rules
82 }
83
84 #[must_use]
86 pub const fn body_literals(&self) -> usize {
87 self.body_literals
88 }
89
90 #[must_use]
92 pub const fn skolem_depth(&self) -> usize {
93 self.skolem_depth
94 }
95}
96
97impl Default for ValidationLimits {
98 fn default() -> Self {
99 Self::standard()
100 }
101}