Skip to content

Commit

Permalink
Rename or_intro rule to weakening
Browse files Browse the repository at this point in the history
This is because it doesn't actually use the `or` operator.
Instead it operates directly on the clause.
See the conversation here:
https://gitlab.uliege.be/verit/alethe/-/issues/45
  • Loading branch information
hansjoergschurr authored and bpandreotti committed Aug 8, 2024
1 parent 6a670a8 commit 45d9fd5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion carcara/src/checker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ impl<'c> ProofChecker<'c> {
"symm" => extras::symm,
"not_symm" => extras::not_symm,
"eq_symmetric" => extras::eq_symmetric,
"or_intro" => extras::or_intro,
"weakening" => extras::weakening,
"bind_let" => extras::bind_let,
"la_mult_pos" => extras::la_mult_pos,
"la_mult_neg" => extras::la_mult_neg,
Expand Down
2 changes: 1 addition & 1 deletion carcara/src/checker/parallel/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ pub fn get_step_weight(step: &ProofCommand) -> u64 {
"symm" => 682,
"not_symm" => 0, //-1
"eq_symmetric" => 673,
"or_intro" => 508,
"weakening" => 508,
"bind_let" => 2324,
"la_mult_pos" => 1446,
"la_mult_neg" => 1447,
Expand Down
12 changes: 6 additions & 6 deletions carcara/src/checker/rules/extras.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn eq_symmetric(RuleArgs { conclusion, .. }: RuleArgs) -> RuleResult {
assert_eq(u_1, u_2)
}

pub fn or_intro(RuleArgs { conclusion, premises, .. }: RuleArgs) -> RuleResult {
pub fn weakening(RuleArgs { conclusion, premises, .. }: RuleArgs) -> RuleResult {
assert_num_premises(premises, 1)?;
let premise = premises[0].clause;
assert_clause_len(conclusion, premise.len()..)?;
Expand Down Expand Up @@ -289,7 +289,7 @@ mod tests {
}

#[test]
fn or_intro() {
fn weakening() {
test_cases! {
definitions = "
(declare-fun a () Bool)
Expand All @@ -298,17 +298,17 @@ mod tests {
",
"Simple working examples" {
"(step t1 (cl a b) :rule hole)
(step t2 (cl a b c) :rule or_intro :premises (t1))": true,
(step t2 (cl a b c) :rule weakening :premises (t1))": true,

"(step t1 (cl) :rule hole)
(step t2 (cl a b) :rule or_intro :premises (t1))": true,
(step t2 (cl a b) :rule weakening :premises (t1))": true,
}
"Failing examples" {
"(step t1 (cl a b) :rule hole)
(step t2 (cl a c b) :rule or_intro :premises (t1))": false,
(step t2 (cl a c b) :rule weakening :premises (t1))": false,

"(step t1 (cl a b c) :rule hole)
(step t2 (cl a b) :rule or_intro :premises (t1))": false,
(step t2 (cl a b) :rule weakening :premises (t1))": false,
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions carcara/src/checker/rules/transitivity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,15 @@ pub fn elaborate_eq_transitive(
if !not_needed.is_empty() {
let mut clause = latest_clause;
clause.extend(not_needed);
let or_intro_step = ProofStep {
let weakening_step = ProofStep {
id: elaborator.get_new_id(&command_id),
clause,
rule: "or_intro".to_owned(),
rule: "weakening".to_owned(),
premises: vec![latest_step_index],
args: Vec::new(),
discharge: Vec::new(),
};
latest_step_index = elaborator.add_new_step(or_intro_step);
latest_step_index = elaborator.add_new_step(weakening_step);
}

elaborator.push_elaborated_step(ProofStep {
Expand Down

0 comments on commit 45d9fd5

Please sign in to comment.