Skip to content

Commit fa7b637

Browse files
Copilotmichael-schwarzCopilot
authored
Fix signs.ml tutorial eval to handle negated constants via UnOp (#2014)
* Initial plan * Add UnOp Neg case to eval in signs.ml tutorial with TODO Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/aeab2b2b-4a0b-47d3-9d95-d35534b24533 Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com> * Specialize UnOp Neg case to Const in signs.ml eval Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/476c638e-da24-4c04-aa1d-7f391bd2a761 Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com> * Apply suggestion from @michael-schwarz * Update src/analyses/tutorials/signs.ml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com> Co-authored-by: Michael Schwarz <michael.schwarz93@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent faa65a7 commit fa7b637

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/analyses/tutorials/signs.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ struct
6060
(* This should now evaluate expressions. *)
6161
let eval (d: D.t) (exp: exp): SL.t = match exp with
6262
| Const (CInt (i, _, _)) -> SL.top () (* TODO: Fix me! *)
63+
| UnOp (Neg, Const (CInt (i, _, _)), _) -> SL.top () (* TODO: Fix me! *)
6364
| Lval (Var x, NoOffset) -> D.find x d
6465
| _ -> SL.top ()
6566

0 commit comments

Comments
 (0)