ask-dracula-rs/src/project.rs

64 lines
1.1 KiB
Rust
Raw Permalink Normal View History

2019-11-07 05:42:42 +01:00
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub enum ProofDirection
{
Forward,
Backward,
}
2019-11-07 04:20:06 +01:00
#[derive(Eq, Hash, PartialEq)]
pub enum CompletionTarget
{
Predicate(foliage::PredicateDeclaration),
Constraint,
}
#[derive(Eq, Hash, PartialEq)]
2019-11-07 08:12:26 +01:00
pub enum FormulaStatementKind
2019-11-02 02:13:45 +01:00
{
Axiom,
2019-11-07 04:20:06 +01:00
Completion(CompletionTarget),
2019-11-07 05:42:42 +01:00
Lemma(Option<ProofDirection>),
Assumption,
Assertion,
2019-11-02 02:13:45 +01:00
}
2019-11-07 08:12:26 +01:00
pub struct FormulaStatement
2019-11-02 02:13:45 +01:00
{
2019-11-07 08:12:26 +01:00
pub kind: FormulaStatementKind,
pub original_text: String,
pub formula: foliage::Formula,
pub proven: bool,
}
2019-11-07 09:17:49 +01:00
pub struct InputStatement
{
pub original_text: String,
}
2019-11-07 10:14:44 +01:00
#[derive(Eq, Hash, PartialEq)]
pub struct InputConstantDeclaration
{
pub name: String,
pub domain: foliage::Domain,
}
2019-11-07 09:17:49 +01:00
pub enum InputSymbol
{
2019-11-07 10:14:44 +01:00
Constant(InputConstantDeclaration),
2019-11-07 09:17:49 +01:00
Predicate(foliage::PredicateDeclaration),
}
pub enum Block
{
2019-11-07 08:12:26 +01:00
FormulaStatement(FormulaStatement),
2019-11-07 09:17:49 +01:00
InputStatement(InputStatement),
Whitespace(String),
}
pub struct Project
{
pub blocks: Vec<Block>,
2019-11-07 10:14:44 +01:00
pub input_constants: std::collections::HashSet<InputConstantDeclaration>,
2019-11-07 09:17:49 +01:00
pub input_predicates: std::collections::HashSet<foliage::PredicateDeclaration>,
2019-11-02 02:13:45 +01:00
}