private ContextElem LemmaContext(
            CFGRepr cfg,
            Term vcAssm
            )
        {
            var multiRed = IsaBoogieTerm.RedCFGMulti(
                BoogieContextIsa.CreateWithNewVarContext(
                    boogieContext,
                    new TermTuple(programAccessor.ConstsAndGlobalsDecl(), programAccessor.ParamsAndLocalsDecl())
                    ),
                programAccessor.CfgDecl(),
                IsaBoogieTerm.CFGConfigNode(new NatConst(cfg.GetUniqueIntLabel(cfg.entry)),
                                            IsaBoogieTerm.Normal(normalInitState)),
                IsaBoogieTerm.CFGConfig(finalNodeOrReturn, finalState)
                );
            var closedAssm        = EndToEndAssumptions.ClosednessAssumption(boogieContext.absValTyMap);
            var nonEmptyTypesAssm = EndToEndAssumptions.NonEmptyTypesAssumption(boogieContext.absValTyMap);
            var finterpAssm       = IsaBoogieTerm.FunInterpWf(boogieContext.absValTyMap, programAccessor.FunctionsDecl(),
                                                              boogieContext.funContext);
            var absValType = new VarType("a");
            //need to explicitly give type for normal state, otherwise Isabelle won't know that the abstract value type is the same as used in the VC
            var axiomAssm = EndToEndAssumptions.AxiomAssumption(boogieContext, programAccessor,
                                                                new TermWithExplicitType(normalInitState, IsaBoogieType.NormalStateType(absValType)));
            var presAssm =
                IsaBoogieTerm.ExprAllSat(boogieContext, normalInitState, programAccessor.PreconditionsDecl());
            var localsAssm = EndToEndAssumptions.LocalStateAssumption(boogieContext,
                                                                      IsaCommonTerms.Snd(boogieContext.varContext), normalInitState);
            var globalsAssm = EndToEndAssumptions.GlobalStateAssumption(boogieContext,
                                                                        IsaCommonTerms.Fst(boogieContext.varContext), normalInitState);
            var oldGlobalStateAssm = EndToEndAssumptions.OldGlobalStateAssumption(normalInitState);
            var binderEmptyAssm    = EndToEndAssumptions.BinderStateEmpty(normalInitState);

            return
                (ContextElem.CreateWithAssumptions(
                     new List <Term>
            {
                multiRed, vcAssm, closedAssm, nonEmptyTypesAssm, finterpAssm, axiomAssm,
                presAssm, localsAssm, globalsAssm, oldGlobalStateAssm, binderEmptyAssm
            },
                     new List <string>
            {
                redAssmName, vcAssmName, closedAssmName, nonEmptyTypesAssmName, finterpAssmName, axiomAssmName,
                preconditionsAssmName, paramsLocalsAssmName, constsGlobalsAssmName, oldGlobalAssmName,
                binderEmptyAssmName
            }
                     ));
        }
        /// <summary>The returned list in-sync with <see cref="AllAssumptionLabels" />.</summary>
        public IList <Term> AllAssumptions(
            IDictionary <Function, TermIdent> funInterpMapping,
            IDictionary <NamedDeclaration, Term> declToVCMapping,
            Term state,
            BoogieContextIsa boogieContext,
            IVariableTranslation <Variable> varTranslation
            )
        {
            var assumptions = new List <Term>();

            foreach (var obj in _assumptionLabelMap.Keys)
            {
                if (obj is Function f)
                {
                    assumptions.Add(LemmaHelper.FunctionCtxtWfAssm(f, funInterpMapping, boogieContext));
                    assumptions.Add(LemmaHelper.FunctionVcCorresAssm(f, funInterpMapping, declToVCMapping,
                                                                     boogieContext));
                }
                else if (obj is Variable v)
                {
                    assumptions.Add(LemmaHelper.LocalStateVariableAssumption(v, boogieContext.varContext, state,
                                                                             declToVCMapping, varTranslation));
                    if (!TypeUtil.IsPrimitive(v.TypedIdent.Type))
                    {
                        assumptions.Add(LemmaHelper.VariableTypeAssumption(
                                            v,
                                            declToVCMapping[v],
                                            new TypeIsaVisitor(_factory.CreateEmptyTranslation().TypeVarTranslation),
                                            boogieContext.absValTyMap));
                    }
                }
                else if (obj is SpecialAssumptionsKind kind)
                {
                    switch (kind)
                    {
                    case SpecialAssumptionsKind.TypeValClosed:
                        assumptions.Add(EndToEndAssumptions.ClosednessAssumption(boogieContext.absValTyMap));
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }
                }
            }

            return(assumptions);
        }