@@ -242,7 +242,7 @@ scMatch sc ctxt pat term =
242242 check inst (t, n) = do
243243 -- lift $ putStrLn $ "checking: " ++ show (t, n)
244244 -- apply substitution to the term
245- t' <- lift $ scInstantiateExt sc inst t
245+ t' <- lift $ scInstantiate sc inst t
246246 -- lift $ putStrLn $ "t': " ++ show t'
247247 -- constant-fold nat operations
248248 -- ensure that it evaluates to the same number
@@ -482,7 +482,7 @@ scExpandRewriteRule sc (RewriteRule ctxt lhs rhs _ shallow ann) =
482482 -- Define function to substitute the constructor @c@
483483 -- in for the old local variable @x@.
484484 let subst = IntMap. singleton (vnIndex x) c
485- let adjust t = scInstantiateExt sc subst t
485+ let adjust t = scInstantiate sc subst t
486486 -- Build the list of types of the new context.
487487 ctxt2' <- traverse (traverse adjust) ctxt2
488488 let ctxt' = ctxt1 ++ argCtx ++ ctxt2'
@@ -525,7 +525,7 @@ scExpandRewriteRule sc (RewriteRule ctxt lhs rhs _ shallow ann) =
525525 case R. asLambda f' of
526526 Nothing -> scApply sc f' arg
527527 Just (vn, _, body) ->
528- scInstantiateExt sc (IntMap. singleton (vnIndex vn) arg) body
528+ scInstantiate sc (IntMap. singleton (vnIndex vn) arg) body
529529
530530-- | Like 'R.asPiList', but freshen all variables in the context.
531531asFreshPiList :: SharedContext -> Term -> IO ([(VarName , Term )], Term )
@@ -537,7 +537,7 @@ asFreshPiList sc t =
537537 let basename = if vnName x == " _" then " _x" else vnName x
538538 x' <- scFreshVarName sc basename
539539 var <- scVariable sc x' t1
540- t2' <- scInstantiateExt sc (IntMap. singleton (vnIndex x) var) t2
540+ t2' <- scInstantiate sc (IntMap. singleton (vnIndex x) var) t2
541541 (ctx, body) <- asFreshPiList sc t2'
542542 pure ((x', t1) : ctx, body)
543543
@@ -694,7 +694,7 @@ termWeightLt t t' =
694694-- level, if possible.
695695reduceSharedTerm :: SharedContext -> Term -> IO (Maybe Term )
696696reduceSharedTerm sc (asBetaRedex -> Just (vn, _, body, arg)) =
697- Just <$> scInstantiateExt sc (IntMap. singleton (vnIndex vn) arg) body
697+ Just <$> scInstantiate sc (IntMap. singleton (vnIndex vn) arg) body
698698reduceSharedTerm _ (asPairRedex -> Just t) = pure (Just t)
699699reduceSharedTerm _ (asRecordRedex -> Just t) = pure (Just t)
700700reduceSharedTerm sc (asNatIotaRedex -> Just (f1, f2, n)) =
@@ -769,19 +769,19 @@ rewriteSharedTerm sc ss t0 =
769769 apply rules t
770770 | permutative ->
771771 do
772- t' <- scInstantiateExt sc inst rhs
772+ t' <- scInstantiate sc inst rhs
773773 case termWeightLt t' t of
774774 True -> recordAnn annotation >> rewriteAll t' -- keep the result only if it is "smaller"
775775 False -> apply rules t
776776 | shallow ->
777777 -- do not to further rewriting to the result of a "shallow" rule
778778 do recordAnn annotation
779- scInstantiateExt sc inst rhs
779+ scInstantiate sc inst rhs
780780 | otherwise ->
781781 do -- putStrLn "REWRITING:"
782782 -- print lhs
783783 recordAnn annotation
784- rewriteAll =<< scInstantiateExt sc inst rhs
784+ rewriteAll =<< scInstantiate sc inst rhs
785785 apply (Right conv : rules) t =
786786 do -- putStrLn "REWRITING:"
787787 -- print (Net.toPat conv)
@@ -870,7 +870,7 @@ rewriteSharedTermTypeSafe sc ss t0 =
870870 Nothing -> apply rules t
871871 Just inst ->
872872 do recordAnn (annotation rule)
873- rewriteAll =<< scInstantiateExt sc inst (rhs rule)
873+ rewriteAll =<< scInstantiate sc inst (rhs rule)
874874 apply (Right conv : rules) t =
875875 case runConversion conv t of
876876 Nothing -> apply rules t
@@ -904,7 +904,7 @@ rewritingSharedContext sc ss = sc'
904904 | l == r ->
905905 do putStrLn $ " rewritingSharedContext: skipping reflexive rule: " ++ scPrettyTerm PPS. defaultOpts l
906906 apply rules t
907- | otherwise -> scInstantiateExt sc' inst r
907+ | otherwise -> scInstantiate sc' inst r
908908 apply (Right conv : rules) t =
909909 case runConversion conv t of
910910 Nothing -> apply rules t
0 commit comments