diff --git a/Lab-Exercise-3/Python/AEMgr.ipynb b/Lab-Exercise-3/Python/AEMgr.ipynb index 857a981..534f196 100755 --- a/Lab-Exercise-3/Python/AEMgr.ipynb +++ b/Lab-Exercise-3/Python/AEMgr.ipynb @@ -138,7 +138,11 @@ " \"\"\"\n", " assert isinstance(key, int), \"key is not a valid integer, the type of key is {}\".format(type(key))\n", " assert isinstance(value, AbstractValue) or isinstance(value, IntervalValue) or isinstance(value, AddressValue), \"value is not a valid AbstractValue, IntervalValue, or AddressValue object, the type of value is {}\".format(type(value))\n", - " self.state[key] = value\n", + "\n", + " if isinstance(self, AbstractValue):\n", + " self.state[key] = value\n", + " else:\n", + " self.state[key] = AbstractValue(value)\n", "\n", " def printAbstractState(self) -> None:\n", " \"\"\"\n", @@ -275,7 +279,7 @@ " print(\"-----------Var and Value-----------\")\n", " field_width = 20\n", "\n", - " for var_id, abs_val in self.state.getVarToVal():\n", + " for var_id, abs_val in self.state.state.getVarToVal():\n", " var_name = self.id_to_str.get(var_id, \"\")\n", " var_info = f\"Var{var_id} ({var_name})\"\n", " print(f\"{var_info:<{field_width}}: \", end=\"\")\n", @@ -289,7 +293,7 @@ " else:\n", " print(\"Value: ⊥\")\n", "\n", - " for addr, abs_val in self.state.getLocToVal():\n", + " for addr, abs_val in self.state.state.getLocToVal():\n", " addr_str = f\"0x{self.getVirtualAddr(addr):x}\"\n", " print(f\"{addr_str:<{field_width}}: \", end=\"\")\n", "\n",