Managed Code Exception (Python) and Managed Stack Trace (Python)

We also extend our memory analysis pattern language to managed (interpreted) and native Python platforms in addition to Scala managed platform. The first analysis patterns we choose to extend are Managed Code Exception and Managed Stack Trace which are exceptions and stack traces from some virtual machine execution, not native platform exceptions and stack traces. To model it we created the following Python code:

def main():
    foo()

def foo():
    bar()

def bar():
    ref = []
    ref[0]

if __name__ == "__main__":
    main()

Its execution produces an exception and its stack trace (traceback):

Traceback (most recent call last):
  File ".\helloCrash.py", line 12, in 
    main()
  File ".\helloCrash.py", line 2, in main
    foo()
  File ".\helloCrash.py", line 5, in foo
    bar()
  File ".\helloCrash.py", line 9, in bar
    ref[0]
IndexError: list index out of range