Skip to content

Commit

Permalink
Add support for check-sat-assuming command
Browse files Browse the repository at this point in the history
  • Loading branch information
bpandreotti committed Oct 23, 2023
1 parent 6dcecc1 commit eab2dae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions carcara/src/parser/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ pub enum Reserved {
/// The `assert` reserved word.
Assert,

/// The `check-sat-assuming` reserved word.
CheckSatAssuming,

/// The `set-logic` reserved word.
SetLogic,
}
Expand All @@ -125,6 +128,7 @@ impl_str_conversion_traits!(Reserved {
DeclareSort: "declare-sort",
DefineFun: "define-fun",
Assert: "assert",
CheckSatAssuming: "check-sat-assuming",
SetLogic: "set-logic",
});

Expand Down
6 changes: 6 additions & 0 deletions carcara/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,12 @@ impl<'a, R: BufRead> Parser<'a, R> {
self.expect_token(Token::CloseParen)?;
self.premises().insert(term);
}
Token::ReservedWord(Reserved::CheckSatAssuming) => {
self.expect_token(Token::OpenParen)?;
let terms = self.parse_sequence(Self::parse_term, true)?;
self.expect_token(Token::CloseParen)?;
self.premises().extend(terms);
}
Token::ReservedWord(Reserved::SetLogic) => {
let logic = self.expect_symbol()?;
self.expect_token(Token::CloseParen)?;
Expand Down

0 comments on commit eab2dae

Please sign in to comment.