adamc@16: (* Copyright (c) 2008, Adam Chlipala adamc@16: * All rights reserved. adamc@16: * adamc@16: * Redistribution and use in source and binary forms, with or without adamc@16: * modification, are permitted provided that the following conditions are met: adamc@16: * adamc@16: * - Redistributions of source code must retain the above copyright notice, adamc@16: * this list of conditions and the following disclaimer. adamc@16: * - Redistributions in binary form must reproduce the above copyright notice, adamc@16: * this list of conditions and the following disclaimer in the documentation adamc@16: * and/or other materials provided with the distribution. adamc@16: * - The names of contributors may not be used to endorse or promote products adamc@16: * derived from this software without specific prior written permission. adamc@16: * adamc@16: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" adamc@16: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE adamc@16: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE adamc@16: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE adamc@16: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR adamc@16: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF adamc@16: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS adamc@16: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN adamc@16: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) adamc@16: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE adamc@16: * POSSIBILITY OF SUCH DAMAGE. adamc@16: *) adamc@16: adamc@16: signature CORE_ENV = sig adamc@16: adamc@20: val liftConInCon : int -> Core.con -> Core.con adamc@193: val subConInCon : (int * Core.con) -> Core.con -> Core.con adamc@20: adamc@315: val liftConInExp : int -> Core.exp -> Core.exp adamc@315: val subConInExp : (int * Core.con) -> Core.exp -> Core.exp adamc@315: adamc@443: val liftExpInExp : int -> Core.exp -> Core.exp adamc@443: val subExpInExp : (int * Core.exp) -> Core.exp -> Core.exp adamc@443: adamc@16: type env adamc@16: adamc@16: val empty : env adamc@16: adamc@16: exception UnboundRel of int adamc@16: exception UnboundNamed of int adamc@16: adamc@626: val pushKRel : env -> string -> env adamc@626: val lookupKRel : env -> int -> string adamc@626: adamc@16: val pushCRel : env -> string -> Core.kind -> env adamc@16: val lookupCRel : env -> int -> string * Core.kind adamc@16: adamc@16: val pushCNamed : env -> string -> int -> Core.kind -> Core.con option -> env adamc@16: val lookupCNamed : env -> int -> string * Core.kind * Core.con option adamc@16: adamc@192: val pushDatatype : env -> string -> int -> string list -> (string * int * Core.con option) list -> env adamc@192: val lookupDatatype : env -> int -> string * string list * (string * int * Core.con option) list adamc@168: adamc@192: val lookupConstructor : env -> int -> string * string list * Core.con option * int adamc@177: adamc@16: val pushERel : env -> string -> Core.con -> env adamc@16: val lookupERel : env -> int -> string * Core.con adamc@16: adamc@109: val pushENamed : env -> string -> int -> Core.con -> Core.exp option -> string -> env adamc@109: val lookupENamed : env -> int -> string * Core.con * Core.exp option * string adamc@16: adamc@16: val declBinds : env -> Core.decl -> env adamc@193: val patBinds : env -> Core.pat -> env adamc@642: adamc@642: val patBindsN : Core.pat -> int adamc@1080: val patBindsL : Core.pat -> (string * Core.con) list adamc@16: adamc@16: end