forked from ufmg-smite/carcara
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move premises outside
Proof
and into new Problem
struct
- Loading branch information
1 parent
f3f9107
commit 9053d18
Showing
16 changed files
with
139 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use super::{Rc, Term}; | ||
use indexmap::IndexSet; | ||
|
||
/// An SMT problem in the SMT-LIB format. | ||
#[derive(Debug, Clone, Default)] | ||
pub struct Problem { | ||
/// The problem's prelude. | ||
pub prelude: ProblemPrelude, | ||
|
||
/// The proof's premises. | ||
/// | ||
/// Those are the terms introduced in the original problem's `assert` commands. | ||
pub premises: IndexSet<Rc<Term>>, | ||
} | ||
|
||
impl Problem { | ||
pub fn new() -> Self { | ||
Self::default() | ||
} | ||
} | ||
|
||
/// The prelude of an SMT-LIB problem instance. | ||
/// | ||
/// This stores the sort declarations, function declarations and the problem's logic string. | ||
#[derive(Debug, Clone, Default)] | ||
pub struct ProblemPrelude { | ||
/// The sort declarations, each represented by its name and arity. | ||
pub(crate) sort_declarations: Vec<(String, usize)>, | ||
|
||
/// The function declarations, each represented by its name and body. | ||
pub(crate) function_declarations: Vec<(String, Rc<Term>)>, | ||
|
||
/// The problem's logic string, if it exists. | ||
pub(crate) logic: Option<String>, | ||
} | ||
|
||
impl ProblemPrelude { | ||
pub fn new() -> Self { | ||
Self::default() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.