oxiz_proof/
theory_combination.rs1use crate::proof::ProofNodeId;
4use oxiz_core::TermId;
5
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
8pub struct TheoryId(pub u32);
9
10#[derive(Debug, Clone, PartialEq, Eq)]
12pub struct CombinationStep {
13 pub theory: TheoryId,
15 pub propagated_equalities: Vec<(TermId, TermId)>,
17 pub justification: Vec<ProofNodeId>,
19}
20
21#[derive(Debug, Clone, PartialEq, Eq)]
23pub struct NelsonOppenCertificate {
24 pub steps: Vec<CombinationStep>,
26 pub concluding_theory: TheoryId,
28 pub contradiction: ProofNodeId,
30}
31
32impl NelsonOppenCertificate {
33 #[must_use]
35 pub fn new(concluding_theory: TheoryId, contradiction: ProofNodeId) -> Self {
36 Self {
37 steps: Vec::new(),
38 concluding_theory,
39 contradiction,
40 }
41 }
42
43 pub fn add_step(&mut self, step: CombinationStep) {
45 self.steps.push(step);
46 }
47
48 #[must_use]
50 pub fn verify(&self) -> bool {
51 let Some(last) = self.steps.last() else {
52 return false;
53 };
54
55 last.theory == self.concluding_theory
56 && (!last.propagated_equalities.is_empty() || !last.justification.is_empty())
57 }
58}