@@ -532,8 +532,8 @@ data SimplImpl ps_in ps_out where
532
532
-- > x:eq(handle) -o x:fun_perm
533
533
SImpl_ConstFunPerm ::
534
534
args ~ CtxToRList cargs =>
535
- ExprVar (FunctionHandleType cargs ret ) ->
536
- FnHandle cargs ret -> FunPerm ghosts (CtxToRList cargs ) ret -> Ident ->
535
+ ExprVar (FunctionHandleType cargs ret ) -> FnHandle cargs ret ->
536
+ FunPerm ghosts (CtxToRList cargs ) gouts ret -> Ident ->
537
537
SimplImpl (RNil :> FunctionHandleType cargs ret )
538
538
(RNil :> FunctionHandleType cargs ret )
539
539
@@ -7397,7 +7397,7 @@ proveVarAtomicImpl x ps mb_p = case mbMatch mb_p of
7397
7397
foldr (\ (i:: Int ,p ) rest ->
7398
7398
case p of
7399
7399
Perm_Fun fun_perm
7400
- | Just (Refl ,Refl ,Refl ) <- funPermEq3 fun_perm fun_perm' ->
7400
+ | Just (Refl ,Refl ,Refl , Refl ) <- funPermEq4 fun_perm fun_perm' ->
7401
7401
implCopyConjM x ps i >>> implPopM x (ValPerm_Conj ps)
7402
7402
_ -> rest)
7403
7403
(proveVarAtomicImplUnfoldOrFail x ps mb_p)
@@ -7712,8 +7712,8 @@ proveVarImplH x p mb_p = case (p, mbMatch mb_p) of
7712
7712
use implStatePermEnv >>>= \ env ->
7713
7713
case lookupFunPerm env f of
7714
7714
Just (SomeFunPerm fun_perm, ident)
7715
- | [nuMP | Just (Refl,Refl,Refl) |] <-
7716
- mbMatch $ fmap (funPermEq3 fun_perm) mb_fun_perm ->
7715
+ | [nuMP | Just (Refl,Refl,Refl, Refl ) |] <-
7716
+ mbMatch $ fmap (funPermEq4 fun_perm) mb_fun_perm ->
7717
7717
introEqCopyM x (PExpr_Fun f) >>>
7718
7718
implPopM x p >>>
7719
7719
implSimplM Proxy (SImpl_ConstFunPerm x f fun_perm ident)
@@ -7820,7 +7820,7 @@ distPermsToExDistPerms = emptyMb
7820
7820
7821
7821
-- | Substitute arguments into a function permission to get the existentially
7822
7822
-- quantified input permissions needed on the arguments
7823
- funPermExDistIns :: FunPerm ghosts args ret -> RAssign Name args ->
7823
+ funPermExDistIns :: FunPerm ghosts args gouts ret -> RAssign Name args ->
7824
7824
ExDistPerms ghosts (ghosts :++: args )
7825
7825
funPermExDistIns fun_perm args =
7826
7826
fmap (varSubst (permVarSubstOfNames args)) $ mbSeparate args $
@@ -8072,6 +8072,16 @@ proveVarsImpl ps
8072
8072
| Refl <- mbLift (fmap RL. prependRNilEq $ mbDistPermsToValuePerms ps) =
8073
8073
proveVarsImplAppend ps
8074
8074
8075
+ -- | Prove a list of existentially-quantified distinguished permissions and put
8076
+ -- those proofs onto the stack, and then return the expressions assigned to the
8077
+ -- existential variables
8078
+ proveVarsImplEVarExprs :: NuMatchingAny1 r => ExDistPerms vars as ->
8079
+ ImplM vars s r as RNil (PermExprs vars )
8080
+ proveVarsImplEVarExprs ps =
8081
+ proveVarsImpl ps >>>
8082
+ use implStateVars >>>= \ vars ->
8083
+ fmap (exprsOfSubst . completePSubst vars) getPSubst
8084
+
8075
8085
-- | Prove a list of existentially-quantified permissions and put the proofs on
8076
8086
-- the stack, similarly to 'proveVarsImpl', but ensure that the existential
8077
8087
-- variables are themselves only instanitated with variables, not arbitrary
0 commit comments