Commit 64ecdb42 authored by POTTIER Francois's avatar POTTIER Francois

Exchange the order of the parameters of [term].

parent 1020666b
open AlphaLib open AlphaLib
open BindingForms open BindingForms
type ('fn, 'bn) term = type ('bn, 'fn) term =
| TVar of 'fn | TVar of 'fn
| TLambda of ('bn, ('fn, 'bn) term) abs | TLambda of ('bn, ('bn, 'fn) term) abs
| TApp of ('fn, 'bn) term * ('fn, 'bn) term | TApp of ('bn, 'fn) term * ('bn, 'fn) term
[@@deriving [@@deriving
......
...@@ -11,7 +11,7 @@ type tyvar = ...@@ -11,7 +11,7 @@ type tyvar =
(* Types. *) (* Types. *)
#define TYP ('fn, 'bn) typ #define TYP ('bn, 'fn) typ
type TYP = type TYP =
| TyVar of 'fn | TyVar of 'fn
...@@ -25,7 +25,7 @@ and tevar = (string[@opaque]) ...@@ -25,7 +25,7 @@ and tevar = (string[@opaque])
(* Terms. *) (* Terms. *)
#define TERM ('fn, 'bn) term #define TERM ('bn, 'fn) term
and TERM = and TERM =
| TeVar of tevar | TeVar of tevar
......
module type INPUT = sig module type INPUT = sig
(* Suppose there is a type of terms, which is parameterized over the (* Suppose there is a type of terms, which is parameterized over the
representations of free name occurrences and binding name occurrences. *) representations of binding name occurrences and free name occurrences. *)
type ('fn, 'bn) term type ('bn, 'fn) term
(* Suppose the type of terms is equipped with the following visitors. *) (* Suppose the type of terms is equipped with the following visitors. *)
...@@ -22,21 +22,21 @@ module type INPUT = sig ...@@ -22,21 +22,21 @@ module type INPUT = sig
class virtual ['self] iter : object ('self) class virtual ['self] iter : object ('self)
method private virtual extend : 'bn -> 'env -> 'env method private virtual extend : 'bn -> 'env -> 'env
method private virtual visit_'fn : 'env -> 'fn -> _ method private virtual visit_'fn : 'env -> 'fn -> _
method visit_term : 'env -> ('fn, 'bn) term -> unit method visit_term : 'env -> ('bn, 'fn) term -> unit
end end
class virtual ['self] map : object ('self) class virtual ['self] map : object ('self)
method private virtual extend : 'bn1 -> 'env -> 'bn2 * 'env method private virtual extend : 'bn1 -> 'env -> 'bn2 * 'env
method private virtual visit_'fn : 'env -> 'fn1 -> 'fn2 method private virtual visit_'fn : 'env -> 'fn1 -> 'fn2
method visit_term : 'env -> ('fn1, 'bn1) term -> ('fn2, 'bn2) term method visit_term : 'env -> ('bn1, 'fn1) term -> ('bn2, 'fn2) term
method private visit_TVar : 'env -> 'fn1 -> ('fn2, 'bn2) term method private visit_TVar : 'env -> 'fn1 -> ('bn2, 'fn2) term
end end
class virtual ['self] endo : object ('self) class virtual ['self] endo : object ('self)
method private virtual extend : 'bn -> 'env -> 'bn * 'env method private virtual extend : 'bn -> 'env -> 'bn * 'env
method private virtual visit_'fn : 'env -> 'fn -> 'fn method private virtual visit_'fn : 'env -> 'fn -> 'fn
method visit_term : 'env -> ('fn, 'bn) term -> ('fn, 'bn) term method visit_term : 'env -> ('bn, 'fn) term -> ('bn, 'fn) term
method private visit_TVar : 'env -> ('fn, 'bn) term -> 'fn -> ('fn, 'bn) term method private visit_TVar : 'env -> ('bn, 'fn) term -> 'fn -> ('bn, 'fn) term
end end
class virtual ['self] reduce : object ('self) class virtual ['self] reduce : object ('self)
...@@ -45,13 +45,13 @@ module type INPUT = sig ...@@ -45,13 +45,13 @@ module type INPUT = sig
method private virtual zero : 'z method private virtual zero : 'z
method private virtual plus : 'z -> 'z -> 'z method private virtual plus : 'z -> 'z -> 'z
method private virtual restrict : 'bn -> 'z -> 'z method private virtual restrict : 'bn -> 'z -> 'z
method visit_term : 'env -> ('fn, 'bn) term -> 'z method visit_term : 'env -> ('bn, 'fn) term -> 'z
end end
class virtual ['self] iter2 : object ('self) class virtual ['self] iter2 : object ('self)
method private virtual extend : 'bn1 -> 'bn2 -> 'env -> 'env method private virtual extend : 'bn1 -> 'bn2 -> 'env -> 'env
method private virtual visit_'fn : 'env -> 'fn1 -> 'fn2 -> _ method private virtual visit_'fn : 'env -> 'fn1 -> 'fn2 -> _
method visit_term : 'env -> ('fn1, 'bn1) term -> ('fn2, 'bn2) term -> unit method visit_term : 'env -> ('bn1, 'fn1) term -> ('bn2, 'fn2) term -> unit
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment