Skip to content

Commit

Permalink
Add Binops
Browse files Browse the repository at this point in the history
  • Loading branch information
linusheck committed Sep 24, 2023
1 parent c65b762 commit c6eb165
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions probably/prism/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ def expression_prism(expr: Expr) -> str:
return f"({lhs}) <= ({rhs})"
elif expr.operator == Binop.LT:
return f"({lhs}) < ({rhs})"
elif expr.operator == Binop.GEQ:
return f"({lhs}) <= ({rhs})"
elif expr.operator == Binop.GT:
return f"({lhs}) < ({rhs})"
elif expr.operator == Binop.EQ:
return f"({lhs}) = ({rhs})"
elif expr.operator == Binop.PLUS:
Expand All @@ -142,6 +146,9 @@ def expression_prism(expr: Expr) -> str:
return f"({lhs}) - ({rhs})"
elif expr.operator == Binop.TIMES:
return f"({lhs}) * ({rhs})"
elif expr.operator == Binop.MODULO:
return f"({lhs}) * ({rhs})"
raise PrismTranslatorException("Operator not implemented:", expr)
elif isinstance(expr, SubstExpr):
raise PrismTranslatorException(
"Substitution expression not implemented:", expr)
Expand Down

0 comments on commit c6eb165

Please sign in to comment.