Meaning


      foo (a){
        a++;
        foo(print(a));
      }
    

Unambiguous meaning

Denotational semantics


          foo (a){
            a++;
            foo(print(a));
          }
        


7f45 4c46 0101 0100
0200 0300 0100 0000
0000 0000 0000 0000
0000 0000 0100 0000
0080 0408 5b00 0000
0010 0000 33c0 4033
        

Operational semantics


          foo(1);
        

          foo(1);
        


          a = 1 + 1 ;
          foo(print(a));
        

          a = 1 + 1 ;
          foo(print(a));
        


          foo(print(2));
        

          foo(print(2));
        


          foo(1);
        

Observational semantics


        foo (a){
          a++;
          foo(print(a));
        }
      


./foo.exe 2
2
2
2
2
2
...
      

        foo (a){
          a++;
          foo(print(a));
        }
      

<->

a = 2

        bar (a){
          print(a);
          bar(a);
        }
      

Logic!

*convince the audience logic is the best!

HOL4


  • An LFC interactive theorem prover

We use the semantics of programming languages to prove interesting properties about them