1
0
Fork 0
This repository has been archived on 2024-05-03. You can view files and clone it, but cannot push or open issues or pull requests.
unification-pfa/lib/term.mli

32 lines
561 B
OCaml
Raw Normal View History

2024-03-11 09:31:56 +01:00
(*
This module contains the syntax of terms of a minimal programming language.
*)
2024-03-14 22:23:22 +01:00
2024-03-11 09:31:56 +01:00
type binop =
2024-03-11 15:18:02 +01:00
| Plus
| Minus
| Times
| Div
[@@deriving eq, ord, show]
2024-03-11 09:31:56 +01:00
2024-03-11 15:18:02 +01:00
type projection =
| First
| Second
[@@deriving eq, ord, show]
2024-03-11 09:31:56 +01:00
(*
Every value of type Term.t is the abstract syntax tree of a program.
*)
type t =
| Var of Identifier.t
| IntConst of int
| Binop of t * binop * t
| Pair of t * t
| Proj of projection * t
| Fun of Identifier.t * t
| App of t * t
2024-03-11 15:18:02 +01:00
[@@deriving eq, ord, show]
2024-04-13 20:15:39 +02:00
(* Term to string *)
val string_of_term : t -> string