Advertisement
Nolrai

Operational

May 21st, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1.  
  2. inductive Program (inst) : Type -> Type :=
  3. | Ret {} : Π r,
  4. FreeM inst r
  5. | Bind : Π {a r},
  6. (a -> FreeM inst r) -> (FreeM inst a) -> (FreeM inst r)
  7. | Tag : Π {r}, inst r -> FreeM p r
  8.  
  9. abbreviation Prompt := Type -> Type -> Type
  10.  
  11. definition type_has_zero : has_zero Type₁ :=
  12. {| has_zero Type₁, zero := empty |}
  13.  
  14. definition type_has_one [instance] : has_one Type₁ :=
  15. {| has_one Type₁, one := unit |}
  16.  
  17. definition type_has_add [instance] : has_add Type :=
  18. {| has_add Type, add := sum |}
  19.  
  20. inductive StateP (S : Type₁) : Type₁ -> Type₁ -> Type₁ :=
  21. | Get : StateP S S
  22. | Set : StateP S (S -> 1)
  23.  
  24. abbreviation StateM S := FreeM (StateP S)
  25.  
  26. definition
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement