{
  "src_dir_abs_path": "/Users/samer/src/imandra/code-logician/src/codelogician/data/sample_bank_app",
  "language": "Python",
  "sketches": {
    "sketches": {}
  },
  "tasks": [
    {
      "rel_path": "currency.py",
      "src_code": "#\n#   Imandra Bank\n#   \n#   currency.py\n#\n\n\nclass Currency:\n   EUR = 1\n   USD = 2\n   GBP = 3\n   JPY = 4\n   CNY = 5\n   INR = 6\n   AUD = 7\n   CAD = 8\n   CHF = 9\n   NZD = 10\n\nclass CurrencyPairs:\n  \"\"\" CurrencyPairs class to represent a collection of currency pairs \"\"\"\n\n  def __init__ (self, pairs):    \n    \"\"\" Initialize with a dictionary of currency pairs \"\"\"\n\n    self._pairs = pairs\n\n  def convert(self, from_currency: int, to_currency: int, amount: float) -> float:\n    \"\"\" Convert an amount from one currency to another \"\"\"\n\n    if from_currency == to_currency:\n      return amount\n\n    pair_key = (from_currency.name, to_currency.name)\n    if pair_key not in self._pairs:\n      raise ValueError(f\"Currency pair {pair_key} not found\")\n\n    rate = self._pairs[pair_key]\n    return amount * rate\n\n  def __repr__(self):\n    \"\"\" String representation of the currency pairs \"\"\"\n    return \"\"\n\nif __name__ == \"__main__\":\n\n  rates = {\n    (CurrencySymbol.EUR, CurrencySymbol.USD): 1.1,\n    (CurrencySymbol.USD, CurrencySymbol.EUR): 0.9,\n    (CurrencySymbol.GBP, CurrencySymbol.USD): 1.3,\n    (CurrencySymbol.USD, CurrencySymbol.GBP): 0.77,\n    (CurrencySymbol.JPY, CurrencySymbol.USD): 0.009,\n    (CurrencySymbol.USD, CurrencySymbol.JPY): 110.0,\n    (CurrencySymbol.CNY, CurrencySymbol.USD): 0.15,\n    (CurrencySymbol.USD, CurrencySymbol.CNY): 6.5,\n    (CurrencySymbol.INR, CurrencySymbol.USD): 0.013,\n    (CurrencySymbol.USD, CurrencySymbol.INR): 75.0,\n    (CurrencySymbol.AUD, CurrencySymbol.USD): 0.7,\n    (CurrencySymbol.USD, CurrencySymbol.AUD): 1.4,\n    (CurrencySymbol.CAD, CurrencySymbol.USD): 0.8,\n    (CurrencySymbol.USD, CurrencySymbol.CAD): 1.25,\n    (CurrencySymbol.CHF, CurrencySymbol.USD): 1.05,\n    (CurrencySymbol.USD, CurrencySymbol.CHF): 0.95,\n    (CurrencySymbol.NZD, CurrencySymbol.USD): 0.65,\n    (CurrencySymbol.USD, CurrencySymbol.NZD): 1.54\n  }\n\n  pairs = CurrencyPairs(rates)\n\n  pairs.convert(CurrencySymbol.EUR, CurrencySymbol.USD, 100)  # Should return 110.0\n  pairs.convert(CurrencySymbol.USD, CurrencySymbol.EUR, 100)  # Should return 90.0\n  pairs.convert(CurrencySymbol.GBP, CurrencySymbol.USD, 100)  # Should return 130.0\n  pairs.convert(CurrencySymbol.USD, CurrencySymbol.GBP, 100)  # Should return 77.0\n  pairs.convert(CurrencySymbol.JPY, CurrencySymbol.USD, 100)  # Should return 0.9\n  pairs.convert(CurrencySymbol.USD, CurrencySymbol.JPY, 100)  # Should return 11000.0",
      "context": null,
      "dependencies": [],
      "graph_state": null,
      "language": "Python",
      "mode": "Agent",
      "gen_vgs": true,
      "gen_decomps": true,
      "gen_embeddings": true,
      "specified_commands": null,
      "task_id": "ee78c380-9d59-48d2-81cf-72f7b9ccbdfc",
      "created_at": "2025-12-03T14:22:01.185994"
    }
  ],
  "meta_cache": {
    "cache": []
  },
  "strat_id": "af39aa50",
  "curr_meta_model": {
    "src_dir_abs_path": "/Users/samer/src/imandra/code-logician/src/codelogician/data/sample_bank_app",
    "models": {
      "asset.py": {
        "rel_path": "asset.py",
        "src_code": "#\n#   Imandra Bank\n#\n#   asset.py\n#\n\nfrom currency import Currency\n\nclass AssetType:\n  \"\"\" Enum for asset types \"\"\"\n  CASH = 0\n  STOCK = 1\n  BOND = 2\n  REAL_ESTATE = 3\n  OTHER = 4\n\n  def to_string(self):\n    \"\"\" Convert the asset type to a string \"\"\"\n    return {\n      self.CASH: \"Cash\",\n      self.STOCK: \"Stock\",\n      self.BOND: \"Bond\",\n      self.REAL_ESTATE: \"Real Estate\",\n      self.OTHER: \"Other\"\n    }.get(self, \"Unknown\")\n\nclass Asset:\n  \"\"\" Asset class to represent a financial asset \"\"\"\n\n  def __init__(self, name : str, asset_type : int, value: float):\n    \"\"\" Initialize an asset with a value \"\"\"\n    if value < 0:\n      raise ValueError(\"Asset value cannot be negative\")\n    self._value = value\n    self._type = asset_type\n    self._name = name\n\n  def __repr__(self):\n    return f\"Asset(name={self._name}, value={self.value})\"\n\n  def __eq__(self, other):\n    if not isinstance(other, Asset):\n      return False\n    return self.value == other.value\n\n  def __hash__(self):\n    return hash(self.value)\n\n  def to_dict(self):\n    \"\"\" Convert the asset to a dictionary \"\"\"\n    return {\"value\": self.value}\n\n  @staticmethod\n  def from_dict(data):\n    \"\"\" Create an asset from a dictionary \"\"\"\n    return Asset(data['value'])\n\nif __name__ == \"__main__\":\n  # Example usage\n  asset = Asset(1000.0)\n  print(asset)\n\n  # Convert to dictionary\n  asset_dict = asset.to_dict()\n  print(asset_dict)\n\n  # Create from dictionary\n  new_asset = Asset.from_dict(asset_dict)\n  print(new_asset)\n",
        "src_code_last_changed": null,
        "src_language": "Python",
        "agent_state": null,
        "user_iml_edit": null,
        "iml_code_frozen": false,
        "expected_iml_on_disk": null,
        "src_code_embeddings": [],
        "iml_code_embeddings": [],
        "context": null,
        "outstanding_task_ID": null,
        "dependencies": [
          "currency.py"
        ],
        "rev_dependencies": [],
        "formalized_deps": [],
        "formalized_context": null,
        "static_frm_reasons": [
          "No_agent_state"
        ]
      },
      "transaction.py": {
        "rel_path": "transaction.py",
        "src_code": "#\n#   Imandra Bank\n#\n#   transaction.py\n#\n\nfrom currency import Currency\n\nclass Transaction:\n  \"\"\" Transaction class to represent a financial transaction \"\"\"\n  DEBIT, CREDIT = 1, 2\n\n  def __init__(self, trans_type : int, from_account : str, to_account : str, amount: float):\n    \"\"\" Initialize a transaction with type and amount \"\"\"\n\n    self._type = trans_type\n    self._from_account = from_account\n    self._to_account = to_account\n    self._amount = amount\n\n  def from_account(self):\n    \"\"\" return the 'from account' property \"\"\"\n    return self._from_account\n  \n  def to_account(self):\n    \"\"\" return the 'to account' property \"\"\"\n    return self._to_account\n\n  def __repr__(self):\n    \"\"\" \"\"\"\n    return f\"Transaction(from_account={self._from_account}, to_account={self._to_account}, amount={self._amount})\"\n\n  def __eq__(self, other):\n    if not isinstance(other, Transaction):\n      return False\n    return self.type == other.type and self.amount == other.amount\n  def __hash__(self):\n    return hash((self.type, self.amount))\n  \n  def to_dict(self):\n    \"\"\" Convert the transaction to a dictionary \"\"\"\n    return {\n      \"type\": self.type,\n      \"amount\": self.amount\n    }\n\nclass DebitTransaction(Transaction):\n  \"\"\" Debit transaction class for withdrawals \"\"\"\n  def __init__(self, from_account : str, to_account : str, amount: float):\n    \"\"\" Initialize a debit transaction with amount \"\"\"\n    super().__init__(Transaction.DEBIT, from_account, to_account, amount)\n\nclass CreditTransaction(Transaction):\n  def __init__(self, from_account : str, to_account : str, amount: float):\n    \"\"\" Initialize a credit transaction with amount \"\"\"\n    super().__init__(Transaction.CREDIT, from_account ,to_account, amount)\n\nif __name__ == \"__main__\":\n\n  # Debit transaction\n  d = DebitTransaction(\"123456789\", \"987654321\", 100.0)\n\n  # Credit transaction\n  c = CreditTransaction(\"987654321\", \"123456789\", 100.0)\n",
        "src_code_last_changed": null,
        "src_language": "Python",
        "agent_state": null,
        "user_iml_edit": null,
        "iml_code_frozen": false,
        "expected_iml_on_disk": null,
        "src_code_embeddings": [],
        "iml_code_embeddings": [],
        "context": null,
        "outstanding_task_ID": null,
        "dependencies": [
          "currency.py"
        ],
        "rev_dependencies": [],
        "formalized_deps": [],
        "formalized_context": null,
        "static_frm_reasons": [
          "No_agent_state"
        ]
      },
      "liability.py": {
        "rel_path": "liability.py",
        "src_code": "#\n#   Imandra Bank\n#\n# liability.py\n#\n\nfrom currency import Currency\n\nclass LiabilityType:\n  \"\"\" Enum for liability types \"\"\"\n  LOAN = 0\n  MORTGAGE = 1\n  CREDIT_CARD = 2\n  OTHER = 3\n\n  def to_string(self):\n    \"\"\" Convert the liability type to a string \"\"\"\n    return {\n      self.LOAN: \"Loan\",\n      self.MORTGAGE: \"Mortgage\",\n      self.CREDIT_CARD: \"Credit Card\",\n      self.OTHER: \"Other\"\n    }.get(self, \"Unknown\")\n\nclass Liability:\n  \"\"\" Liability class to represent a financial liability \"\"\"\n\n  def __init__(self, amount: float):\n    \"\"\" Initialize a liability with an amount \"\"\"\n    if amount < 0:\n      raise ValueError(\"Liability amount cannot be negative\")\n    self.amount = amount\n\n  def __repr__(self):\n    return f\"Liability(amount={self.amount})\"\n\n  def __eq__(self, other):\n    if not isinstance(other, Liability):\n      return False\n    return self.amount == other.amount\n\n  def __hash__(self):\n    return hash(self.amount)\n\n  def to_dict(self):\n    \"\"\" Convert the liability to a dictionary \"\"\"\n    return {\"amount\": self.amount}\n\n  @staticmethod\n  def from_dict(data):\n    \"\"\" Create a liability from a dictionary \"\"\"\n    return Liability(data['amount'])\n    \nif __name__ == \"__main__\":\n  \n  # Example usage\n  liability = Liability(5000.0)\n  print(liability)\n\n  # Check equality\n  liability2 = Liability(5000.0)\n  print(liability == liability2)  # Should print True\n\n  # Convert to dictionary\n  liability_dict = liability.to_dict()\n  print(liability_dict)  # Should print {'amount': 5000.0}\n\n  # Create from dictionary\n  liability_from_dict = Liability.from_dict(liability_dict)\n  print(liability_from_dict)  # Should print Liability(amount=5000.0)\n",
        "src_code_last_changed": null,
        "src_language": "Python",
        "agent_state": null,
        "user_iml_edit": null,
        "iml_code_frozen": false,
        "expected_iml_on_disk": null,
        "src_code_embeddings": [],
        "iml_code_embeddings": [],
        "context": null,
        "outstanding_task_ID": null,
        "dependencies": [
          "currency.py"
        ],
        "rev_dependencies": [],
        "formalized_deps": [],
        "formalized_context": null,
        "static_frm_reasons": [
          "No_agent_state"
        ]
      },
      "ledger.py": {
        "rel_path": "ledger.py",
        "src_code": "#\n#   Imandra Bank\n#\n#   ledger.py\n#\n\nfrom asset import Asset\nfrom liability import Liability\nfrom currency import Currency, CurrencyPairs\nfrom account import Account\n\nclass BalanceSheetReport:\n  \"\"\" Class to generate a balance sheet report from the ledger \"\"\"\n\n  def __init__(self, ledger, tgt_currency: int = Currency.USD):\n    \"\"\" Initialize the report with a ledger \"\"\"\n    self._ledger = ledger\n\n  def __repr__(self):\n    \"\"\" Get some summary statistics \"\"\"\n\n    def convert(account):\n      \"\"\" Convert the account value to the target currency \"\"\"\n      if account.currency() == Currency.USD:\n        return account.balance()\n      else:\n        return CurrencyPairs().convert(account.currency(), Currency.USD, account.balance())\n        \n    total_assets = sum(convert(asset) for asset in  self._ledger._assets)\n    total_liabilities = sum(convert(liability) for liability in self._ledger._liabilities)\n\n    # Now return the whole thing back to us...\n    return {\n      \"Total Assets\": total_assets,\n      \"Total Liabilities\": total_liabilities,\n      \"Net Assets\": total_assets - total_liabilities\n    }\n\nclass Ledger:\n  \"\"\" Represents the ledger of a bank, containing assets and liabilities \"\"\"\n\n  def __init__(self, assets = [], liabilities = []):\n    \"\"\" Initialize the ledger with empty asset and liability lists \"\"\"\n    self._assets = assets\n    self._liabilities = liabilities\n\n  def gen_report(self):\n    \"\"\" Generate a balance sheet report from the ledger \"\"\"\n    return BalanceSheetReport(self).generate()\n\n  def __repr__(self):\n    \"\"\" Return a string representation of the ledger \"\"\"\n    asset_list = \"\\n\".join(str(asset) for asset in self._assets)\n    liability_list = \"\\n\".join(str(liability) for liability in self._liabilities)\n\n    return f\"\"\"\n    Ledger:\n    Assets: \\n{asset_list}\n\n    Liabilities: \\n{liability_list}\n\"\"\"\n\nif __name__ == \"__main__\":\n  \n  # !!!! Note: from bank's perspective, customer accounts are liabilities, not assets !!!!\n  a, l = [], [] # assets and liabilities\n\n  # let's add some assets to this thing\n  l.append( Account( \"John Doe\"  , \"Savings Account\"   , Currency.USD  , Account.ASSET   , \"123456789\"   , 1000.0 ))\n  l.append( Account( \"Jane Doe\"  , \"Checking Account\"  , Currency.USD  , Account.ASSET   , \"987654321\"   , 1500.0 ))\n  l.append( Account( \"John Doe\"  , \"Savings Account\"   , Currency.USD  , Account.ASSET   , \"123456789\"   , 1000.0 ))\n  l.append( Account( \"Jane Doe\"  , \"Checking Account\"  , Currency.USD  , Account.ASSET   , \"987654321\"   , 1500.0 ))\n  l.append( Account( \"John Doe\"  , \"Savings Account\"   , Currency.USD  , Account.ASSET   , \"123456789\"   , 1000.0 ))\n  l.append( Account( \"Jane Doe\"  , \"Checking Account\"  , Currency.USD  , Account.ASSET   , \"987654321\"   , 1500.0 ))\n\n  # let's now add some liabilities to this thing\n  a.append( Account( \"Jane Doe\"  , \"Checking Account\"  , Currency.USD  , Account.ASSET   , \"987654321\"   , 1500.0 ))\n  a.append( Account( \"John Doe\"  , \"Savings Account\"   , Currency.USD  , Account.ASSET   , \"123456789\"   , 1000.0 ))\n  a.append( Account( \"Jane Doe\"  , \"Checking Account\"  , Currency.USD  , Account.ASSET   , \"987654321\"   , 1500.0 ))\n  a.append( Account( \"John Doe\"  , \"Savings Account\"   , Currency.USD  , Account.ASSET   , \"123456789\"   , 1000.0 ))\n  a.append( Account( \"Jane Doe\"  , \"Checking Account\"  , Currency.USD  , Account.ASSET   , \"987654321\"   , 1500.0 ))\n  a.append( Account( \"John Doe\"  , \"Savings Account\"   , Currency.USD  , Account.ASSET   , \"123456789\"   , 1000.0 ))\n\n  ledger = Ledger(a, l)\n\n  print(BalanceSheetReport(ledger))\n",
        "src_code_last_changed": null,
        "src_language": "Python",
        "agent_state": null,
        "user_iml_edit": null,
        "iml_code_frozen": false,
        "expected_iml_on_disk": null,
        "src_code_embeddings": [],
        "iml_code_embeddings": [],
        "context": null,
        "outstanding_task_ID": null,
        "dependencies": [
          "currency.py",
          "asset.py",
          "liability.py",
          "account.py"
        ],
        "rev_dependencies": [],
        "formalized_deps": [],
        "formalized_context": null,
        "static_frm_reasons": [
          "No_agent_state"
        ]
      },
      "bank.py": {
        "rel_path": "bank.py",
        "src_code": "#\n#   Imandra Bank\n#\n#   bank.py\n#\n\nfrom account import Account\nfrom asset import Asset\nfrom currency import Currency\nfrom ledger import Ledger\nfrom liability import Liability\nfrom transaction import Transaction, DebitTransaction, CreditTransaction\n\nclass Bank:\n  \"\"\" Bank class to manage transactions \"\"\"\n\n  def __init__(self):\n    \"\"\" Initialize the bank with an empty transaction list \"\"\"\n    self._ledger = Ledger() # balance sheet\n    self._accounts = [] # list of customer accounts\n\n  def get_transactions(self):\n    \"\"\" Get all transactions in the bank \"\"\"\n    return self._transactions\n\n  def create_account (self, customer: str, name: str, currency: int, account_type: int, account_number: str, starting_balance: float = 0.0):\n    \"\"\" Create a new account in the bank \"\"\"\n    account = Account(customer, name, currency, account_type, account_number, starting_balance)\n    self._accounts.append(account)\n    return account\n  \n  def add_account (self, acc : Account):\n    \"\"\" Add an already existing account object \"\"\"\n    self._accounts.append(acc)\n  \n  def get_account_by_id (self, acc_number):\n    \"\"\" return account if it exists that matched the ID \"\"\"\n\n    acc = next (a for a in self._accounts if a.number() == acc_number)\n\n    return acc\n\n  def add_transaction(self, t: Transaction):\n    \"\"\" Process a transaction and update the balance sheet \"\"\"\n\n    accOne = self.get_account_by_id ( t.from_account() )\n    accTwo = self.get_account_by_id ( t.to_account()   )\n\n    if accOne: accOne.apply_transaction(t)\n    if accTwo: accTwo.apply_transaction(t)\n\n  def __repr__(self):\n    \"\"\" Return a nice representation of the bank \"\"\"\n    \n    accountStr = \"\\n\".join(map (str, self._accounts))\n    bsStr = str(self._ledger)\n\n    return f\"Bank with Accounts: \\n{accountStr}\\n and Balance Sheet: \\n {bsStr}\"\n\nif __name__ == \"__main__\":\n    # Example usage\n    \n    bank = Bank()\n\n    bank.add_account ( Account( \"John Doe\"  , \"Savings Account\"   , Currency.USD  , Account.ASSET   , \"123456789\"   , 1000.0 ) )\n    bank.add_account ( Account( \"John Doe\"  , \"Savings Account\"   , Currency.USD  , Account.ASSET   , \"123456789\"   , 1000.0 ) )\n    bank.add_account ( Account( \"Jane Doe\"  , \"Checking Account\"  , Currency.USD  , Account.ASSET   , \"987654321\"   , 1500.0 ) )\n    bank.add_account ( Account( \"John Doe\"  , \"Savings Account\"   , Currency.USD  , Account.ASSET   , \"123456789\"   , 1000.0 ) )\n\n    # let's now add some transactions\n    bank.add_transaction(DebitTransaction(\"123456789\", \"987654321\", 100))\n    bank.add_transaction(CreditTransaction(\"987654321\", \"123456789\", 50))\n\n    print (bank)",
        "src_code_last_changed": null,
        "src_language": "Python",
        "agent_state": null,
        "user_iml_edit": null,
        "iml_code_frozen": false,
        "expected_iml_on_disk": null,
        "src_code_embeddings": [],
        "iml_code_embeddings": [],
        "context": null,
        "outstanding_task_ID": null,
        "dependencies": [
          "asset.py",
          "liability.py",
          "transaction.py",
          "account.py",
          "ledger.py",
          "currency.py"
        ],
        "rev_dependencies": [],
        "formalized_deps": [],
        "formalized_context": null,
        "static_frm_reasons": [
          "No_agent_state"
        ]
      },
      "currency.py": {
        "rel_path": "currency.py",
        "src_code": "#\n#   Imandra Bank\n#   \n#   currency.py\n#\n\n\nclass Currency:\n   EUR = 1\n   USD = 2\n   GBP = 3\n   JPY = 4\n   CNY = 5\n   INR = 6\n   AUD = 7\n   CAD = 8\n   CHF = 9\n   NZD = 10\n\nclass CurrencyPairs:\n  \"\"\" CurrencyPairs class to represent a collection of currency pairs \"\"\"\n\n  def __init__ (self, pairs):    \n    \"\"\" Initialize with a dictionary of currency pairs \"\"\"\n\n    self._pairs = pairs\n\n  def convert(self, from_currency: int, to_currency: int, amount: float) -> float:\n    \"\"\" Convert an amount from one currency to another \"\"\"\n\n    if from_currency == to_currency:\n      return amount\n\n    pair_key = (from_currency.name, to_currency.name)\n    if pair_key not in self._pairs:\n      raise ValueError(f\"Currency pair {pair_key} not found\")\n\n    rate = self._pairs[pair_key]\n    return amount * rate\n\n  def __repr__(self):\n    \"\"\" String representation of the currency pairs \"\"\"\n    return \"\"\n\nif __name__ == \"__main__\":\n\n  rates = {\n    (CurrencySymbol.EUR, CurrencySymbol.USD): 1.1,\n    (CurrencySymbol.USD, CurrencySymbol.EUR): 0.9,\n    (CurrencySymbol.GBP, CurrencySymbol.USD): 1.3,\n    (CurrencySymbol.USD, CurrencySymbol.GBP): 0.77,\n    (CurrencySymbol.JPY, CurrencySymbol.USD): 0.009,\n    (CurrencySymbol.USD, CurrencySymbol.JPY): 110.0,\n    (CurrencySymbol.CNY, CurrencySymbol.USD): 0.15,\n    (CurrencySymbol.USD, CurrencySymbol.CNY): 6.5,\n    (CurrencySymbol.INR, CurrencySymbol.USD): 0.013,\n    (CurrencySymbol.USD, CurrencySymbol.INR): 75.0,\n    (CurrencySymbol.AUD, CurrencySymbol.USD): 0.7,\n    (CurrencySymbol.USD, CurrencySymbol.AUD): 1.4,\n    (CurrencySymbol.CAD, CurrencySymbol.USD): 0.8,\n    (CurrencySymbol.USD, CurrencySymbol.CAD): 1.25,\n    (CurrencySymbol.CHF, CurrencySymbol.USD): 1.05,\n    (CurrencySymbol.USD, CurrencySymbol.CHF): 0.95,\n    (CurrencySymbol.NZD, CurrencySymbol.USD): 0.65,\n    (CurrencySymbol.USD, CurrencySymbol.NZD): 1.54\n  }\n\n  pairs = CurrencyPairs(rates)\n\n  pairs.convert(CurrencySymbol.EUR, CurrencySymbol.USD, 100)  # Should return 110.0\n  pairs.convert(CurrencySymbol.USD, CurrencySymbol.EUR, 100)  # Should return 90.0\n  pairs.convert(CurrencySymbol.GBP, CurrencySymbol.USD, 100)  # Should return 130.0\n  pairs.convert(CurrencySymbol.USD, CurrencySymbol.GBP, 100)  # Should return 77.0\n  pairs.convert(CurrencySymbol.JPY, CurrencySymbol.USD, 100)  # Should return 0.9\n  pairs.convert(CurrencySymbol.USD, CurrencySymbol.JPY, 100)  # Should return 11000.0",
        "src_code_last_changed": null,
        "src_language": "Python",
        "agent_state": null,
        "user_iml_edit": null,
        "iml_code_frozen": false,
        "expected_iml_on_disk": null,
        "src_code_embeddings": [],
        "iml_code_embeddings": [],
        "context": null,
        "outstanding_task_ID": "ee78c380-9d59-48d2-81cf-72f7b9ccbdfc",
        "dependencies": [],
        "rev_dependencies": [],
        "formalized_deps": [],
        "formalized_context": null,
        "static_frm_reasons": [
          "No_agent_state"
        ]
      },
      "account.py": {
        "rel_path": "account.py",
        "src_code": "#   \n#   Imandra Bank\n#\n#   account.py\n#\n\nfrom currency import Currency\nfrom transaction import DebitTransaction, CreditTransaction, Transaction\n\nclass Account:\n  \"\"\" Account class to represent a bank account \"\"\"\n\n  LIABILITY = 0\n  ASSET = 1\n\n  def __init__(self, customer: str, name: str, currency: int, account_type : int, account_number: str, starting_balance: float = 0.0):\n    \"\"\" Initialize an account with account number and balance \"\"\"\n\n    self._account_type  = account_type      # type of account (liability or asset)    \n    self._customer      = customer          # customer name\n    self._currency      = currency          # currency of the account\n    self._name          = name              # account name\n    self._number        = account_number    # account number \n    self._balance       = starting_balance  # current balance\n    self._transactions  = []                # list of transactions\n\n  def account_type (self):\n    \"\"\" Get the type of the account \"\"\"\n    return self._account_type\n\n  def customer(self):\n    \"\"\" Get the customer associated with the account \"\"\"\n    return self._customer\n  \n  def name(self):\n    \"\"\" Get the name of the account \"\"\"\n    return self._name\n\n  def number(self):\n    \"\"\" Get the account number \"\"\"\n    return self._number\n\n  def currency(self):\n    \"\"\" Get the currency of the account \"\"\"\n    return self._currency\n\n  def balance(self):\n    \"\"\" return the current balance of the account \"\"\"\n    return self._balance\n  \n  def transactions(self):\n    \"\"\" Get the list of transactions in the account \"\"\"\n    return self._transactions\n\n  def apply_transaction(self, transaction):\n    \"\"\" Add a transaction to the account \"\"\"\n\n    # Note: if the \"from_account\" is this account, then we keep the type of transaction as is\n    # if, instead, the \"to_account\" is this account, then we reverse the type of transaction\n\n    if isinstance(transaction, DebitTransaction):\n      if transaction._to_account != self._number:\n        trans_type = Transaction.CREDIT\n      else:\n        trans_type = Transaction.DEBIT\n\n    elif isinstance(transaction, CreditTransaction):\n      if transaction._to_account != self._number:\n        trans_type = Transaction.DEBIT\n      else:\n        trans_type = Transaction.CREDIT\n        \n    if trans_type == Transaction.DEBIT:\n      if self._account_type ==  Account.ASSET:\n        self._balance += transaction._amount\n      elif self._account_type == Account.LIABILITY:\n        if self._balance >= transaction._amount:\n          self._balance -= transaction._amount\n        else:\n          raise ValueError(\"Insufficient balance for debit transaction\")\n\n    elif trans_type == Transaction.CREDIT:\n      if self._account_type == Account.LIABILITY:\n        self._balance += transaction._amount\n\n      elif self._account_type == Account.ASSET:\n        if self._balance >= transaction._amount:\n          self._balance -= transaction._amount\n        else:\n          raise ValueError(\"Insufficient balance for credit transaction\")\n    \n    else:\n      raise ValueError(\"Invalid transaction type\")\n    \n    self._transactions.append(transaction)\n\n  def __repr__(self):\n      \"\"\" String representation of the account \"\"\"\n\n      list_transactions = \"\\n\".join(map(str, self._transactions))\n\n      return f\"\"\"\n      Account Details:\n      - Customer: {self.customer()}\n      - Name: {self.name()}\n      - Account Number: {self.number()}\n      - Balance: {self.balance()}\n      - Transactions: [\\n{list_transactions}\\n]\n\"\"\"\n\nif __name__ == \"__main__\":\n    \n    acc = Account(\"Denis\", \"Checking Account\", Currency.USD, Account.ASSET, \"1234567890\", 0.0)\n    print (acc)\n\n    acc.apply_transaction (DebitTransaction(\"1234567891\", \"1234567890\", 100.0))\n    print(acc)\n\n    acc.apply_transaction (CreditTransaction(\"1234567891\", \"1234567890\", 50.0))\n    print(acc)\n\n    acc.apply_transaction (DebitTransaction(\"1234567890\", \"1234567891\", 30.0))\n    print(acc)\n\n    acc.apply_transaction (CreditTransaction(\"1234567891\", \"1234567890\", 20.0))",
        "src_code_last_changed": null,
        "src_language": "Python",
        "agent_state": null,
        "user_iml_edit": null,
        "iml_code_frozen": false,
        "expected_iml_on_disk": null,
        "src_code_embeddings": [],
        "iml_code_embeddings": [],
        "context": null,
        "outstanding_task_ID": null,
        "dependencies": [
          "currency.py",
          "transaction.py"
        ],
        "rev_dependencies": [],
        "formalized_deps": [],
        "formalized_context": null,
        "static_frm_reasons": [
          "No_agent_state"
        ]
      }
    },
    "language": "Python"
  }
}
