Package hydra

Interface Variables


  • public interface Variables
    Free variable analysis, term-level substitution, and unshadowing
    • Method Detail

      • freeTypeVariablesInTerm

        static java.util.Set<Name> freeTypeVariablesInTerm​(Term term0)
        Get the set of free type variables in a term (including schema names, where they appear in type annotations). In this context, only the type schemes of let bindings can bind type variables; type lambdas do not.
      • freeTypeVariablesInTerm_allOf

        static <T0> java.util.Set<T0> freeTypeVariablesInTerm_allOf​(java.util.List<java.util.Set<T0>> sets)
      • freeVariablesInTerm

        static java.util.Set<Name> freeVariablesInTerm​(Term term)
        Find the free variables (i.e. variables not bound by a lambda or let) in a term
      • freeVariablesInTerm_dfltVars

        static <T0> java.util.Set<Name> freeVariablesInTerm_dfltVars​(java.util.function.Function<Term,​java.util.List<Term>> hydra_rewriting_subterms,
                                                                     java.util.function.Function<Term,​java.util.Set<Name>> hydra_variables_freeVariablesInTerm,
                                                                     Term term,
                                                                     T0 ignored)
      • freeVariablesInType

        static java.util.Set<Name> freeVariablesInType​(Type typ)
        Find the free variables (i.e. variables not bound by a lambda or let) in a type
      • freeVariablesInTypeOrdered

        static java.util.List<Name> freeVariablesInTypeOrdered​(Type typ)
        Find the free variables in a type in deterministic left-to-right order
      • freeVariablesInTypeScheme

        static java.util.Set<Name> freeVariablesInTypeScheme​(TypeScheme ts)
        Find free variables in a type scheme
      • freeVariablesInTypeSchemeSimple

        static java.util.Set<Name> freeVariablesInTypeSchemeSimple​(TypeScheme ts)
        Find free variables in a type scheme (simple version)
      • freeVariablesInTypeSimple

        static java.util.Set<Name> freeVariablesInTypeSimple​(Type typ)
        Same as freeVariablesInType, but ignores the binding action of lambda types
      • isFreeVariableInTerm

        static java.lang.Boolean isFreeVariableInTerm​(Name v,
                                                      Term term)
        Check whether a variable is free (not bound) in a term
      • normalizeTypeVariablesInTerm

        static Term normalizeTypeVariablesInTerm​(Term term)
        Recursively replace the type variables of let bindings with the systematic type variables t0, t1, t2, ...
      • normalizeTypeVariablesInTerm_meta

        static <T0> T0 normalizeTypeVariablesInTerm_meta​(Pair<Name,​T0> p)
      • normalizeTypeVariablesInTerm_renameConstraintKeys

        static <T0> java.util.Map<Name,​T0> normalizeTypeVariablesInTerm_renameConstraintKeys​(java.util.Map<Name,​Name> newSubst,
                                                                                                   java.util.Map<Name,​T0> constraintMap)
      • normalizeTypeVariablesInTerm_replaceName

        static <T0> T0 normalizeTypeVariablesInTerm_replaceName​(java.util.Map<T0,​T0> subst,
                                                                T0 v)
      • replaceFreeTermVariable

        static Term replaceFreeTermVariable​(Name vold,
                                            Term tnew,
                                            Term term)
        Replace a free variable in a term
      • replaceFreeTypeVariable

        static Type replaceFreeTypeVariable​(Name v,
                                            Type rep,
                                            Type typ)
        Replace free occurrences of a name in a type
      • substituteTypeVariables

        static Type substituteTypeVariables​(java.util.Map<Name,​Name> subst,
                                            Type typ)
        Substitute type variables in a type
      • substituteVariable

        static Term substituteVariable​(Name from,
                                       Name to,
                                       Term term)
        Substitute one variable for another in a term
      • substituteVariables

        static Term substituteVariables​(java.util.Map<Name,​Name> subst,
                                        Term term)
        Substitute multiple variables in a term
      • unshadowVariables

        static Term unshadowVariables​(Term term0)
        Rename all shadowed variables (both lambda parameters and let-bound variables that shadow lambda parameters) in a term.
      • unshadowVariables_freshName

        static <T0> Name unshadowVariables_freshName​(Name base,
                                                     java.lang.Integer i,
                                                     java.util.Map<Name,​T0> m)