From 2bb075e41d9b751bfb649f1385018529b112dee4 Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Wed, 6 Mar 2019 16:07:29 +0000 Subject: Extract constant propagation and related functions from monomorphisation. This shouldn't change any functionality. --- src/spec_analysis.mli | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/spec_analysis.mli') diff --git a/src/spec_analysis.mli b/src/spec_analysis.mli index f13dd596..8586ac15 100644 --- a/src/spec_analysis.mli +++ b/src/spec_analysis.mli @@ -49,6 +49,7 @@ (**************************************************************************) open Ast +open Ast_util open Util open Type_check @@ -76,3 +77,21 @@ val is_within_machine64 : typ -> nexp_range list -> triple *) (* val restrict_defs : 'a defs -> string list -> 'a defs *) val top_sort_defs : tannot defs -> tannot defs + +(** Return the set of mutable variables assigned to in the given AST. *) +val assigned_vars : 'a exp -> IdSet.t +val assigned_vars_in_fexps : 'a fexp list -> IdSet.t +val assigned_vars_in_pexp : 'a pexp -> IdSet.t +val assigned_vars_in_lexp : 'a lexp -> IdSet.t + +(** Variable bindings in patterns *) +val pat_id_is_variable : env -> id -> bool +val bindings_from_pat : tannot pat -> id list + +val equal_kids_ncs : kid -> n_constraint list -> KidSet.t +val equal_kids : env -> kid -> KidSet.t + +(** Type-level substitutions into patterns and expressions. Also attempts to + update type annotations, but not the associated environments. *) +val nexp_subst_pat : nexp KBindings.t -> tannot pat -> tannot pat +val nexp_subst_exp : nexp KBindings.t -> tannot exp -> tannot exp -- cgit v1.2.3