You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CheckFail(location=BinopExpr(operator=Binop.POWER,
lhs=BinopExpr(operator=Binop.MINUS,
lhs=NatLitExpr(1),
rhs=BinopExpr(operator=Binop.TIMES, lhs=VarExpr('c'), rhs=VarExpr('c'))
),
rhs=RealLitExpr("1/2")),
message='Expected value of type NatType(bounds=None), got RealType().')
The text was updated successfully, but these errors were encountered:
This is triggered by the expression ((1-(1-(c*c))^(1/2))/c). It happens because the function is_compatible() in check.py doesn't behave as documented; NatTypes are not compatible with RealTypes, i.e., n^(1/2) is wrongly typed if n is a natural number.
A simple fix would be to change line 309 in check.py from if isinstance(lhs, NatType) and isinstance(rhs, NatType): to if isinstance(lhs, NatType) and isinstance(rhs, (NatType, RealType)):, though this seems to break one of the testcases.
(it might be possible that I'm misunderstanding the concept of compatibility here)
Results in
The text was updated successfully, but these errors were encountered: