Skip to content

Commit

Permalink
Allow real arguments to to_real operator
Browse files Browse the repository at this point in the history
  • Loading branch information
bpandreotti committed May 29, 2024
1 parent ede8df5 commit 579b512
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion carcara/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ impl<'a, R: BufRead> Parser<'a, R> {
}
Operator::ToReal => {
assert_num_args(&args, 1)?;
SortError::assert_eq(&Sort::Int, sorts[0])?;
// If the logic contains reals but not integers, integer constants are interpreted
// as reals, so the argument might have sort Real instead of the expected Int
SortError::assert_one_of(&[Sort::Int, Sort::Real], sorts[0])?;
}
Operator::ToInt | Operator::IsInt => {
assert_num_args(&args, 1)?;
Expand Down

0 comments on commit 579b512

Please sign in to comment.