Advertisement
Guest User

Untitled

a guest
Apr 20th, 2022
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. /* Program 1 */
  2.  
  3. var id = function ( x : Int )
  4. {
  5. x * 1
  6. };
  7.  
  8. id(10)
  9.  
  10. --
  11.  
  12. x ∈ Γ,x:Int
  13. ----------------- TVar ------------------ TNat
  14. Γ,x:Int ⊢ x : Int Γ,x:Int ⊢ 1 : Int id : Int -> Int ∈ Γ,id : Int -> Int
  15. ------------------------------------------- TMul ------------------------------------ TVar ----------------------------
  16. Γ,x:Int ⊢ x * 1 : Int Γ,id : Int -> Int ⊢ id : Int -> Int Γ,id : Int -> Int ⊢ 10 : Int
  17. ----------------------------------------------- TFun ------------------------------------------------------------------------- TCall
  18. Γ ⊢ function ( x : Int ) { x * 1 } : Int -> Int Γ,id : Int -> Int ⊢ id(10) : Int
  19. ------------------------------------------------------------------------------------------------------------------------------------- TDecl
  20. Γ ⊢ var id = function ( x : Int ) { x * 1 }; id(10) : Int
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement