Skip to content

Commit

Permalink
Fixes to adato to changes in ProblemPrelude
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallku2 committed Nov 24, 2024
1 parent 1fbeff7 commit b6c201c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
20 changes: 5 additions & 15 deletions carcara/src/translation/eunoia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,18 +625,6 @@ impl EunoiaTranslator {
}
}

fn translate_proof_arg(&self, proof_arg: &ProofArg) -> EunoiaTerm {
match proof_arg {
// An argument that is just a term.
ProofArg::Term(term) => self.translate_term(term),

ProofArg::Assign(.., term) => {
// TODO: how should we translate (:= <symbol> <term>)?
self.translate_term(term)
}
}
}

/// Implements the translation of an Alethe `Assume`, taking into
/// account technical differences in the way Alethe rules are
/// expressed within Eunoia.
Expand Down Expand Up @@ -677,7 +665,7 @@ impl EunoiaTranslator {
clause: &[Rc<Term>],
rule: &str,
premises: &[Rc<ProofNode>],
args: &[ProofArg],
args: &[Rc<Term>],
discharge: &[Rc<ProofNode>],
) {
let mut alethe_premises: Vec<EunoiaTerm> = Vec::new();
Expand Down Expand Up @@ -711,7 +699,7 @@ impl EunoiaTranslator {
let mut eunoia_arguments: Vec<EunoiaTerm> = Vec::new();

args.iter().for_each(|arg| {
eunoia_arguments.push(self.translate_proof_arg(arg));
eunoia_arguments.push(self.translate_term(arg));
});

// TODO: develop some generic programmatic way to deal with each rule's
Expand Down Expand Up @@ -877,7 +865,9 @@ impl EunoiaTranslator {

// TODO: make eunoia_prelude an attribute of EunoiaTranslator
/// Translates only an SMT-lib problem prelude.
pub fn translate_problem_prelude(&self, prelude: &ProblemPrelude) -> EunoiaProof {
pub fn translate_problem_prelude(&self, problem: &Problem) -> EunoiaProof {
let Problem { prelude, .. } = problem;

let ProblemPrelude {
sort_declarations,
function_declarations,
Expand Down
1 change: 1 addition & 0 deletions carcara/src/translation/tests/test_translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const TEST_CONFIG: Config = Config {
expand_lets: false,
allow_int_real_subtyping: false,
strict: false,
parse_hole_args: false,
};

#[test]
Expand Down

0 comments on commit b6c201c

Please sign in to comment.