Documentation

Strata.Languages.Core.InterpreterEvalSound

Core's bounded evaluator is sound for denoteEval #

On a runtime store denoting a semantic store, every value Core's bounded evaluator evalBounded commits to denotes the value of the reference evaluator Lambda.LExpr.denoteEval (BoundedEvalSoundAt), at every modeled factory whose factory meets the conditions of evaluator soundness (Lambda.Factory.EvalSoundWF) and whose short-circuit evaluators commute with re-annotating free variables (Lambda.Factory.ShortCircuitAnnotates): at every modeled factory over a well-formed factory each of whose functions is a function of Core.Factory or a user function meeting UserFuncWF, which userFuncChecked decides for monomorphic user functions; in particular at every modeled factory over Core.Factory.

Key definitions: EvalFactoryWF, fvarsAnnotatedBy, userFuncChecked. Key theorems: boundedEvalSoundAt_of_evalSoundWF, boundedEvalSoundAt_of_evalFactoryWF, evalFactoryWF_of_userFuncs, userFuncWF_of_userFuncChecked, boundedEvalSoundAt_of_userFuncs, evalFactoryWF_coreFactory, boundedEvalSoundAt_coreFactory.

Core's bounded evaluator is sound at a modeled factory F whose factory meets the conditions of evaluator soundness (Lambda.Factory.EvalSoundWF) and whose short-circuit evaluators commute with re-annotating free variables: on a runtime store denoting a semantic store σ, every value evalBounded commits to denotes the value denoteEval gives the expression on σ.

The conditions on a Core factory under which Core's bounded evaluator is sound at every model of it (boundedEvalSoundAt_of_evalFactoryWF): the factory meets the conditions of evaluator soundness (Lambda.Factory.EvalSoundWF: it and a type factory are well formed, and function bodies, at the type substitutions inlining uses and once inlined, and concrete evaluators preserve typing, operator annotations and free-variable annotations), and its short-circuit evaluators commute with re-annotating free variables (Lambda.Factory.ShortCircuitAnnotates).

Equations
Instances For

    Core's bounded evaluator is sound at every modeled factory whose factory meets EvalFactoryWF.

    Core's bounded evaluator is sound at Core's built-in factory: at every modeled factory over Core.Factory, on a runtime store denoting a semantic store, every value evalBounded commits to denotes the value denoteEval gives the expression.

    Whether every free variable of e is annotated, with the type tyMap gives it when tyMap gives it one (the decided form of Lambda.fvars_annotated_by).

    Equations
    Instances For

      Whether the function fn of the factory F is a monomorphic user function whose body, if any, meets the conditions of UserFuncWF: it has no concrete evaluator, is not a constructor and has no type arguments, and its body type checks at the output type, annotates its free variables with the types of the parameters (fvarsAnnotatedBy), and annotates its operators with instances of their types in F (opsInstantiated).

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        A function userFuncChecked accepts meets UserFuncWF: having no type arguments, it is inlined at the empty type substitution, which leaves its body unchanged.

        A well-formed factory each of whose functions is a function of Core.Factory or a user function meeting UserFuncWF meets EvalFactoryWF.

        Core's bounded evaluator is sound at program factories: at every modeled factory over a well-formed factory each of whose functions is a function of Core.Factory or a user function meeting UserFuncWF (for instance one userFuncChecked accepts), on a runtime store denoting a semantic store, every value evalBounded commits to denotes the value denoteEval gives the expression.