Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
eneoli committed Sep 26, 2024
1 parent 1a0f5c9 commit 5f5f419
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/kernel/prove/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ impl Prover {
}

// impl atom rule
let mut changes = vec![];
let mut atom_impl_changes = vec![];
for i in 0..sequent.unordered_ctx.len() {
let TypeJudgment { prop, proof_term } = &sequent.unordered_ctx[i];
let Prop::Impl(impl_fst, impl_snd) = prop else {
Expand All @@ -462,22 +462,19 @@ impl Prover {
Application::create(proof_term.boxed(), elem.proof_term.boxed(), None),
);

changes.push((i, new_judgment));
atom_impl_changes.push((i, new_judgment));
}
}

let has_changes = changes.len() > 0;
if has_changes {
changes.reverse();
if atom_impl_changes.len() > 0 {
atom_impl_changes.reverse();
let mut impl_sequent = sequent.clone();
for (i, new_judgment) in changes {
for (i, new_judgment) in atom_impl_changes {
impl_sequent.unordered_ctx.remove(i);
impl_sequent.append_ordered(new_judgment);
}

if let Some(result_proof_term) = self.prove_left(impl_sequent) {
return Some(result_proof_term);
}
return self.prove_left(impl_sequent);
}

// or left rule
Expand Down

0 comments on commit 5f5f419

Please sign in to comment.