Compare commits
3 Commits
a6fe4b9e08
...
5070965bfe
Author | SHA1 | Date | |
---|---|---|---|
5070965bfe
|
|||
30ba3e22c1
|
|||
de4ab29da5
|
@@ -1,4 +1,4 @@
|
|||||||
#[derive(PartialEq)]
|
#[derive(Eq, Hash, PartialEq)]
|
||||||
pub struct PredicateDeclaration
|
pub struct PredicateDeclaration
|
||||||
{
|
{
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
@@ -72,13 +72,7 @@ impl std::fmt::Display for crate::VariableDeclaration
|
|||||||
{
|
{
|
||||||
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
fn fmt(&self, format: &mut std::fmt::Formatter) -> std::fmt::Result
|
||||||
{
|
{
|
||||||
match &self.domain
|
write!(format, "{:?}", &self)
|
||||||
{
|
|
||||||
crate::Domain::Program => write!(format, "X")?,
|
|
||||||
crate::Domain::Integer => write!(format, "N")?,
|
|
||||||
};
|
|
||||||
|
|
||||||
write!(format, "{}", &self.name)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -483,9 +483,9 @@ fn formula_precedence_0(i: &str) -> IResult<&str, crate::Formula>
|
|||||||
{
|
{
|
||||||
alt
|
alt
|
||||||
((
|
((
|
||||||
|
comparison,
|
||||||
predicate,
|
predicate,
|
||||||
boolean,
|
boolean,
|
||||||
comparison,
|
|
||||||
formula_parenthesized
|
formula_parenthesized
|
||||||
))(i)
|
))(i)
|
||||||
}
|
}
|
||||||
@@ -845,6 +845,13 @@ mod tests
|
|||||||
Box::new(crate::Term::Integer(9)),
|
Box::new(crate::Term::Integer(9)),
|
||||||
),
|
),
|
||||||
))));
|
))));
|
||||||
|
|
||||||
|
assert_eq!(crate::formula("n = 5"), Ok(("",
|
||||||
|
crate::Formula::Equal
|
||||||
|
(
|
||||||
|
crate::Term::Symbolic("n".to_string()),
|
||||||
|
crate::Term::Integer(5),
|
||||||
|
))));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Reference in New Issue
Block a user