Elm Exactly
A Standard Definition of Elm?Draft version 0.4 / Lean proofs

Lean proofs

The static semantics of the Core (Chapter 4), of modules (Chapter 5) and of programs (Chapter 9); the dynamic semantics of the Core (Chapter 6), of modules (Chapter 7), of tasks, commands, subscriptions and ports (Chapter 8) and of programs (Chapter 9); and the arithmetic, equality, order, Boolean, conversion, append and character part of APPLY are encoded in the proof assistant Lean 4 (v4.35.0), one inductive relation per judgement and one constructor per rule, 193 rules in all. A type inference is proved sound and principal for the static semantics. An evaluator is proved sound and complete for the dynamic semantics: whatever value it computes, the rules derive (evExp_sound), and every derivation is found by it. Every theorem below is checked by Lean each time the project is built, and each has a page with its statement and proof.

The evaluator is run on the test programs of this suite, translated into Lean by a program from their Elm source: 702 of the 1017 tests tagged elm-spec, with 1909 checks, of which 1909 agree with the value the test expects. 702 further theorems are generated when Lean compiles the project, one for each translated program, proving that the rules give 1907 of those checks the value the test expects.

Which tests are in Lean

The translator, definition/tools/src/Translate.elm, puts each of the 1017 tests tagged elm-spec into Lean in up to two forms. The first is the program as written, in the source syntax the book starts from; the static semantics is proved about it. The second, only for a test whose program compiles, is the reduced program, which Lean's evaluator runs to prove the test's checks.

Static semantics: is the program legal?

Lean proves 702 programs legal (a theorem legal_<project>_<Test>) and 287 not legal (refuse_<project>_<Test>), the second for the tests that expect a compile error. Each test's page names its theorem and how it is proved.

TestsStatus
702
expected to compile: proved legal

AccessorFunctionFieldInListTest, AccessorFunctionFieldTailCallTest, AccessorPlaceholderAccessorOfAFunctionFieldPassedInTailCallsTest, AccessorToLocalFuncTest, AccessorVariableTest, AliasForwardTest, AnnotatedLetRecFnResultTest, AnonymousFunctionTest, AppendTypeSplitTest, ArrayEqualityFlagsTest, AstralCharCasePatternTest, AstralCharLiteralTest, BoolAndTest, BoolOrTest, BoolShortCircuitParserIdiomTest, BoolShortCircuitTest, CapturedStagedFuncCallTest, CaseAsPatternTest, CaseBoolTest, CaseBranchSelectionTest, CaseCharManyBranchTest, CaseCharTest, CaseCtorArgPatternTest, CaseCustomType4Test, CaseCustomType4WildcardTest, CaseCustomTypeTest, CaseDeepNestTest, CaseDeeplyNestedTest, CaseDefaultTest, CaseFanOutShadowTest, CaseGuardLikeTest, CaseInLambdaTest, CaseInLetTest, CaseIntTest, CaseListConsTest, CaseListTest, CaseListThreeWayTest, CaseManyBranchesTest, CaseMaybePairTest, CaseMaybeTest, CaseMixedPatternTest, CaseMultiFieldExtractTest, CaseNestedCtorTest, CaseNestedRecordAccessTest, CaseNestedTest, CaseOrderTest, CaseResultTest, CaseReturnFunctionTest, CaseReturningLambdaTest, CaseSharedBranchTest, CaseSingleCtorBoolMultiTypeTest, CaseSingleCtorBoolTest, CaseStringEmptyPatternTest, CaseStringEscapeTest, CaseStringManyBranchTest, CaseStringTest, CaseTreeTest, CaseTripleTest, CaseTupleLiteralTest, CaseTupleTest, CaseUnicodeCharTest, CharAstralClosureCaptureTest, CharAstralCustomFieldTest, CharAstralRecordFieldTest, CharAstralTupleTest, CharCaptureEscapedTailDefTest, CharCasePredicateTest, CharLiteralPatternMatchMinimalTest, CharLiteralPatternMatchVariousTest, CharUnicodeTest, ClosureCapture01Test, ClosureCapture02Test, ClosureCapture03Test, ClosureCapture04Test, ClosureCapture05Test, ClosureCapture06Test, ClosureCaptureBoolTest, ClosureCaptureRecordTest, ClosureCaptureTupleTest, ClosureDifferentClosuresPerIfBranchInsideACaseTest, CombinatorBComposeTest, CombinatorBSumMapTest, CombinatorCConsTest, CombinatorCFlipTest, CombinatorIIdentityTest, CombinatorListStringTest, CombinatorPLengthsTest, CombinatorRefIdentityBugTest, CombinatorSFeedTest, CombinatorSPalindromeTest, CombinatorSpCombineTest, CombinatorSpMulTest, CombinatorStdlibTCombinatorPipeListIntoComposedOpsTest, CombinatorTPipeTest, CombinatorTThrushTest, CombinatorTest, CombinatorWConcatTest, CombinatorWDupTest, CompilerIssue1766LetMutualRecursionMismatchTest, CompilerIssue1793ComparableTupleLetCrashTest, CompilerIssue1813TcoClosureCapturesMutatedArgTest, CompilerIssue1858AnnotatedPolymorphicRecursionTest, CompilerIssue1890RecordUpdateMutualRecursionCrashTest, CompilerIssue1916PhantomExtensibleAliasCrashTest, CompilerIssue1964AnnotatedPolymorphicRecursionWrapperTest, CompilerIssue2017TcoContinuationShadowedTest, CompilerIssue2019AliasOfTypeVariableTest, CompilerIssue2057CallSiteChangesInferredTypeTest, CompilerIssue2119MutualRecursionUnannotatedTest, CompilerIssue2207MutualRecursionSecondFunctionTest, CompilerIssue2221TcoContinuationTest, CompilerIssue2252IdentityAliasTest, CompilerIssue2268TcoClosureCaptureTest, CompilerIssue2298IdentityAliasResultTest, CoreIssue1141UnusedPortCallBreaksSubscriptionTest, CoreIssue988NanContainerSelfEqualityTest, CovEtaDebugLogTest, CovForeignTypesTest, CovLambdaBoundaryCaseBoundaryInARecursiveValueTest, CovLambdaBoundaryCaseBoundaryUnderAFunctionAliasTest, CovLambdaSetFunctionsDestructuredFromTuplesAndRecordsTest, CovLambdaSetFunctionsInRecordsTuplesAndMaybeTest, CovPatternSplitTupleAndConstructorParametersMatchedByCaseTest, CovPortIncomingArrayTest, CovPortIncomingJSONValueTest, CovPortIncomingTripleTest, CovPortIncomingUnitTest, CovPortOutgoingJSONValueTest, CovPortOutgoingUnitTest, CovTailRecPairParameterPassedUnchangedLetBoundAndRebuiltTest, CovTailRecPairParametersSwappedAndALoopReturningALambdaTest, CovTailRecSplitATripleParameterTest, CustomTypeFuncFieldTest, CustomTypeMultiFieldTest, CustomTypeNestedTest, CustomTypePatternTest, DebugLogLambdaBoundaryTest, DebugLogRecordTupleFieldTest, DebugNumberAtFloatTest, DecisionTreeAdvancedDeepNestingWithFallbackTest, DeepEqualityTest, DeepNestStressTest, DestructCaptureTest, DictMapStagedCaptureTest, EdgeCaseAllDestructPatternsTest, EitherTypeTest, EmbeddedEmptyStringCaptureTest, EmbeddedMixedConstantsTest, EmbeddedNilCaptureTest, EmbeddedNilInCustomTypeTest, EmbeddedNilRecursiveTest, EmbeddedNothingCallbackTest, EmbeddedNothingCaptureTest, EmbeddedNothingInCustomTypeTest, EmbeddedNothingInRecordTest, EmbeddedNothingInTupleTest, EmbeddedNothingMapTest, EmbeddedNothingPolymorphicTest, EmbeddedNothingRecursiveTest, EmbeddedReturnNilTest, EmbeddedReturnNothingTest, EmbeddedUnitCaptureTest, EntryMainOfRootModuleTest, EqualityStringChainCaseTest, ErasedListSpecializationTest, EscapeCustomCaseScrutineeTest, EscapeTopLevelTupleTest, EtaExpandStateFunctionSequenceTest, EtaExpandStateTest, File, FlagsRecordTest, FlipFunctionTest, FloatEdgeTest, FunctionAccumulatorFunctionLookupTest, FunctionBasicTest, FunctionChainedPartialApplicationTest, FunctionCompappendWithStringTest, FunctionMultiArgTest, FunctionUnannotatedCompappendTest, FunctionValueChoiceTest, FunctionValuesChosenByIfCaseAndTupleTest, HOParamApplyTwoTest, HelloTest, HeteroClosureIntFloatTest, HigherOrderFilterLikeFunctionTest, HigherOrderFunctionChosenByIfTest, HigherOrderFunctionFactoryTest, HigherOrderReturnLambdaBasedOnConditionTest, HigherOrderTest, HigherOrderTripleNestedFunctionTest, HoleyAliasTwoParamsTest, ImportClosedTypeOpenItemTest, ImportExposingAllTest, ImportExposingItemsTest, ImportOperatorItemTest, ImportResolutionQualifiedImportedFunctionTest, ImportTypeByNameLaterReplacesTest, IndirectCallFloatTest, InfixAssocLeftArithTest, InfixAssocPipesTest, InfixAssocRightPowTest, InfixIfExtendsRightTest, InfixLastOperandAnyExprTest, InfixNegatedOperandTest, InfixNonAssocSeparatedLegalTest, InfixPrecAddOverConsTest, InfixPrecAndOverOrTest, InfixPrecAppendOverEqTest, InfixPrecApplicationFirstTest, InfixPrecCompareOverAndTest, InfixPrecComposeOverPipeTest, InfixPrecMulOverAddTest, InfixPrecOrOverPipeTest, InfixPrecPowOverMulTest, InlineDupLetNamesTest, JoinpointABI23Majority3FlatTest, LambdaBoundaryCaptureTest, LambdaCaseBoundaryTest, LambdaLetBoundaryTest, LambdaPatternArgTest, LargeDispatchCaseTest, LetBasicTest, LetBoundLambdaCallTest, LetDestructAliasTest, LetDestructFuncTupleTest, LetDestructNestedSingleConstructorNumberTest, LetDestructRecordTest, LetDestructTupleNestedTest, LetDestructuringTest, LetMultiFuncTest, LetMultipleTest, LetMutualRecursionBetweenLocalsTest, LetNestedTest, LetNumberAndThenTest, LetNumberApplyToTest, LetNumberAsPatternTest, LetNumberBoxedSilentMiscompileTest, LetNumberCaseLetTest, LetNumberCaseTuple3Test, LetNumberClosureInRecordTest, LetNumberContainerDualTest, LetNumberCustomTriple3Test, LetNumberCustomTypeTest, LetNumberDeepNestRecordTest, LetNumberDestructureTest, LetNumberDualUseTest, LetNumberFloatArithCrashTest, LetNumberFoldrTest, LetNumberFracRecordTest, LetNumberIfBranchTest, LetNumberIndirectCaptureTest, LetNumberIndirectDualTest, LetNumberIndirectFoldlTest, LetNumberIndirectIdentityTest, LetNumberIndirectTopFnTest, LetNumberLetInLambdaTest, LetNumberListCaseTest, LetNumberListConsHeadTest, LetNumberListFixedTest, LetNumberListOfClosuresTest, LetNumberListOfMaybeTest, LetNumberListOfRecordsTest, LetNumberLocalMap2Test, LetNumberLogBaseTest, LetNumberMaybeCaseDirectTest, LetNumberMaybeChainTest, LetNumberMixedTupleSlotTest, LetNumberMulFnTest, LetNumberNegateTest, LetNumberNestedCustomTest, LetNumberNestedLetTest, LetNumberNestedTupleTest, LetNumberRecordDestructureTest, LetNumberRecordMultiFieldTest, LetNumberRecordToFnTest, LetNumberResultMapTest, LetNumberScaleFnTest, LetNumberSumMapTest, LetNumberTupleBothTest, LetNumberTupleRecordNestTest, LetNumberTupleSecondTest, LetNumberTupleToFnTest, LetNumberUnionBranchTest, LetNumberWildcardSlotTest, LetRecClosureTest, LetRecMultiArgTest, LetSeparatedStagingTest, LetValueBindingTest, ListConsCharTest, ListConsFloatTest, ListConsIntTest, ListConsTest, ListIndexedMapTest, ListLiteralDebugLogKindTest, ListLiteralTest, LocalMultiNonTailRecTest, LocalRecCaptureBoolTest, LocalRecCaptureKindsTest, LocalRecCaptureSplitParamTest, LocalTailRecSimpleTest, LssGapBodyTieAnnoAB, LssGapCtorAsValue, LssGapCtorInList, LssGapCtorScale, LssGapCustomTypeFn, LssGapNoDecls, LssGapRecordFnNoAlias, LssGapTupleFn, MaybeJustTest, MaybeNothingTest, MaybePatternMatchTest, MinimalAsPatternTest, MinimalCaseNextRuleTest, MinimalCaseTest, MinimalCmdMapTest, MinimalConsPatternFailTest, MinimalConsPatternTest, MinimalConstantPatternTest, MinimalConstantTest, MinimalConstructedPatternFailTest, MinimalConstructedPatternTest, MinimalConstructorPatternFailTest, MinimalConstructorPatternTest, MinimalCustomTypeTest, MinimalDestructuringTest, MinimalEmptyListTest, MinimalExposingAliasTest, MinimalExposingAllTest, MinimalExposingOpenTest, MinimalImportValueTest, MinimalKillTest, MinimalLetRecursionTest, MinimalLetTest, MinimalNilPatternFailTest, MinimalNilPatternTest, MinimalParenthesesTest, MinimalParenthesisedPatternTest, MinimalParenthesisedTypeTest, MinimalPipeArrayTest, MinimalPipeFalseTest, MinimalPipeFloatTest, MinimalPipeIntTest, MinimalPipeJustTest, MinimalPipeListTest, MinimalPipeNothingTest, MinimalPipeRecordTest, MinimalPipeStringTest, MinimalPipeTrueTest, MinimalPipeTupleTest, MinimalPipeUnitTest, MinimalPipeValueTest, MinimalPortSubscriptionTest, MinimalRecordAliasConstructorTest, MinimalRecordPatternTest, MinimalRecordTest, MinimalRecordTypeTest, MinimalRecordUpdateTest, MinimalRowVariableTest, MinimalSleepTest, MinimalSpawnTest, MinimalTaskAndThenFailTest, MinimalTaskAndThenInnerTest, MinimalTaskAndThenTest, MinimalTaskOnErrorInnerTest, MinimalTaskOnErrorSucceedTest, MinimalTaskOnErrorTest, MinimalTaskPerformTest, MinimalTuplePatternTest, MinimalTypeAliasTest, MinimalTypeVariableTest, MinimalUnitPatternTest, MinimalUnitTest, MinimalVariableTest, MultiLocalTailRecTest, MutualLetRecClosuresTest, MutualLetRecManyCapturesTest, MutualLetRecNestedTest, MutualRecursionTest, MutualRecursionThreeWayTest, NestedCaseReturnTest, NoImportsTest, NonAsciiIdentifierTest, NonZeroArityRecursionTest, NumberDestructFieldTest, NumberGenericAppCustom, NumberGenericAppList, NumberGenericAppMaybe, NumberGenericAppTuple, OutgoingPortTuple3KeepsRunningTest, OutgoingPortTuple3Test, PapEtaCtorProbe, ParenthesesTest, PartialAppCaptureTypesTest, PartialAppChainTest, PartialApplicationTest, PhantomTypeVarTest, PolyApplyLambdaTest, PolyChainCallTest, PolyChainDictLikeInsertChained5TimesWithTupleKeysConcreteCallerTest, PolyChainFoldlLikeCalled8TimesOverTupleKeyedStructureTest, PolyEscapePolymorphicFunctionExtractedFromTupleTest, PolyEscapeRecordTest, PolyLetConstTest, PolyLetTailRecTwoTypesTest, PolySpecializeRecursiveTest, PolyStepLoopFloatResultTest, PolyStepLoopFoldMIntTest, PolyTailRecReverseTest, PortAliasEchoTest, PortEchoArrayStringFlagsTest, PortEchoBoolTest, PortEchoFloatTest, PortEchoJsonValueTest, PortEchoListIntTest, PortEchoMaybeIntTest, PortEchoNestedTest, PortEchoStringTest, PortEchoTest, PortEchoTuple2Test, PortEchoTuple3Test, PortEchoUnitTest, PortEncodingDecodeFloatTest, PortEncodingDecodeListIntTest, PortEncodingDecodeMaybeIntTest, PortEncodingDecodeTuple2Test, PortEncodingEncodeBoolTest, PortEncodingEncodeFloatTest, PortEncodingEncodeMaybeRecordTest, PortEncodingEncodeTuple2Test, PortEncodingPortWithArrayTest, PortIncomingRejectTest, PortPipeBytesRejectTest, PortPipeBytesTest, PortPipeListArrayTest, PortPipeMaybeTest, PortPipeRecordTest, PortPipeRejectTest, PortPipeScalarsTest, PortPipeTupleTest, PortPipeValueRejectsBytesTest, PortPipeValueTest, PureMutualRecursiveValueTest, PureRecursiveValueThunkTest, RecordAccessTest, RecordAccessorFunctionCaseTest, RecordAccessorFunctionTest, RecordChainedUpdateTest, RecordChainedUpdatesTest, RecordCreateTest, RecordNarrow01CapturesNonEmptyTest, RecordNarrow02CapturesNothingTest, RecordNarrow03FullAnnotationTest, RecordNarrow04SingleFieldTest, RecordNarrow05NoNestingTest, RecordNarrow06RowPolyAnnotationTest, RecordNarrow08NoDestructureTest, RecordNarrow09DirectCallTest, RecordNarrow10TripleNestingTest, RecordNestedAccessTest, RecordOpenNarrowFieldIndexTest, RecordRowsTest, RecordUpdatePolyFieldTest, RecordUpdateTest, RecordWithFunctionsTest, RecursiveFactorialTest, RecursiveFibonacciTest, RecursiveListLengthTest, RecursiveMutualTypeTest, RecursiveTopLevelLambdaTest, RecursiveTreeTest, RecursiveTypeInRecordTest, ResultErrTest, ResultOkTest, RowVariableAloneTest, SingleCtorPairBoolCharTest, SingleCtorPairBoolFloatTest, SingleCtorPairBoolIntBidiTest, SingleCtorPairCharFloatTest, SingleCtorPairCharIntTest, SingleCtorPairFloatBoolTest, SingleCtorPairIntFloatTest, SingleCtorPairStringBoolTest, SingleCtorPairStringIntTest, SingleCtorPairUnitIntTest, StandardA56PrefixAndOrTest, StandardA72AbsentFlagsTest, StandardA82MainInImportedModuleTest, StandardA88PortNegativeZeroTest, StandardA88PortNonFiniteTest, StandardA92BytesPortDeclarationTest, StandardA93MutualNumberDefaultTest, StandardA97NeverErrBranchTest, StandardA97SelfOnlyTypeTest, StandardA98TypeBeforeAliasTest, StandardA99RecordPatternAsTest, StandardA99RecordPatternBothTest, StandardA99RecordPatternDependentTest, StandardA99RecordPatternFloatTest, StandardA99RecordPatternFunctionTest, StandardA99RecordPatternInTopCopyTest, StandardA99RecordPatternInTupleTest, StandardA99RecordPatternIntTest, StandardA99RecordPatternLambdaTest, StandardA99RecordPatternSharedVariableTest, StandardA99RecordPatternTwoVariablesTest, StandardApplicationStrictTest, StandardCoreEvaluationExamplesTest, StandardLetStrictTest, StringCasePatternCommaTest, StringCreationMatrixTest, StringEscapeCrTest, StringEscapesTest, StringLiteralTest, StringMagicPrefixTest, TailLoopMutualRecMutualRecursionInsideATailLoopTest, TailRecBoolCarryTest, TailRecCaseDestructTest, TailRecCaseMultiBranchTypesTest, TailRecClosureAccTest, TailRecCustomCaseTest, TailRecDeciderSearchTest, TailRecDecoderLoopTest, TailRecFoldlCaseTest, TailRecManyBranchStringTest, TailRecMultiCaseWhileTest, TailRecNestedCaseTest, TailRecNestedStringCaseTest, TailRecTypeTraversalTest, TailRecursiveSumTest, TopLevelNameReplacesImportTest, TupleCharFieldTest, TuplePairTest, TupleTripleTest, TypeAliasCtorTest, TypeClassConstraintTest, UnreachableModuleTest, UserBoolNamedCtorTest, WideClosureSat26Test, WideCtorField24Test, WideCtorMixedTest, WideRecord33Test, WideRecord40Test, WideRecordDecoder26Test, WideRecordDecoder30Test, WideRecordDecoder70Test, WideRecordPatternTest, WrapperUnionFieldTest, BasicsClampTest, BasicsIdentityTest, BasicsIsNaNTest, BasicsModByTest, BoolNotTest, BoolXorTest, CeilingToIntTest, CharAstralCodeTest, CharFromCodeTest, CharToCodeTest, CharToCodeThroughFunctionTest, CmdMapComposeTest, ComparableMinMaxTest, CompareCharCaptureTest, CompareCharTest, CompareCustomWithEmptyListFieldTest, CompareEmptyListTest, CompareEmptyStringTest, CompareFloatCaptureTest, CompareFloatTest, CompareIntCaptureTest, CompareIntTest, CompareNestedEmptyListTest, CompareRecordWithEmptyListFieldTest, CompareStringTest, CompareTupleWithEmptyListNestedTest, CompareTupleWithEmptyListTest, CompareTupleWithEmptyStringTest, CompilerIssue2362NanTupleEqualityTest, CompositionTest, ContainerCompareCharTest, ContainerCompareIntTest, ContainerEqualityCharTest, ContainerEqualityCustomFloatTest, ContainerEqualityFloatTest, ContainerEqualityIntTest, ContainerEqualityRecordFloatTest, ContainerEqualityStringTest, ControlFlowBooleanWithNotTest, CoreIssue1050NanGreaterThanNanTest, CoreIssue1080ClampNanTest, CoreIssue1110PortDeclarationOrderTest, CoreIssue1115NanEqualsLiteralZeroTest, CoreIssue1150CharToCodeLoneSurrogateTest, CoreIssue1154PortSubscribedWithCmdTest, CoreIssue955KillProcessTwiceTest, CoreIssue960PowNegativeExponentIntTest, CoreIssue988NanEqualityReferenceTest, EqBoxedFastPathTest, EqualityBoolCaseTest, EqualityBoolContainerTest, EqualityBoolIfTest, EqualityBoolMaybeTest, EqualityBoolPapTest, EqualityBoolRecordTest, EqualityBoolTest, EqualityBoolVarTest, EqualityOtherConstantsTest, EqualityTest, FloatAbsTest, FloatAddTest, FloatCeilingTest, FloatCompareTest, FloatDivTest, FloatFloorTest, FloatInfinityTest, FloatMathAcosTest, FloatMathAsinTest, FloatMathAtan2Test, FloatMathAtanTest, FloatMathBasicsETest, FloatMathFloatLessThanTest, FloatMathIsNaNTest, FloatMathSin2PlusCos21Test, FloatMathTanTest, FloatMinMaxTest, FloatMulTest, FloatNaNTest, FloatNegateTest, FloatNegativeZeroTest, FloatPowTest, FloatRoundTest, FloatSqrtTest, FloatSubTest, FloatTruncateTest, FloorToIntTest, IntAbsTest, IntAddTest, IntCompareTest, IntDivByZeroTest, IntDivTest, IntMinMaxTest, IntModByTest, IntMulTest, IntNegateTest, IntPowTest, IntRemainderByTest, IntSubTest, ListAppendTest, ListConcatTest, NotEqualBoolCaseTest, NotEqualBoolIfTest, NotEqualBoolMaybeTest, NotEqualBoolPapTest, NotEqualBoolRecordTest, NotEqualBoolTest, NotEqualBoolVarTest, OrderingEmptyListPapTest, OrderingEmptyListTest, OrderingEmptyStringPapTest, OrderingEmptyStringTest, OrderingMixedCaptureTest, OrderingTupleWithEmptyListTest, OrderingTupleWithEmptyStringTest, PipelineTest, ProcessPrimitiveOutcomeTest, ProcessSpawnKillHalfTest, ProcessSpawnRecursiveTest, ProcessSpawnedFailureEndsTest, ProcessYieldThrashingTest, RoundToIntTest, StandardA40IntOverflowTest, StandardA41IntDivisionWideTest, StandardA42ModByZeroTest, StandardA42RemainderByZeroTest, StandardA42ZeroDivisorTest, StandardA43PowNegativeTest, StandardA44RoundNonFiniteTest, StandardA44TruncateWideTest, StandardA45IntNegativeZeroTest, StandardA46CompareNanTest, StandardA48MinMaxNanTest, StandardA49ClampTest, StandardA51FunctionEqualityTest, StandardA53CharOrderTest, StandardA53StringOrderTest, StandardA65PowOneTest, StandardA81SleepBeyond32BitsTest, StringConcatContentTest, StringConcatTest, TaskAttemptErrorTest, TaskOnErrorCascadeTest, TaskOnErrorInnerTest, TaskOnErrorSucceedTest, TaskPerformValueTest, TaskSucceedAsArgTest, TimerEffectTest, ToFloatTest, TruncateToIntTest, UtilsEqualityCaptureCharTest, UtilsEqualityCaptureFloatTest, UtilsEqualityCaptureIntTest, UtilsOrderingCaptureCharTest, UtilsOrderingCaptureFloatTest, UtilsOrderingCaptureIntTest

287
expected to be rejected: proved not legal

AliasProblemExtensibleRecordUnitTupleAndFunctionTest, AliasProblemQualifiedTypeTest, AliasProblemRecursiveAliasWithCommentedParensTest, AliasUnboundVariableTest, AliasUnusedParameterTest, BadMainRecursiveMainTest, BadMainRecursiveUnannotatedMainTest, BadMainTypeAliasMainTest, BadMainTypeFunctionMainTest, BadMainTypeRecordMainTest, BadMainTypeThreeArgumentTypeMainTest, BadMainTypeTypeVariableMainTest, BadMainTypeUnitMainTest, CaseCharEscapedDuplicateTest, CompilerIssue1491PhantomTupleUnsoundTest, CompilerIssue1550RecordExtensionDuplicateFieldTest, CompilerIssue1639LetAnnotationTypeVarCrashTest, CompilerIssue1669InfiniteTypeArrayGetSetHangTest, CompilerIssue1691ContradictoryExtensibleRecordHangTest, CompilerIssue1700InfiniteTypeFoldrLambdaHangTest, CompilerIssue1748DestructureMissingFieldCrashTest, CompilerIssue1785ExtensibleAliasOfUnitTest, CompilerIssue1789RankCrashMissingJustTest, CompilerIssue1839RigidLetAnnotationCrashTest, CompilerIssue1866PhantomExtensibleRecordHangTest, CompilerIssue1896ExtendCustomTypeCrashTest, CompilerIssue1951OpenRecordLetCrashTest, CompilerIssue1952ExtendIntCrashTest, CompilerIssue1974RankCrashWrongAnnotationTest, CompilerIssue1975LetOrderCrashTest, CompilerIssue2001RankCrashParametricLetAnnotationTest, CompilerIssue2006IndexOutOfBoundsMaybeWithDefaultTest, CompilerIssue2013RankCrashLambdaLetAnnotationTest, CompilerIssue2014RankCrashIdentityLetAnnotationTest, CompilerIssue2027IncompatibleExtensibleRecordsHangTest, CompilerIssue2036LensRecordUpdateHangTest, CompilerIssue2064ExtendStringNotEnoughBytesTest, CompilerIssue2066RankCrashNumberFloatTest, CompilerIssue2072ExtendUnitInResultCrashTest, CompilerIssue2077RankCrashExtensibleLetAnnotationTest, CompilerIssue2083ExtendCustomTypeFieldAccessCrashTest, CompilerIssue2097ExtensibleUnitArgCrashTest, CompilerIssue2100LetAnnotationRank2CrashTest, CompilerIssue2105ExtensibleFoldlCrashTest, CompilerIssue2106FoldlExtensibleRecordHangTest, CompilerIssue2108IfBranchExtensibleRecordHangTest, CompilerIssue2112CaseBranchInfiniteTypeHangTest, CompilerIssue2146RoseLambdaPatternCrashTest, CompilerIssue2148RecordUpdateFoldrCrashTest, CompilerIssue2153RecursiveCallWrongArgCrashTest, CompilerIssue2176ExtensibleUnitAliasCrashTest, CompilerIssue2182ExtensibleFunctionAliasCrashTest, CompilerIssue2184LetRecursionTooManyArgsCrashTest, CompilerIssue2200ConstrainedExtensibleErrorCrashTest, CompilerIssue2206RecordUpdateLetCrashTest, CompilerIssue2214LensSetterArgumentOrderHangTest, CompilerIssue2241FoldMapInfiniteTypeHangTest, CompilerIssue2274MutualRecursionTransmuteTest, CompilerIssue2295LambdaLetAnnotationCrashTest, CompilerIssue2296LetAnnotationFreeVarCrashTest, CompilerIssue2301InnerSkolemOuterVarCrashTest, CompilerIssue2338LambdaLetAnnotationTupleCrashTest, CustomTypeUnboundRowVariableTest, CustomTypeUnboundVariableTest, CyclicDefinitionATopLevelValueDefinedByItselfTest, CyclicValueALetValueDefinedByItselfTest, HeaderExposesAliasOpenTest, HeaderExposesConstructorByNameTest, HeaderExposesOperatorTest, HeaderExposesTwiceTest, HeaderExposesTypeTwiceTest, HeaderExposesUndeclaredValueTest, ImportAliasOpenItemTest, ImportClosedTypeConstructorTest, ImportCycleTest, ImportUnexposedValueTest, ImportUnknownOperatorTest, ImportedModuleTypeErrorTest, InfiniteTypeSelfAppliedArgumentOnBothSidesTest, InfixAssocRightConsAppendTest, LetCycleThroughLambdaArgumentTest, LetCycleThroughRecordLambdaTest, MissingPatternsAMissingListLengthTest, MissingPatternsAMissingTupleShapeTest, NameClashARecordFieldGivenTwiceTest, NameClashTwoArgumentsOfOneNameTest, NameClashTwoLetBindingsOfOneNameTest, NamingErrorAnUnknownVariableTest, PortProblemCharPayloadTest, QualifiedTypeNotExposedTest, RedundantPatternABranchAfterAWildcardTest, ShadowingAnArgumentShadowingATopLevelValueTest, ShadowingShadowingInLambdaTest, StandardA84DuplicatePortNameTest, StandardA91BasicsAliasTest, StandardA96NumberFlagsTest, StandardA97MaybeNeverMissingJustTest, StandardA98TypeBeforeAliasStringMismatchTest, TooFewArgsAConstructorPatternWithTooFewArgumentsTest, TooManyArgsAConstructorPatternWithTooManyArgumentsTest, TooManyArgsTooManyArgumentsToAConstructorTest, TooManyArgsTooManyArgumentsToAFunctionTest, TooManyArgsTooManyArgumentsToALambdaTest, TooManyArgsTooManyArgumentsToALiteralTest, TooManyArgsTooManyArgumentsToALocalTest, TooManyArgsTooManyArgumentsToANullaryConstructorTest, TooManyArgsTooManyArgumentsToAnOperatorTest, TopLevelConstructorTwiceTest, TopLevelPortAndValueSameNameTest, TopLevelRecordAliasConstructorClashTest, TopLevelTypeAndAliasSameNameTest, TopLevelValueTwiceTest, TypeConstructorTooFewArgsTest, TypeMismatchAccessOnANumberTest, TypeMismatchAccessOnAnEmptyRecordTest, TypeMismatchAccessorUnderIntTest, TypeMismatchAliasNamedLikeAnImportedTypeTest, TypeMismatchAliasWhereARecordTest, TypeMismatchAliasedRecordFieldOfTheWrongTypeTest, TypeMismatchAppendableAgainstATupleTest, TypeMismatchArgumentOfAFixedConstructorPatternTest, TypeMismatchArgumentToAConstructorTest, TypeMismatchArgumentToAnOperatorFunctionTest, TypeMismatchBoolLeftOfAppendTest, TypeMismatchBoolLeftOfMinusTest, TypeMismatchBoolLeftOfPowerTest, TypeMismatchBoolLeftOfTimesTest, TypeMismatchBoolPatternTest, TypeMismatchBoolRightOfAppendWithAStringTest, TypeMismatchBoolRightOfPlusTest, TypeMismatchBoolsComparedTest, TypeMismatchCaseAsAnArgumentTest, TypeMismatchCharUnderIntTest, TypeMismatchClosedRecordWhereExtensibleTest, TypeMismatchCompappendAgainstARigidVarTest, TypeMismatchCompappendAgainstATupleTest, TypeMismatchCompappendListEntryWithABoolTest, TypeMismatchComparableAgainstATupleTest, TypeMismatchComposedWithANumberTest, TypeMismatchConsHeadAgainstAConsTailTest, TypeMismatchConsedOntoABoolTest, TypeMismatchConsedOntoAMaybeTest, TypeMismatchConstructorPatternTest, TypeMismatchDestructureTest, TypeMismatchDifferentlyNamedComparableVarsTest, TypeMismatchDifferentlyNamedFlexVarsTest, TypeMismatchExtensibleRecordGivenAClosedOneTest, TypeMismatchExtensibleRecordMissingAFieldTest, TypeMismatchFieldAccessUnderIntTest, TypeMismatchFieldTypoTest, TypeMismatchFlexibleRecordWhereClosedAfterAMismatchTest, TypeMismatchFlexibleRecordWithAnExtraFieldWhereClosedTest, TypeMismatchFloatComparedForEqualityTest, TypeMismatchFloatLeftOfAppendTest, TypeMismatchFloatLeftOfIntDivideTest, TypeMismatchFloatRightOfIntDivideTest, TypeMismatchFloatRightOfMinusWithIntTest, TypeMismatchFloatRightOfPlusWithIntTest, TypeMismatchFloatRightOfPowerWithIntTest, TypeMismatchFloatRightOfTimesWithIntTest, TypeMismatchFloatUnderIntTest, TypeMismatchFunctionInATypeArgumentTest, TypeMismatchFunctionLeftOfGreaterThanTest, TypeMismatchIfBranchTest, TypeMismatchIfConditionIntTest, TypeMismatchIfUnderIntTest, TypeMismatchImportedTypeNamedLikeAnAliasTest, TypeMismatchIntAgainstNumberAfterAMismatchTest, TypeMismatchIntRightOfAppendTest, TypeMismatchIntRightOfAppendWithAListTest, TypeMismatchIntRightOfDivideTest, TypeMismatchIntRightOfMinusWithFloatTest, TypeMismatchIntRightOfPlusWithFloatTest, TypeMismatchIntRightOfPowerWithFloatTest, TypeMismatchIntRightOfTimesWithFloatTest, TypeMismatchIntWhereFloatTest, TypeMismatchLambdaArgumentPatternTest, TypeMismatchLambdaCallAsAnArgumentTest, TypeMismatchListConsedOntoAListOfStringsTest, TypeMismatchListEntryPatternTest, TypeMismatchListMultipliedTest, TypeMismatchListPatternTest, TypeMismatchListRightOfAppendWithAStringTest, TypeMismatchListRightOfPlusTest, TypeMismatchListRightOfTimesTest, TypeMismatchListsAddedTest, TypeMismatchLocalTypeNamedLikeAnImportedOneTest, TypeMismatchMaybeConsedOntoAListOfStringsTest, TypeMismatchMaybeOfANumberAgainstARigidVarTest, TypeMismatchMisspeltFieldAmongManyTest, TypeMismatchMisspeltFieldOfExtensibleRecordTest, TypeMismatchNegateTest, TypeMismatchNumberAndAppendableListEntriesTest, TypeMismatchNumberAndCompappendListEntriesTest, TypeMismatchNumberIntoNotWithPipeLeftTest, TypeMismatchNumberLeftOfAndTest, TypeMismatchNumberLeftOfComposeRightTest, TypeMismatchNumberLeftOfOrTest, TypeMismatchNumberLeftOfPipeLeftTest, TypeMismatchNumberListEntryWithAnAliasTest, TypeMismatchNumberPipedIntoANumberTest, TypeMismatchNumberPipedIntoNotTest, TypeMismatchNumberPlusAppendableTest, TypeMismatchNumberRightOfAndTest, TypeMismatchNumberRightOfOrTest, TypeMismatchOneArgumentFunctionWhereTwoTest, TypeMismatchParameterisedAliasTest, TypeMismatchRecordFieldExtraTest, TypeMismatchRecordFieldsMissingTest, TypeMismatchRecordLeftOfAtMostTest, TypeMismatchRecordPatternTest, TypeMismatchRecordWhereEmptyClosedRecordTest, TypeMismatchRigidAppendableAddedTest, TypeMismatchRigidCompappendAsIntTest, TypeMismatchRigidComparableAsANumberTest, TypeMismatchRigidComparableAsNumberTest, TypeMismatchRigidExtensionWhereClosedTest, TypeMismatchRigidExtensionWhereFlexibleAfterAMismatchTest, TypeMismatchRigidNumberAsAliasTest, TypeMismatchRigidNumberAsFunctionTest, TypeMismatchRigidNumberAsMaybeTest, TypeMismatchRigidNumberAsRecordTest, TypeMismatchRigidNumberAsRigidVarTest, TypeMismatchRigidNumberAsTupleTest, TypeMismatchRigidNumberAsUnitTest, TypeMismatchRigidVarAgainstItsListTest, TypeMismatchRigidVarAgainstItsMaybeTest, TypeMismatchRigidVarAppendedTest, TypeMismatchRigidVarAsAliasTest, TypeMismatchRigidVarAsFunctionTest, TypeMismatchRigidVarAsMaybeTest, TypeMismatchRigidVarAsRecordTest, TypeMismatchRigidVarAsRigidNumberTest, TypeMismatchRigidVarAsTupleTest, TypeMismatchRigidVarAsUnitTest, TypeMismatchRigidVarComparedTest, TypeMismatchSameRigidExtensionTest, TypeMismatchSecondArgumentToAFunctionTest, TypeMismatchSecondCasePatternTest, TypeMismatchSelfAppliedArgumentAgainstANumberTest, TypeMismatchSelfAppliedArgumentAgainstARigidNumberTest, TypeMismatchSelfAppliedArgumentAgainstARigidVarTest, TypeMismatchStringAppendedToListTest, TypeMismatchStringLeftOfConsTest, TypeMismatchStringLeftOfDivideTest, TypeMismatchStringLeftOfIntDivideTest, TypeMismatchStringLeftOfLessThanTest, TypeMismatchStringLeftOfPlusTest, TypeMismatchStringRightOfAtLeastTest, TypeMismatchStringRightOfAtMostTest, TypeMismatchStringRightOfGreaterThanTest, TypeMismatchStringRightOfMinusTest, TypeMismatchStringRightOfNotEqualsTest, TypeMismatchStringRightOfPlusTest, TypeMismatchStringRightOfPowerTest, TypeMismatchStringRightOfTimesTest, TypeMismatchTailPatternTest, TypeMismatchThirdCaseBranchTest, TypeMismatchTriplesDifferTest, TypeMismatchTupleAgainstAnAliasTest, TypeMismatchTupleComponentPatternTest, TypeMismatchTupleSizesDifferTest, TypeMismatchTwentyEightTypeVariablesTest, TypeMismatchTwoAliasedRecordsTest, TypeMismatchTwoArgumentLambdaWhereOneTest, TypeMismatchTwoComparableVarsTest, TypeMismatchTwoExtensibleRecordsTest, TypeMismatchTwoFlexibleRecordsTest, TypeMismatchTwoRigidVarsTest, TypeMismatchTypeUnderAnExposingListTest, TypeMismatchTypeWhereAnAliasTest, TypeMismatchUnitLeftOfAtLeastTest, TypeMismatchUnitPatternTest, TypeMismatchUnitsOnBothSidesTest, TypeMismatchUnknownTypeAgainstANumberTest, TypeMismatchUnknownTypeAgainstARigidNumberTest, TypeMismatchUnknownTypeAgainstARigidVarTest, TypeMismatchUnknownTypesOnBothSidesTest, TypeMismatchUpdateOfANearFieldTest, TypeMismatchUpdateOfANumberTest, TypeMismatchUpdateOfAnEmptyRecordTest, TypeMismatchUpdateValueTest, TypeParameterTwiceTest, UnsafePatternAllDestructPatternsEdgeCaseCasesTest, UnsafePatternDestructFixedListPatternLetDestructCasesTest, UnsafePatternMixedNestedAliasesAsPatternCasesTest, UnsafePatternTripleNestedPatternsPatternArgCasesTest

18
expected to be rejected, and eco's parser rejects it too

AnnotationNotFollowedByDefinitionTest, ImportAliasQualifiedTest, InfixNoQualifiedOperatorTest, InfixNoSectionLeftTest, InfixNoSectionRightTest, ParseErrorCasePatternUnfinishedTest, ParseErrorNumberBadHexDigitTest, ParseErrorNumberFractionThenLetterTest, ParseErrorStringEscapeTooFewDigitsTest, ParseErrorStringEscapeUnclosedTest, PortProblemDeclarationWithoutNameTest, RecordUpdateNoFieldsTest, StandardA99RecordPatternRowPunRejectedTest, StandardA99RecordPatternRowRenameRejectedTest, TopLevelPatternBindingTest, TypeExprUnitAppliedTest, UnexpectedPatternFloatWithExponentTest, WeirdElseBranchElseNotIndentedTest

10
expected to be rejected, and the translator's front end refuses it: it breaks a restriction on characters, tokens and layout, which Lean does not model

BadTupleATupleOfFourTest, CharLiteralSurrogateEscapeTest, InfixMixedAssocComposeTest, InfixMixedAssocPipesTest, InfixNonAssocCompareTest, InfixNonAssocEqTwiceTest, ModuleHeaderMissingImportedTest, StandardA1UnitPatternGapTest, StandardA8SurrogateEscapeTest, UnknownOperatorAnUnknownOperatorTest

Evaluation: the reduced program

Every one of the 702 tests whose program compiles is translated into a reduced program the evaluator runs. A test that expects a compile error has no meaning to run, so it has no reduced program.

TestsStatus
702
translated

AccessorFunctionFieldInListTest, AccessorFunctionFieldTailCallTest, AccessorPlaceholderAccessorOfAFunctionFieldPassedInTailCallsTest, AccessorToLocalFuncTest, AccessorVariableTest, AliasForwardTest, AnnotatedLetRecFnResultTest, AnonymousFunctionTest, AppendTypeSplitTest, ArrayEqualityFlagsTest, AstralCharCasePatternTest, AstralCharLiteralTest, BoolAndTest, BoolOrTest, BoolShortCircuitParserIdiomTest, BoolShortCircuitTest, CapturedStagedFuncCallTest, CaseAsPatternTest, CaseBoolTest, CaseBranchSelectionTest, CaseCharManyBranchTest, CaseCharTest, CaseCtorArgPatternTest, CaseCustomType4Test, CaseCustomType4WildcardTest, CaseCustomTypeTest, CaseDeepNestTest, CaseDeeplyNestedTest, CaseDefaultTest, CaseFanOutShadowTest, CaseGuardLikeTest, CaseInLambdaTest, CaseInLetTest, CaseIntTest, CaseListConsTest, CaseListTest, CaseListThreeWayTest, CaseManyBranchesTest, CaseMaybePairTest, CaseMaybeTest, CaseMixedPatternTest, CaseMultiFieldExtractTest, CaseNestedCtorTest, CaseNestedRecordAccessTest, CaseNestedTest, CaseOrderTest, CaseResultTest, CaseReturnFunctionTest, CaseReturningLambdaTest, CaseSharedBranchTest, CaseSingleCtorBoolMultiTypeTest, CaseSingleCtorBoolTest, CaseStringEmptyPatternTest, CaseStringEscapeTest, CaseStringManyBranchTest, CaseStringTest, CaseTreeTest, CaseTripleTest, CaseTupleLiteralTest, CaseTupleTest, CaseUnicodeCharTest, CharAstralClosureCaptureTest, CharAstralCustomFieldTest, CharAstralRecordFieldTest, CharAstralTupleTest, CharCaptureEscapedTailDefTest, CharCasePredicateTest, CharLiteralPatternMatchMinimalTest, CharLiteralPatternMatchVariousTest, CharUnicodeTest, ClosureCapture01Test, ClosureCapture02Test, ClosureCapture03Test, ClosureCapture04Test, ClosureCapture05Test, ClosureCapture06Test, ClosureCaptureBoolTest, ClosureCaptureRecordTest, ClosureCaptureTupleTest, ClosureDifferentClosuresPerIfBranchInsideACaseTest, CombinatorBComposeTest, CombinatorBSumMapTest, CombinatorCConsTest, CombinatorCFlipTest, CombinatorIIdentityTest, CombinatorListStringTest, CombinatorPLengthsTest, CombinatorRefIdentityBugTest, CombinatorSFeedTest, CombinatorSPalindromeTest, CombinatorSpCombineTest, CombinatorSpMulTest, CombinatorStdlibTCombinatorPipeListIntoComposedOpsTest, CombinatorTPipeTest, CombinatorTThrushTest, CombinatorTest, CombinatorWConcatTest, CombinatorWDupTest, CompilerIssue1766LetMutualRecursionMismatchTest, CompilerIssue1793ComparableTupleLetCrashTest, CompilerIssue1813TcoClosureCapturesMutatedArgTest, CompilerIssue1858AnnotatedPolymorphicRecursionTest, CompilerIssue1890RecordUpdateMutualRecursionCrashTest, CompilerIssue1916PhantomExtensibleAliasCrashTest, CompilerIssue1964AnnotatedPolymorphicRecursionWrapperTest, CompilerIssue2017TcoContinuationShadowedTest, CompilerIssue2019AliasOfTypeVariableTest, CompilerIssue2057CallSiteChangesInferredTypeTest, CompilerIssue2119MutualRecursionUnannotatedTest, CompilerIssue2207MutualRecursionSecondFunctionTest, CompilerIssue2221TcoContinuationTest, CompilerIssue2252IdentityAliasTest, CompilerIssue2268TcoClosureCaptureTest, CompilerIssue2298IdentityAliasResultTest, CoreIssue1141UnusedPortCallBreaksSubscriptionTest, CoreIssue988NanContainerSelfEqualityTest, CovEtaDebugLogTest, CovForeignTypesTest, CovLambdaBoundaryCaseBoundaryInARecursiveValueTest, CovLambdaBoundaryCaseBoundaryUnderAFunctionAliasTest, CovLambdaSetFunctionsDestructuredFromTuplesAndRecordsTest, CovLambdaSetFunctionsInRecordsTuplesAndMaybeTest, CovPatternSplitTupleAndConstructorParametersMatchedByCaseTest, CovPortIncomingArrayTest, CovPortIncomingJSONValueTest, CovPortIncomingTripleTest, CovPortIncomingUnitTest, CovPortOutgoingJSONValueTest, CovPortOutgoingUnitTest, CovTailRecPairParameterPassedUnchangedLetBoundAndRebuiltTest, CovTailRecPairParametersSwappedAndALoopReturningALambdaTest, CovTailRecSplitATripleParameterTest, CustomTypeFuncFieldTest, CustomTypeMultiFieldTest, CustomTypeNestedTest, CustomTypePatternTest, DebugLogLambdaBoundaryTest, DebugLogRecordTupleFieldTest, DebugNumberAtFloatTest, DecisionTreeAdvancedDeepNestingWithFallbackTest, DeepEqualityTest, DeepNestStressTest, DestructCaptureTest, DictMapStagedCaptureTest, EdgeCaseAllDestructPatternsTest, EitherTypeTest, EmbeddedEmptyStringCaptureTest, EmbeddedMixedConstantsTest, EmbeddedNilCaptureTest, EmbeddedNilInCustomTypeTest, EmbeddedNilRecursiveTest, EmbeddedNothingCallbackTest, EmbeddedNothingCaptureTest, EmbeddedNothingInCustomTypeTest, EmbeddedNothingInRecordTest, EmbeddedNothingInTupleTest, EmbeddedNothingMapTest, EmbeddedNothingPolymorphicTest, EmbeddedNothingRecursiveTest, EmbeddedReturnNilTest, EmbeddedReturnNothingTest, EmbeddedUnitCaptureTest, EntryMainOfRootModuleTest, EqualityStringChainCaseTest, ErasedListSpecializationTest, EscapeCustomCaseScrutineeTest, EscapeTopLevelTupleTest, EtaExpandStateFunctionSequenceTest, EtaExpandStateTest, File, FlagsRecordTest, FlipFunctionTest, FloatEdgeTest, FunctionAccumulatorFunctionLookupTest, FunctionBasicTest, FunctionChainedPartialApplicationTest, FunctionCompappendWithStringTest, FunctionMultiArgTest, FunctionUnannotatedCompappendTest, FunctionValueChoiceTest, FunctionValuesChosenByIfCaseAndTupleTest, HOParamApplyTwoTest, HelloTest, HeteroClosureIntFloatTest, HigherOrderFilterLikeFunctionTest, HigherOrderFunctionChosenByIfTest, HigherOrderFunctionFactoryTest, HigherOrderReturnLambdaBasedOnConditionTest, HigherOrderTest, HigherOrderTripleNestedFunctionTest, HoleyAliasTwoParamsTest, ImportClosedTypeOpenItemTest, ImportExposingAllTest, ImportExposingItemsTest, ImportOperatorItemTest, ImportResolutionQualifiedImportedFunctionTest, ImportTypeByNameLaterReplacesTest, IndirectCallFloatTest, InfixAssocLeftArithTest, InfixAssocPipesTest, InfixAssocRightPowTest, InfixIfExtendsRightTest, InfixLastOperandAnyExprTest, InfixNegatedOperandTest, InfixNonAssocSeparatedLegalTest, InfixPrecAddOverConsTest, InfixPrecAndOverOrTest, InfixPrecAppendOverEqTest, InfixPrecApplicationFirstTest, InfixPrecCompareOverAndTest, InfixPrecComposeOverPipeTest, InfixPrecMulOverAddTest, InfixPrecOrOverPipeTest, InfixPrecPowOverMulTest, InlineDupLetNamesTest, JoinpointABI23Majority3FlatTest, LambdaBoundaryCaptureTest, LambdaCaseBoundaryTest, LambdaLetBoundaryTest, LambdaPatternArgTest, LargeDispatchCaseTest, LetBasicTest, LetBoundLambdaCallTest, LetDestructAliasTest, LetDestructFuncTupleTest, LetDestructNestedSingleConstructorNumberTest, LetDestructRecordTest, LetDestructTupleNestedTest, LetDestructuringTest, LetMultiFuncTest, LetMultipleTest, LetMutualRecursionBetweenLocalsTest, LetNestedTest, LetNumberAndThenTest, LetNumberApplyToTest, LetNumberAsPatternTest, LetNumberBoxedSilentMiscompileTest, LetNumberCaseLetTest, LetNumberCaseTuple3Test, LetNumberClosureInRecordTest, LetNumberContainerDualTest, LetNumberCustomTriple3Test, LetNumberCustomTypeTest, LetNumberDeepNestRecordTest, LetNumberDestructureTest, LetNumberDualUseTest, LetNumberFloatArithCrashTest, LetNumberFoldrTest, LetNumberFracRecordTest, LetNumberIfBranchTest, LetNumberIndirectCaptureTest, LetNumberIndirectDualTest, LetNumberIndirectFoldlTest, LetNumberIndirectIdentityTest, LetNumberIndirectTopFnTest, LetNumberLetInLambdaTest, LetNumberListCaseTest, LetNumberListConsHeadTest, LetNumberListFixedTest, LetNumberListOfClosuresTest, LetNumberListOfMaybeTest, LetNumberListOfRecordsTest, LetNumberLocalMap2Test, LetNumberLogBaseTest, LetNumberMaybeCaseDirectTest, LetNumberMaybeChainTest, LetNumberMixedTupleSlotTest, LetNumberMulFnTest, LetNumberNegateTest, LetNumberNestedCustomTest, LetNumberNestedLetTest, LetNumberNestedTupleTest, LetNumberRecordDestructureTest, LetNumberRecordMultiFieldTest, LetNumberRecordToFnTest, LetNumberResultMapTest, LetNumberScaleFnTest, LetNumberSumMapTest, LetNumberTupleBothTest, LetNumberTupleRecordNestTest, LetNumberTupleSecondTest, LetNumberTupleToFnTest, LetNumberUnionBranchTest, LetNumberWildcardSlotTest, LetRecClosureTest, LetRecMultiArgTest, LetSeparatedStagingTest, LetValueBindingTest, ListConsCharTest, ListConsFloatTest, ListConsIntTest, ListConsTest, ListIndexedMapTest, ListLiteralDebugLogKindTest, ListLiteralTest, LocalMultiNonTailRecTest, LocalRecCaptureBoolTest, LocalRecCaptureKindsTest, LocalRecCaptureSplitParamTest, LocalTailRecSimpleTest, LssGapBodyTieAnnoAB, LssGapCtorAsValue, LssGapCtorInList, LssGapCtorScale, LssGapCustomTypeFn, LssGapNoDecls, LssGapRecordFnNoAlias, LssGapTupleFn, MaybeJustTest, MaybeNothingTest, MaybePatternMatchTest, MinimalAsPatternTest, MinimalCaseNextRuleTest, MinimalCaseTest, MinimalCmdMapTest, MinimalConsPatternFailTest, MinimalConsPatternTest, MinimalConstantPatternTest, MinimalConstantTest, MinimalConstructedPatternFailTest, MinimalConstructedPatternTest, MinimalConstructorPatternFailTest, MinimalConstructorPatternTest, MinimalCustomTypeTest, MinimalDestructuringTest, MinimalEmptyListTest, MinimalExposingAliasTest, MinimalExposingAllTest, MinimalExposingOpenTest, MinimalImportValueTest, MinimalKillTest, MinimalLetRecursionTest, MinimalLetTest, MinimalNilPatternFailTest, MinimalNilPatternTest, MinimalParenthesesTest, MinimalParenthesisedPatternTest, MinimalParenthesisedTypeTest, MinimalPipeArrayTest, MinimalPipeFalseTest, MinimalPipeFloatTest, MinimalPipeIntTest, MinimalPipeJustTest, MinimalPipeListTest, MinimalPipeNothingTest, MinimalPipeRecordTest, MinimalPipeStringTest, MinimalPipeTrueTest, MinimalPipeTupleTest, MinimalPipeUnitTest, MinimalPipeValueTest, MinimalPortSubscriptionTest, MinimalRecordAliasConstructorTest, MinimalRecordPatternTest, MinimalRecordTest, MinimalRecordTypeTest, MinimalRecordUpdateTest, MinimalRowVariableTest, MinimalSleepTest, MinimalSpawnTest, MinimalTaskAndThenFailTest, MinimalTaskAndThenInnerTest, MinimalTaskAndThenTest, MinimalTaskOnErrorInnerTest, MinimalTaskOnErrorSucceedTest, MinimalTaskOnErrorTest, MinimalTaskPerformTest, MinimalTuplePatternTest, MinimalTypeAliasTest, MinimalTypeVariableTest, MinimalUnitPatternTest, MinimalUnitTest, MinimalVariableTest, MultiLocalTailRecTest, MutualLetRecClosuresTest, MutualLetRecManyCapturesTest, MutualLetRecNestedTest, MutualRecursionTest, MutualRecursionThreeWayTest, NestedCaseReturnTest, NoImportsTest, NonAsciiIdentifierTest, NonZeroArityRecursionTest, NumberDestructFieldTest, NumberGenericAppCustom, NumberGenericAppList, NumberGenericAppMaybe, NumberGenericAppTuple, OutgoingPortTuple3KeepsRunningTest, OutgoingPortTuple3Test, PapEtaCtorProbe, ParenthesesTest, PartialAppCaptureTypesTest, PartialAppChainTest, PartialApplicationTest, PhantomTypeVarTest, PolyApplyLambdaTest, PolyChainCallTest, PolyChainDictLikeInsertChained5TimesWithTupleKeysConcreteCallerTest, PolyChainFoldlLikeCalled8TimesOverTupleKeyedStructureTest, PolyEscapePolymorphicFunctionExtractedFromTupleTest, PolyEscapeRecordTest, PolyLetConstTest, PolyLetTailRecTwoTypesTest, PolySpecializeRecursiveTest, PolyStepLoopFloatResultTest, PolyStepLoopFoldMIntTest, PolyTailRecReverseTest, PortAliasEchoTest, PortEchoArrayStringFlagsTest, PortEchoBoolTest, PortEchoFloatTest, PortEchoJsonValueTest, PortEchoListIntTest, PortEchoMaybeIntTest, PortEchoNestedTest, PortEchoStringTest, PortEchoTest, PortEchoTuple2Test, PortEchoTuple3Test, PortEchoUnitTest, PortEncodingDecodeFloatTest, PortEncodingDecodeListIntTest, PortEncodingDecodeMaybeIntTest, PortEncodingDecodeTuple2Test, PortEncodingEncodeBoolTest, PortEncodingEncodeFloatTest, PortEncodingEncodeMaybeRecordTest, PortEncodingEncodeTuple2Test, PortEncodingPortWithArrayTest, PortIncomingRejectTest, PortPipeBytesRejectTest, PortPipeBytesTest, PortPipeListArrayTest, PortPipeMaybeTest, PortPipeRecordTest, PortPipeRejectTest, PortPipeScalarsTest, PortPipeTupleTest, PortPipeValueRejectsBytesTest, PortPipeValueTest, PureMutualRecursiveValueTest, PureRecursiveValueThunkTest, RecordAccessTest, RecordAccessorFunctionCaseTest, RecordAccessorFunctionTest, RecordChainedUpdateTest, RecordChainedUpdatesTest, RecordCreateTest, RecordNarrow01CapturesNonEmptyTest, RecordNarrow02CapturesNothingTest, RecordNarrow03FullAnnotationTest, RecordNarrow04SingleFieldTest, RecordNarrow05NoNestingTest, RecordNarrow06RowPolyAnnotationTest, RecordNarrow08NoDestructureTest, RecordNarrow09DirectCallTest, RecordNarrow10TripleNestingTest, RecordNestedAccessTest, RecordOpenNarrowFieldIndexTest, RecordRowsTest, RecordUpdatePolyFieldTest, RecordUpdateTest, RecordWithFunctionsTest, RecursiveFactorialTest, RecursiveFibonacciTest, RecursiveListLengthTest, RecursiveMutualTypeTest, RecursiveTopLevelLambdaTest, RecursiveTreeTest, RecursiveTypeInRecordTest, ResultErrTest, ResultOkTest, RowVariableAloneTest, SingleCtorPairBoolCharTest, SingleCtorPairBoolFloatTest, SingleCtorPairBoolIntBidiTest, SingleCtorPairCharFloatTest, SingleCtorPairCharIntTest, SingleCtorPairFloatBoolTest, SingleCtorPairIntFloatTest, SingleCtorPairStringBoolTest, SingleCtorPairStringIntTest, SingleCtorPairUnitIntTest, StandardA56PrefixAndOrTest, StandardA72AbsentFlagsTest, StandardA82MainInImportedModuleTest, StandardA88PortNegativeZeroTest, StandardA88PortNonFiniteTest, StandardA92BytesPortDeclarationTest, StandardA93MutualNumberDefaultTest, StandardA97NeverErrBranchTest, StandardA97SelfOnlyTypeTest, StandardA98TypeBeforeAliasTest, StandardA99RecordPatternAsTest, StandardA99RecordPatternBothTest, StandardA99RecordPatternDependentTest, StandardA99RecordPatternFloatTest, StandardA99RecordPatternFunctionTest, StandardA99RecordPatternInTopCopyTest, StandardA99RecordPatternInTupleTest, StandardA99RecordPatternIntTest, StandardA99RecordPatternLambdaTest, StandardA99RecordPatternSharedVariableTest, StandardA99RecordPatternTwoVariablesTest, StandardApplicationStrictTest, StandardCoreEvaluationExamplesTest, StandardLetStrictTest, StringCasePatternCommaTest, StringCreationMatrixTest, StringEscapeCrTest, StringEscapesTest, StringLiteralTest, StringMagicPrefixTest, TailLoopMutualRecMutualRecursionInsideATailLoopTest, TailRecBoolCarryTest, TailRecCaseDestructTest, TailRecCaseMultiBranchTypesTest, TailRecClosureAccTest, TailRecCustomCaseTest, TailRecDeciderSearchTest, TailRecDecoderLoopTest, TailRecFoldlCaseTest, TailRecManyBranchStringTest, TailRecMultiCaseWhileTest, TailRecNestedCaseTest, TailRecNestedStringCaseTest, TailRecTypeTraversalTest, TailRecursiveSumTest, TopLevelNameReplacesImportTest, TupleCharFieldTest, TuplePairTest, TupleTripleTest, TypeAliasCtorTest, TypeClassConstraintTest, UnreachableModuleTest, UserBoolNamedCtorTest, WideClosureSat26Test, WideCtorField24Test, WideCtorMixedTest, WideRecord33Test, WideRecord40Test, WideRecordDecoder26Test, WideRecordDecoder30Test, WideRecordDecoder70Test, WideRecordPatternTest, WrapperUnionFieldTest, BasicsClampTest, BasicsIdentityTest, BasicsIsNaNTest, BasicsModByTest, BoolNotTest, BoolXorTest, CeilingToIntTest, CharAstralCodeTest, CharFromCodeTest, CharToCodeTest, CharToCodeThroughFunctionTest, CmdMapComposeTest, ComparableMinMaxTest, CompareCharCaptureTest, CompareCharTest, CompareCustomWithEmptyListFieldTest, CompareEmptyListTest, CompareEmptyStringTest, CompareFloatCaptureTest, CompareFloatTest, CompareIntCaptureTest, CompareIntTest, CompareNestedEmptyListTest, CompareRecordWithEmptyListFieldTest, CompareStringTest, CompareTupleWithEmptyListNestedTest, CompareTupleWithEmptyListTest, CompareTupleWithEmptyStringTest, CompilerIssue2362NanTupleEqualityTest, CompositionTest, ContainerCompareCharTest, ContainerCompareIntTest, ContainerEqualityCharTest, ContainerEqualityCustomFloatTest, ContainerEqualityFloatTest, ContainerEqualityIntTest, ContainerEqualityRecordFloatTest, ContainerEqualityStringTest, ControlFlowBooleanWithNotTest, CoreIssue1050NanGreaterThanNanTest, CoreIssue1080ClampNanTest, CoreIssue1110PortDeclarationOrderTest, CoreIssue1115NanEqualsLiteralZeroTest, CoreIssue1150CharToCodeLoneSurrogateTest, CoreIssue1154PortSubscribedWithCmdTest, CoreIssue955KillProcessTwiceTest, CoreIssue960PowNegativeExponentIntTest, CoreIssue988NanEqualityReferenceTest, EqBoxedFastPathTest, EqualityBoolCaseTest, EqualityBoolContainerTest, EqualityBoolIfTest, EqualityBoolMaybeTest, EqualityBoolPapTest, EqualityBoolRecordTest, EqualityBoolTest, EqualityBoolVarTest, EqualityOtherConstantsTest, EqualityTest, FloatAbsTest, FloatAddTest, FloatCeilingTest, FloatCompareTest, FloatDivTest, FloatFloorTest, FloatInfinityTest, FloatMathAcosTest, FloatMathAsinTest, FloatMathAtan2Test, FloatMathAtanTest, FloatMathBasicsETest, FloatMathFloatLessThanTest, FloatMathIsNaNTest, FloatMathSin2PlusCos21Test, FloatMathTanTest, FloatMinMaxTest, FloatMulTest, FloatNaNTest, FloatNegateTest, FloatNegativeZeroTest, FloatPowTest, FloatRoundTest, FloatSqrtTest, FloatSubTest, FloatTruncateTest, FloorToIntTest, IntAbsTest, IntAddTest, IntCompareTest, IntDivByZeroTest, IntDivTest, IntMinMaxTest, IntModByTest, IntMulTest, IntNegateTest, IntPowTest, IntRemainderByTest, IntSubTest, ListAppendTest, ListConcatTest, NotEqualBoolCaseTest, NotEqualBoolIfTest, NotEqualBoolMaybeTest, NotEqualBoolPapTest, NotEqualBoolRecordTest, NotEqualBoolTest, NotEqualBoolVarTest, OrderingEmptyListPapTest, OrderingEmptyListTest, OrderingEmptyStringPapTest, OrderingEmptyStringTest, OrderingMixedCaptureTest, OrderingTupleWithEmptyListTest, OrderingTupleWithEmptyStringTest, PipelineTest, ProcessPrimitiveOutcomeTest, ProcessSpawnKillHalfTest, ProcessSpawnRecursiveTest, ProcessSpawnedFailureEndsTest, ProcessYieldThrashingTest, RoundToIntTest, StandardA40IntOverflowTest, StandardA41IntDivisionWideTest, StandardA42ModByZeroTest, StandardA42RemainderByZeroTest, StandardA42ZeroDivisorTest, StandardA43PowNegativeTest, StandardA44RoundNonFiniteTest, StandardA44TruncateWideTest, StandardA45IntNegativeZeroTest, StandardA46CompareNanTest, StandardA48MinMaxNanTest, StandardA49ClampTest, StandardA51FunctionEqualityTest, StandardA53CharOrderTest, StandardA53StringOrderTest, StandardA65PowOneTest, StandardA81SleepBeyond32BitsTest, StringConcatContentTest, StringConcatTest, TaskAttemptErrorTest, TaskOnErrorCascadeTest, TaskOnErrorInnerTest, TaskOnErrorSucceedTest, TaskPerformValueTest, TaskSucceedAsArgTest, TimerEffectTest, ToFloatTest, TruncateToIntTest, UtilsEqualityCaptureCharTest, UtilsEqualityCaptureFloatTest, UtilsEqualityCaptureIntTest, UtilsOrderingCaptureCharTest, UtilsOrderingCaptureFloatTest, UtilsOrderingCaptureIntTest

StandardElmMech/Apply.lean

Eq and cmp as functions; IEEE 754-2019 minimum and maximum (fMinimum, fMaximum) and clamp at floats built on them (fClamp); APPLY as the relation Apply (one constructor per line of the book's displays) and as the executable applySet, with applySet_sound and applySet_complete; logEntry, the log entry of an application of Debug.log

The executable set

StandardElmMech/Forget.lean

Generated by scripts/gen_forget.py: forget (a logged derivation is a derivation of the book) and lift (every derivation of the book has a logged one)

StandardElmMech/Sound.lean

soundAt, evExp_sound_l, evExp_sound: every value of the evaluator, with its log, is derivable in the logged relation, and so in the book's

StandardElmMech/Complete.lean

The index of the next choice only grows (evExp_next and the others); Agrees; lemmas for the side conditions

The index only grows

Agreement of an oracle with a list of choices (for completeness, Completeness.lean)

StandardElmMech/NoStuck.lean

Generated by scripts/gen_nostuck.py: for a derivation, the evaluator runs out of fuel, reads a choice, or gives exactly its value and log

StandardElmMech/Completeness.lean

Generated by scripts/gen_complete.py: every derivation is found by the evaluator, with some choices and fuel

StandardElmMech/Determinism.lean

noValue_of_stuck, evExp_unique, evExp_unique_l, evExp_complete, noValue_iff, and the same for applications and declarations

StandardElmMech/Checks.lean

What a check states (plan decision D9): Expect (structural values) with its decider, the parser of CHECK values, CheckStmt, the log statements EntryPat, LogCheck, ExpChecks with their deciders, regular expressions Rx

The value a CHECK line states

The log statements

A value statement for the ruling theorems

StandardElmMech/Eff/Boundary.lean

Boundary values (BVal, with arrays and objects in the list types BArr, BObj), JSON numbers as exact rationals (jnum, isDecimal), canonical values, JSON values (isJson), mkObj, the exact value of a float (floatToRat?, dyadic) and the float nearest a decimal (ratToFloat)

StandardElmMech/Eff/EncDec.lean

The book's relations Enc and Dec (15 and 14 rules, r_e_enc_*, r_e_dec_*), enc_iff, dec_iff, and that both are partial functions

The applications of the array rules

Lists and bytes

The relations are the functions

StandardElmMech/Eff/Task.lean

Task reduction (TaskRed, 7 rules, r_e_task_*) and its logged twin, focus and plug, the property of task reduction (taskRed_iff, taskRed_outcome, taskRed_kind, taskRed_silent_same, taskRed_none), and the executable step stepTaskL, sound, complete and unique

The redex of a task

  • taskRed_outcome tactic proof
    An outcome has no reduction.
  • taskRed_of_focus term proof
    A reduction of the redex, plugged back into the frames, is a reduction of the task.
  • taskRed_iff tactic proof
    A reduction is a reduction of the redex, plugged back into the frames.
  • taskRed_same_redex tactic proof
    Two reductions of a task reduce its one redex.
  • taskRed_kind tactic proof
    Either every reduction of a task is silent or every one is labelled, by one primitive and one argument list (sec:effects-tasks, the property).
  • taskRed_silent_same tactic proof
    Silent reductions of a task have the same right-hand side, up to the choice of a member of APPLY in the application of the redex.
  • taskRed_none tactic proof
    A well-formed task that is not an outcome has no reduction only when the application of r:e-task-andthen-succeed or r:e-task-onerror-fail at its redex has no result.

The executable step

StandardElmMech/Eff/Flat.lean

Flattening of commands and subscriptions (flat, flat_leaves)

StandardElmMech/Eff/Messages.lean

Messages (Recv, 3 rules, r_e_msg_*) and its logged twin, and the executable recvL, sound, complete and unique

StandardElmMech/Eff/TaskTexts.lean

The elm/core 1.0.5 texts of Task and of the List functions it reaches, their values taken in order, and their derivations (textValue_eval, taskTexts_eval, listTexts_eval); ME0(Task) and ME0(Process)

Values of texts taken in order

  • textValue_eval tactic proof
    Every text derives its value in its environment.
  • textValue_evalL tactic proof
    The same derivation in the logged relation, with the empty log (a lambda logs nothing).

The environments and the interfaces

  • taskTexts_eval term proof
    Each text of Task derives its value in the environment of the texts before it.
  • listTexts_eval term proof
    Each text of List (foldl and foldrHelper by r:d-dec-rec, reverse and foldr by r:d-dec-nonrec) derives its value in the environment of the texts before it.
  • taskTexts_evalL term proof
    The logged derivations, with the empty log.
  • listTexts_recursive kernel-checked (decide +kernel)
    foldl and foldrHelper are recursive, reverse and foldr are not (so their values are Rec of their closures, and the closures themselves).

StandardElmMech/Eff/Properties.lean

APPLY of the effect values has one member; the rulings A74, A76, A88 and A92; canonical payload types, the decimality of a float's exact value, and that every value of a payload type has a canonical encoding (enc_total)

APPLY of the effect values

  • apply_effect_singleton tactic proof
    APPLY of an effect value has at most one member ("each set has exactly one member", sec:effects-apply, where it is defined).

A74

  • a74_value_enc tactic proof
    A74: at the type Json.Encode.Value a value encodes exactly as the JSON value it holds.
  • a74_value_dec tactic proof
    A74: a boundary value decodes at Json.Encode.Value exactly when it is JSON.
  • a74_nonfinite_null native_decide (trusts the compiled evaluator)
    A74: NaN and the infinities encode as null.
  • a74_maybe_float_null term proof
    A74: null decodes at Maybe Float as Nothing.

A76

A88

  • a88_negzero_enc native_decide (trusts the compiled evaluator)
    A88: -0 encodes as the JSON number 0: a JSON number has no sign apart from its value. [native] (a float's bits)
  • a88_zero_dec_int tactic proof
    A88: the JSON number 0 decodes at Int as 0, and only so.
  • a88_int_exact term proof
    A88: JSON numbers decode at Int exactly, within IntRange; an Int encodes as itself.
  • a88_int_range kernel-checked (decide +kernel)
    A88: 2^63 is outside IntRange, and 1.5 is no Int: neither decodes at Int.
  • a88_huge_dec_float native_decide (trusts the compiled evaluator)
    A88: a JSON number beyond the floats decodes at Float as an infinity. [native] (the rounding of Float.ofScientific is the C library's)

A92

  • a92_bytes_not_json tactic proof
    A92: a byte sequence is not JSON.
  • a92_dec_bytes tactic proof
    A92: only a byte sequence decodes at Bytes, as bin# of its bytes.
  • a92_bytes_not_string tactic proof
    A92: a byte sequence does not decode at String.
  • a92_bytes_not_list tactic proof
    A92: a byte sequence does not decode at List Int.
  • a92_value_no_bytes term proof
    A92: a value of Json.Encode.Value carries no byte sequence.
  • a92_bytes_nested kernel-checked (decide +kernel)
    A92: a list of byte sequences encodes as an array of byte sequences.

Numbers: a float's exact value is decimal

  • pow2_of_dvd term proof
    A92: a list of byte sequences encodes as an array of byte sequences. -/ theorem a92_bytes_nested : Enc (.list .bytes) (Val.ofList [binVal [1, 2]]) (.arr (.cons (.bytes [1, 2]) .nil)) := (enc_iff _ _ _).mpr (by decide +kernel) /-! ## Canonical payload types and boundary values (D7) -/ mutual /-- Canonical payload types: the fields of every record type strictly increasing by label. -/ def PTy.canonB : PTy → Bool | .list τ | .maybe τ | .array τ => τ.canonB | .tuple2 a b => a.canonB && b.canonB | .tuple3 a b c => a.canonB && b.canonB && c.canonB | .record fs => fs.canonB && fs.labelsIncreasing | _ => true def PFields.canonB : PFields → Bool | .nil => true | .cons _ τ rest => τ.canonB && rest.canonB def PFields.labelsIncreasing : PFields → Bool | .nil => true | .cons _ _ .nil => true | .cons l _ (.cons l' τ' rest) => decide (l < l') && (PFields.cons l' τ' rest).labelsIncreasing end def PTy.Canon (τ : PTy) : Prop := τ.canonB = true /-! ## Numbers: a float's exact value is decimal
  • stripFactor_pow2 tactic proof
  • stripFactor_one term proof
  • isDecimal_of_den_dvd tactic proof
  • isDecimal_int term proof
  • dyadic_den_dvd tactic proof
  • floatToRat?_decimal tactic proof

Every value of a payload type has an encoding (sec:effects-ports, the property)

StandardElmMech/Eff/MkObj.lean

A76: mkObj ignores the order of distinct keys (a76_mkObj_perm), a lookup finds the last binding (lookup_mkObj), and decoding ignores keys outside the record type (a76_dec_extra_key)

Sorting by insertion

Keeping the last binding of each key

Lookups through `mkObj`

StandardElmMech/Eff/Normalise.lean

PTy.normalise (record fields sorted by label) and normalise_canon: canonical when each record's labels are distinct

Labels increasing as a pairwise property

StandardElmMech/Eff/WF.lean

Well-formed values (Val.WF): no byte sequence outside an out leaf

StandardElmMech/Eff/RoundTrip.lean

The round trip of encoding and decoding (roundtrip), except where A88 says otherwise (NoExc), under the named hypothesis FloatRoundTrip; the exceptions shown to be needed

Lists and their values

The exceptions are needed

  • a88_roundtrip_negzero native_decide (trusts the compiled evaluator)
    A88: -0 encodes as 0, which decodes as +0: the round trip loses the sign. [native] (a float's bits)
  • roundtrip_nan_fails native_decide (trusts the compiled evaluator)
    NaN encodes as null, which does not decode at Float. [native] (a float's bits)
  • roundtrip_just_nothing kernel-checked (decide +kernel)
    Just Nothing at Maybe (Maybe Int) encodes as null, which decodes as Nothing.

StandardElmMech/Eff/Examples.lean

Task.perform, Task.sequence of six tasks reduced to its outcome, Task.attempt of a failing task, and the flattening of Cmd.batch [Cmd.none, Cmd.none], by the kernel

  • exValue_sound tactic proof
  • eqFO_sound_all tactic proof
  • eqFO_sound term proof
  • optEq_sound tactic proof
  • ex_perform kernel-checked (decide +kernel)
    Task.perform identity (Task.succeed 1) evaluates to a task leaf command.
  • ex_sequence kernel-checked (decide +kernel)
    Task.sequence of six succeeding tasks reduces to succeed [1, ..., 6]; six elements exercise foldrHelper's unrolling by four and its recursion.
  • ex_attempt_err kernel-checked (decide +kernel)
    Task.attempt identity (Task.fail 3) is a task leaf whose task succeeds with Err 3.
  • ex_flat_none kernel-checked (decide +kernel)
    Cmd.batch [Cmd.none, Cmd.none] flattens to the empty multiset.

StandardElmMech/Mod/RulesL.lean

The logged twins of the four relations that can log, with forget and lift

Forget and lift

StandardElmMech/Mod/Sound.lean

Its soundness

StandardElmMech/Mod/Complete.lean

The functional parts' converses, nostuck for modules and programs, noMeaning_of_stuck, evProgram_unique_l, completeness (evProgram_complete, noMeaning_iff)

nostuck

Statements about every derivation of a program

  • noMeaning_of_stuck tactic proof
    A program on which the evaluator is stuck without reading a choice has no meaning (A25, A62).
  • evProgram_unique_l tactic proof
    A program value found without reading a choice is the only one, and its log the only log.
  • evModule_unique_l tactic proof

Completeness (D1): every derivation is found by some choices and fuel

StandardElmMech/Mod/ME0.lean

The dynamic ME0 of the default-imported modules (plan decision D3), the harness Html and Btest (D2), E_default (the environment the default imports give, derived by the rules), the texts of none

StandardElmMech/Mod/Properties.lean

The frame lemmas (a module's derivation reads the basis only at the modules it imports) and Btest_agrees

Finite maps

The frame lemma

The test basis (D2)

  • btestStep_other tactic proof
    One step of Btest's fold changes only the binding of its own module.
  • foldl_btest_other term proof
  • Btest_agrees tactic proof
    D2: the test basis agrees with ME0 on every module but Html and the library's modules.

StandardElmMech/Mod/Good.lean

The property of interfaces (Interface.Good): ME0 and the harness have it (ME0_good), a top-level declaration with distinct bound names infers an interface with it (EvalTopDec.good), a header's exposing list keeps it (EvalHeader.good), and so does every interface a module puts in the basis (EvalModule.good)

Finite maps

The domains of the bindings

Top-level declarations

Headers

ME0 and the harness

StandardElmMech/Mod/A25.lean

A25: the module x = let f _ = x in f () has no meaning (a25_no_value, a25_no_meaning), by the loop of the evaluator forcing x's thunk (a25_loop) and completeness

  • a25T_eq term proof
  • appVal_wild_out tactic proof
    Applying a closure whose pattern is _ evaluates its body, two fuel levels down.
  • appVal_wild tactic proof
  • a25_step tactic proof
    One turn of the loop: forcing at fuel M + 14 comes back to forcing at M + 6.
  • a25_loop tactic proof
    The evaluator runs out of fuel forcing the thunk, at every fuel.
  • a25_force_out tactic proof
    Forcing x's thunk, in the environment the group's value binding gives, never ends.
  • thunkGroup_a25 term proof
  • a25_no_value tactic proof
    A25: a delayed self-reference forced during its own evaluation has no result: the module x = let f _ = x in f () has no meaning, in any basis.
  • a25_no_meaning tactic proof
    A25: a program whose first module is x = let f _ = x in f () has no meaning.

StandardElmMech/Mod/Rulings.lean

A82, A38 and A28 on programs written by hand

StandardElmMech/Lib/Library.lean

The core library values written in Elm (plans/library-elm-texts.md): libME, the interfaces Chapter 7's rules give the library modules of Generated/Library.lean, evaluated in order in ME0 (libME_eval: each module's derivation by r:dm-module, from the evaluator's soundness); Lib.Btest, the dynamic test basis with the library (Mod.Btest libME), in which the view programs' theorems are stated. Only a value a program looks up is evaluated

  • evLibModule_sound tactic proof
  • libCheck_sound term proof
  • libME_eval kernel-checked (decide +kernel)
    The library modules, evaluated in order in ME0 by Chapter 7's rules (r:dm-module and the rules of its premises), have the interfaces libME binds: the analogue, for the core library, of elmTexts_eval and me0_PlatformCmd_none_eval.
  • libME_modules term proof
    The modules the library extends, in order.

StandardElmMech/Mod/Program.lean

A test program in module form (plan step 3): Appendix A's derived form for modules (Module.ofSource: the custom types, the aliases, the ports, then the definitions in components), a program's modules in program order; ViewChecks and NoMeaning with their deciders proved sound; viewChecks_every

The statements

  • viewChecks_sound tactic proof
  • noMeaning_sound tactic proof
  • viewChecks_every tactic proof
    When the evaluator reads no choice, the checks hold of every derivation's log, not only of some (from evProgram_unique_l): the existential of D9 is then also universal.

StandardElmMech/Prog/Objects.lean

Chapter 9's objects of execution (plan step 5): port environments, processes, configurations, events, SleepReady

StandardElmMech/Prog/Dispatch.lean

Dispatch (4 rules, r_p_disp_*) and the executable dispatchFn with fresh identifiers, sound

StandardElmMech/Prog/Rules.lean

The start of a program (Start, r:p-init, with Flags_τ, A72 and A77), the 12 transition rules (Step, r_p_*), the messages of an accepted value (AcceptMsgs), their logged twins, forget and lift

The logged relations are the book's with a log

StandardElmMech/Prog/Exec.lean

Hosts (any, none, the test runner's echo), executions with and without logs, a worker's executions (WorkerExec, its log as D9 defines it), traces and Tr (tr_nil, tr_prefix, tr_empty_iff_no_start)

  • ExecL.forget term proof
  • Exec.lift term proof
  • WorkerExecO.exec tactic proof
  • tr_nil tactic proof
    With the book's host, an execution with no step has the empty trace: a program that starts has the empty trace.
  • tr_empty_iff_no_start tactic proof
    A program has no trace exactly when it does not start.
  • exec_take term proof
    Every prefix of an execution under the book's host is an execution.
  • trace_take_prefix tactic proof
  • tr_prefix tactic proof
    Tr is closed under prefixes (sec:programs-behaviour: every finite prefix of transitions is an execution).

StandardElmMech/Prog/Sched.lean

The default scheduler (run): one choice per iteration, overridable per test, each transition proved by doChoice_sound; run_sound: every run is an execution

Helpers, each with its soundness

Soundness

StandardElmMech/Prog/Worker.lean

Worker tests: WorkerTest.Holds (some execution the book allows, under the test's host, has a log meeting every check), runWorker (evaluate the modules, start, run the scheduler), runWorker_sound, holds_of_run

StandardElmMech/Prog/Guarantees.lean

The guarantees of A86: a86_step (messages handled one at a time, in queue order, every other step keeps the model and only appends messages) and a86_out_fifo (each outgoing port delivers its values in the order they were queued)

  • a86_step tactic proof
    Messages are handled one at a time, by r:p-update, in queue order, each update applying update to the model of the previous one; every other step keeps the model and only appends to the queue.

Outgoing queues

  • OutQ.get_fmPlus_same tactic proof
  • OutQ.get_fmPlus_other tactic proof
  • dispatch_outq tactic proof
    Dispatch only appends to a queue.
  • step_outq tactic proof
    Each step either delivers the head of p's queue on p, or delivers nothing on p and only appends to p's queue.
  • a86_out_fifo tactic proof
    The values of each outgoing port are delivered in the order in which they joined its queue: over any execution, what is delivered on p, followed by what remains queued, is what was queued at the start followed by what each step appended, in step order.

StandardElmMech/Prog/Rulings.lean

The rulings A62, A72, A77, A79, A80 and A81 as theorems, and a66_batch_order_open: a program whose batch is delivered in either order

A62: an update with no result ends message handling; other steps go on

  • a62_aux tactic proof
    The invariant of an execution in which the head message has no update: the model is K's and the queue of messages is B (K's queue, whose head is that message) followed by others.
  • a62_no_update term proof
    A62: while the head message has no update, no step changes the model, and every queue of messages begins with the queue at the start.
  • a62_wait_continues tactic proof
    A62: other steps go on; time can always pass.
  • a62B_true kernel-checked (decide +kernel)
  • a62_example tactic proof
    A62, a concrete program: its update has no result, so no update step exists.

A77 and A72: flags

A79: a failing process ends, whatever its origin, and nothing else happens

A80: killing an ended process changes nothing but the killer's own entry

A81: sleep

  • a81_lower tactic proof
    A81: the sleep action is no sooner than max(0, d) after the process reached the sleep.
  • a81_any_later tactic proof
    A81: no upper bound: whenever the sleep is due by some later time, it can happen then.
  • a81_nonfinite tactic proof
    A81: no condition for a non-finite delay.

A66: the order of a batch's leaves is open (the "no other guarantee" of A86)

StandardElmMech/Prog/Invariant.lean

CHECK-NOT as a statement about every execution (WorkerTest.HoldsNot), per-test invariants (TestInv, TestInv.sound, holdsNot_any), and the determinism and inversion lemmas they use

The statement

Invariants

Results of the evaluator, checked by the kernel

Shapes of values, checked by the kernel

Inversions

StandardElmMech/Prog/T1.lean

Finding T1: an execution of StandardA81SleepBeyond32BitsTest the book allows that logs the line its CHECK-NOT forbids (t1_a81_long_sleep_may_end)

  • t1Check_true kernel-checked (decide +kernel)
  • t1_a81_long_sleep_may_end tactic proof
    Finding T1: r:p-wait lets 3e9 ms pass before the 200 ms sleep's action is taken; then the long sleep's action is ready, and the process logs before it is killed.

StandardElmMech/Src/Graph.lean

Reachability on graphs over 0 .. n-1 (Plus, Reach) and its decider, proved correct (plusB_iff, reachB_iff)

Counting the members of filters

Facts about growing

StandardElmMech/Src/Restrictions.lean

The 27 syntactic restrictions decidable on a syntax tree, each a Prop as the book states it, decidable; ModuleOK, ProgramOK, SynOK, ModulesSynOK

Deciders

StandardElmMech/Src/GroupingProof.lean

components_valid: the canonical grouping is one the book allows (ValidNumbering)

Mutual reachability

The reach table

The classes partition `range n`

Among the unplaced classes one is ready

Placing

The canonical grouping is valid

StandardElmMech/Src/AliasOrderProof.lean

aliasOrder_valid: the canonical order of aliases is one the book allows

StandardElmMech/Src/DerivesTo.lean

The derived forms as the book states them, a relation (DerivesE, DerivesTo), and derive_derivesTo

Modules

StandardElmMech/Src/SynSet.lean

The restrictions of the set of a program's modules (SynOKSet) and the refusals of every order

Refusals whatever the order

StandardElmMech/Stat/Objects.lean

The static semantic objects (plan step 9): type variables with their classes, row variables, type names, types, rows, schemes, type functions, environments, contexts, static bases

Rows

Well-formedness

StandardElmMech/Stat/FMap.lean

Finite maps for the static semantics (association lists, first occurrence wins), with their lemmas

StandardElmMech/Stat/Subst.lean

Substitutions, the classes and their meets, admissible types (Adm, adm_iff, adm_mono)

Admissible types (fig:static-core-admissible)

Group 1: classes

StandardElmMech/Stat/Schemes.lean

Type functions, schemes and their canonical form, instances (Gen, genAt), explicit variables (NewFor), closure (closGroup, A93)

Binding variables to types

Explicit type variables (sec:static-core-explicit)

StandardElmMech/Stat/Deterministic.lean

The deterministic parts as functions, each sound for its relation: type expressions, imports and exposing, type declarations given their names (checkTypes), ports

Type expressions

Exposing lists and imports

Type declarations, given the type names they generate

StandardElmMech/Stat/Annotated.lean

Annotated phrases (D10: a derivation is a phrase with the objects its rules choose) and the checker (checkExp, checkModule, checkProgram)

The types at the nodes

The checker

Modules

StandardElmMech/Stat/CheckSound.lean

The checker is sound: a phrase that checks has a derivation by the rules of Chapters 4 and 5 (checkExp_sound, checkModule_sound)

Patterns

Expressions

Modules

StandardElmMech/Stat/Principal.lean

Instances of derivations, principal derivations of phrases and modules, InferPrincipalFor (D11: what the inference returns is principal)

The Core (sec:static-core-principal)

StandardElmMech/Stat/PatternsProof.lean

The pattern decider is correct: every type is inhabited (inhabited), useful_spec, exhDec_sound, irrDec_sound

Typed patterns

Inhabitants: construction and decomposition

A97: every type has an inhabitant

Rows of patterns and vectors of inhabitants

Specialisation and the default matrix

Small facts the induction uses

The three cases of a wildcard

Usefulness is decided

The deciders

The further restrictions of a derivation, decided

StandardElmMech/Stat/Legal.lean

The master theorems: a program whose inferred derivation checks, meets the further restrictions and gives main a Chapter 9 type is legal, under D11 (legal_of_infer1, legal_of_infer)

The conditions of Chapter 9, decided

One-module programs

Programs of several modules

StandardElmMech/Stat/Refusals.lean

Refusals (milestone 9d): inversion of Chapter 9's rules, and the lemmas that turn "no derivation checks", "no derivation meets the further restrictions" or "no derivation gives main a Chapter 9 type" into ¬ LegalProgram, with no hypothesis about principality

Inversion of the rules of Chapter 9

The refusals

StandardElmMech/Stat/RefuseScope.lean

Refusals by scope, constructor arity and imports, for one module and for a module after a helper (scopeFailB)

Arities

Finite maps

Sound value environments and the extension of shapes

The keys of the value environments of patterns and bindings

The bare checker is sound

Top-level declarations

One module: the shape of a concrete import context

The context of a provider map binds only what the map provides

Skeletons of interfaces: what the elaboration of imports reads of them

The skeleton of a module's interface is the same in every derivation

Two modules: the second module's imports, or its body, fail for every derivation of the first

StandardElmMech/Stat/RefuseTypes.lean

Refusals by type expressions (aliases, constructor arguments, annotations, ports) and by the type of main (typesFailB, mainFailB), for every choice of generated names and variable sorts

Renaming type names

Simulation of the elaboration of type expressions

Lookups in modified contexts

The abstract context

Sorts of the new variables of an annotation

Type declarations

Annotations and ports

The module's declarations

The type of `main`

StandardElmMech/Stat/RefuseAll.lean

The refusal deciders certify tries, and the refusals of step 8's syntactic restrictions for one-module programs and texts without main

  • synOK_of_modules tactic proof
    SynOK reads only the modules of a program.
  • not_synOKSet_of_one tactic proof
    A program of one module has one order: if it breaks the restrictions, it is refused (step 8 refuses such a program in its canonical order only).
  • not_legal_of_syn_one term proof
    The refusal of a one-module program step 8 refuses in its canonical order.
  • modulesSynOK_of_synOK term proof
  • not_legal_of_modsyn tactic proof
    A text without main (a module tested alone) that breaks a restriction other than res:program-main, whatever the order of its modules.
  • not_legal_of_modsyn_one tactic proof
    The same for a text of one module that step 8 refuses in its canonical order.

StandardElmMech/Stat/CopyLoop.lean

The copy loop terminates within 2^k + 1 rounds, makes the least set of copies closed under requests, at most 2^k (copyLoop_fuel, copyLoop_least, copies_le_pow)

Assignments

`dedupFirst`

`translateAll`

One round

The invariant

  • keys_append tactic proof
  • copyLoop_inv term proof
    What the loop returns: every pending and made assignment is made; the made ones are the least set closed under requests above the pending and made ones; and they are closed when the made ones' requests are pending or made.
  • copyLoop_least tactic proof
    The copies made: the least set of assignments that contains the initial ones and is closed under the requests of the copies it contains (sec:dynamic-core-numbers, A59, A87).

Fuel and the number of copies

  • copyLoop_lengths term proof
    The loop's invariant on lengths: made assignments are distinct and of length k.
  • copyLoop_fuel term proof
    With fuel 2^k + 1 the loop does not run out of fuel unless a translation fails.
  • copies_le_pow tactic proof
    At most 2^k copies (the book's finiteness remark), and distinct.

StandardElmMech/Stat/Pipeline.lean

SpecOf, DynOf (in Lib.Btest for a view, Mod.Btest [] for a worker: dynBasis), ProgramSem (r:p-program), D11For; copy names, payload types and main (copyName_inj, toPTy_isSome_iff, mainKind_worker_iff, mainKind_view_iff); the pipeline theorems (specOf_of_endToEnd, programSem_of_legal)

Copy names

Payload types and `main`

The pipeline

Values of Part I's programs

StandardElmMech/Stat/RenameCounterexample.lean

Two principal derivations of one program that specialisation once told apart (finding of 2026-11-12), kept as a regression theorem (ce_equal)

  • ceSwap_apply term proof
  • ceSwap_inj tactic proof
  • ceSwap_cls tactic proof
  • renameSecond_erase tactic proof
  • ce_checks kernel-checked (decide +kernel)
    Both check, in the bases they build from the test basis.
  • ce_erase kernel-checked (decide +kernel)
    The inferred derivation is a derivation of the program.
  • ce_progDeriv term proof
  • ce_equal kernel-checked (decide +kernel)
    With the fix, the two principal program derivations give the same reduced program.

StandardElmMech/Stat/DupValuesCounterexample.lean

Two derivations with the same nodes that differ only in an instance specialisation once read through a scope the checker disagrees with (a module with two top-level x); specialisation now reads instances off the occurrence's type (same)

  • not_valuesDistinct tactic proof
    The program breaks res:modules-values-distinct.
  • facts kernel-checked (decide +kernel)
    Both are derivations of the program, and generate no type name.
  • nodes_eq kernel-checked (decide +kernel)
    Their nodes are equal.
  • same kernel-checked (decide +kernel)
    Specialisation gives the same for both: no reduced program (x's instance is not a number).

StandardElmMech/Stat/SpecExamples.lean

The rulings on small programs: A27 (a free number is Float, annotations bind), A87 (the default copy is made), A93 (vacuous variables), polymorphic recursion, copy names, abs$Int, exposing items, payload types, kinds of main, eight copies, renaming invariance, record-pattern copies

A27: a free `number` is Float; a variable bound by an annotation is not defaulted

  • a27_float_default kernel-checked (decide +kernel)
    A27 (revised 2026-11-10; dynamic-core, "Defaulting of number"): the number of 2 ^ -1 is fixed by nothing, so it is Float, and both integer constants (2, and the 1 of the derived Basics.negate 1) are constants at Float.
  • a27_annotation_bound kernel-checked (decide +kernel)
    A27 (clarification of 2026-11-10), dynamic-core's f/g example: the number of x is bound by f's annotation, not by the closure of g, and is not defaulted.

A87: the default copy is always made; a variable the declaration does not quantify

  • a87_default_copy_made kernel-checked (decide +kernel)
    A87 (with A27 and A59), dynamic-core's check/x example: main uses x only at Int, yet the default copy x (at Float, where 2 ^ -1 is 0.5 and check reaches Debug.todo) is emitted beside x$Int; each copy of x uses the copy of check at its own assignment, and its constants are at its own type.
  • a87_vacuous_inner kernel-checked (decide +kernel)
    A87, A43, A27 (dynamic-core, after the check example): the number of 2 ^ -1 (and of the 0 it is compared with) is not mentioned by the type of y, so it is not a variable of the declaration: no closure generalises it, and it is Float in every copy of y, y$Int included.

A93: a `number` variable of a group that one binding's type does not mention

  • a93_mutual kernel-checked (decide +kernel)
    A93 (option (b), with A27's Float default; dynamic-core, "Every binding of a declaration quantifies all the variables of class number of the declaration"): f's type does not mention the number variable b of g's y, but f's scheme quantifies it; at f 3 nothing fixes it, so it is Float, as are n's and the result's, which f 3 leaves free.
  • a93_vacuous_witness kernel-checked (decide +kernel)
    A93's example with the instance of the vacuous variable at f 3 set to Int by hand in the annotated phrase that inference gives (where it is a free number variable, which the book's principal derivation does not determine): the reduced program is the same, a93_mutual's.

The choices of the plan

  • spec_polyrec kernel-checked (decide +kernel)
    Polymorphic recursion through an annotation (dynamic-core: "even when a binding is used recursively at an instance other than its own"; Choices, items 4 and 5): main uses f at Int; inside f$Int, f 1.5 is an occurrence at Float, so f$Int requests the default copy f.
  • spec_two_vars_order kernel-checked (decide +kernel)
    The canonical order of a declaration's number variables is their first occurrence in the bindings' types (Choices, item 2), not the order of their names: numberb occurs before numbera, so the copy at numberb = Int, numbera = Float is r$Int$Float, where x + 1 takes 1 at Int and y + 1 at Float.
  • spec_basis_abs kernel-checked (decide +kernel)
    A value of the basis written in Elm (abs, Appendix D) is copied like a program's: its occurrences at Int, unqualified and qualified, refer to abs$Int and Basics.abs$Int, and the exposing item abs of the import stands for abs, abs$Int (sec:dynamic-modules-reduced).
  • spec_exposing kernel-checked (decide +kernel)
    Copies across modules (sec:dynamic-modules-reduced): A makes f$Int because Main requests it (modules are specialised last to first); A's header item f and Main's import item f each stand for f, f$Int.
  • spec_rename_invariant kernel-checked (decide +kernel)
    An instance of reduceProgram_rename (the invariance lemma: specialisation reads a type only through what a renaming preserves, Choices, item 2): the annotated program inference gives for spec_exposing, renamed by swapFresh, reduces to the same program.
  • spec_rename_invariant_a93 kernel-checked (decide +kernel)
    The same on A93's example, whose group's number variables are fresh ones (the instance at f 3 is renamed), so that the canonical order of the variables and the copies are read through the renaming.
  • spec_port_payload kernel-checked (decide +kernel)
    A port keeps its direction and payload type as elaboration records them (sec:dynamic-modules-reduced): the alias is expanded and the record's fields are sorted by label.
  • spec_main_kinds kernel-checked (decide +kernel)
    The kind of a program and its flags type, from the scheme of main (r:p-stat-main-view, r:p-stat-main-program; mainKind): a view, whose flags type is not read and is () (Choices, item 1; Translator changes, item 3); a worker whose flags type () its init fixes; a worker whose flags type Int its annotation fixes.
  • spec_copy_bound kernel-checked (decide +kernel)
    The bound of dynamic-core ("a declaration with k variables of class number has at most 2^k copies"), reached: three variables used at all eight assignments give eight copies, the default copy first and then the others in the lexicographic order of their assignments, Float before Int (Choices, item 4), whatever the order of the uses.
  • spec_record_pattern_copy kernel-checked (decide +kernel)
    A copy of a destructuring binding with a record pattern (ruling A99, which closes step 10's Issues, item 4): x is used at Int, so the binding has its default copy { x = x } = { x = 1 } at Float and the copy at Int { x = x$Int } = { x = 1 }, which binds the new variable x$Int to the same field x; the use refers to the copy at Int.

StandardElmMech/Stat/Complete/Discharge.lean

Step 11, milestone (g): Stat.wCheck, legal_of_W, ident_of_wCheck, programSem_of_wCheck (D11 discharged test by test), not_legal_of_wMainVar (A96's flags refusal), principalExistsCore_of_covers, principalExistsMod_of_covers, d11For_of_agree; Lean's pipeline with W, endToEndW (step 10's endToEnd with W in place of step 9's inference), with endToEndW_of_wCheck (the per-test spec_ from wcheck_, without a second run of the inference), specOf_of_endToEndW, ident_of_endToEndW, programSem_of_endToEndW (step 10's statements, without D11); wCheckIn, wCheck_of_ctx (the W check of a one-module program with the context of its imports given by a lemma ctx_<name>_eq, so the kernel does not compute it per test: an end-to-end shard of 20 tests takes 32 s instead of 98 s)

The check

Legality, the specialisation of the program, its meaning

  • legal_of_wCheck tactic proof
    Step 9's legality, without hypothesis: the program is legal when W's derivation of it passes the checks.
  • specOf_of_wCheck tactic proof
    The reduced program the check names is a specialisation of the program.
  • typesOrdered_of_inferProgramW term proof
    Every module W elaborates has ordered type declarations.
  • ident_of_wCheck tactic proof
    Step 10's ident_X, without hypothesis: the specialisation of the program is unique, and is the reduced program the check names.
  • programSem_of_wCheck tactic proof
    Step 10's mean_X, without hypothesis: r:p-program with both premises, from the check and a value of the reduced modules (Part I's t_X).
  • legal_of_W term proof
    The per-test forms, in the test basis.
  • finish_eq_In tactic proof
  • inferModuleW_eq_In tactic proof
  • wCheck_of_ctx tactic proof
    A check with the context given is the check.
  • endToEndW_ok tactic proof
    What a successful run of the pipeline with W gives.
  • endToEndW_of_wCheck tactic proof
    A W check that names a reduced program says that the pipeline with W gives it.
  • specOf_of_endToEndW tactic proof
    Step 10's specOf_of_endToEnd for the pipeline with W, without D11: what it gives is a specialisation of the program.
  • ident_of_endToEndW tactic proof
    Step 10's ident_of_spec' for the pipeline with W, without D11: the specialisation of the program is unique, and is what the pipeline with W gives.
  • programSem_of_endToEndW tactic proof
    Step 10's programSem_of_legal for the pipeline with W, without D11.

A96: flags of a type variable (StandardA96NumberFlagsTest)

StandardElmMech/Theorems.lean

The command #mod_program_theorems (one theorem per program, in module form, in Lib.Btest; tagged [library] when the program names a core library value), budgetNative, the rulings stated directly, and theorems that D1 makes possible (a43_one_unique, a51_one_choice, log_order_demo)

The values of Basics written in Elm (sec:appendix-dynamic-basis-elm)

  • elmText_derivation tactic proof
    A text var atpat1 ... atpatn = exp, not recursive, evaluates in E by r:d-dec-nonrec (with r:d-valbind-var and r:d-exp-lambda) to the closure that InitialBasis.lean binds.
  • elmTexts_nonrec kernel-checked (decide +kernel)
  • elmTexts_eval tactic proof
    Every text of the fragment evaluates in E_K to the value VE_elm binds.
  • never_eval kernel-checked (decide +kernel)
    The text of never (recursive) evaluates in E_K, by r:d-dec-rec, to Rec of its closure.
  • never_value term proof
    ME0 binds never to that value.

Statements that the oracle evaluator makes possible (D1)

  • a43_one_unique kernel-checked (decide +kernel)
    A43: 1 ^ -1 has the value 1 and no other: the evaluator reads no choice, so by nostuck every derivation gives it.
  • a51_one_choice kernel-checked (decide +kernel)
    A51: (\x -> x) == (\x -> x) reads exactly one choice of the oracle, whichever it is.
  • log_order_demo kernel-checked (decide +kernel)
    D4: Debug.log "a" 1 + Debug.log "b" 2 logs a then b in the logged relation's order, one of the orders the book allows (A58).

The rulings, stated directly (kernel-checked)

  • a43_one kernel-checked (decide +kernel)
    A43: 1 ^ -1 is 1 (eco: 0).
  • a43_minus_one_odd kernel-checked (decide +kernel)
    A43: (-1) ^ -3 is -1 (eco: 0).
  • a43_minus_one_even kernel-checked (decide +kernel)
    A43: (-1) ^ -2 is 1 (eco: 0).
  • a43_apply_singleton tactic proof
    A43: APPLY(pow, 1, -1) = {1}: the set has one member, so the definition gives no other value for 1 ^ -1 at this step.
  • a42_idiv kernel-checked (decide +kernel)
    A42: 3 // 0, modBy 0 3 and remainderBy 0 3 are all 0.
  • a42_modBy kernel-checked (decide +kernel)
  • a42_remainderBy kernel-checked (decide +kernel)
  • a48_float native_decide (trusts the compiled evaluator)
    A48: at floats APPLY(max) and APPLY(min) are IEEE 754-2019 maximum and minimum, whatever the order of the arguments: NaN when either is NaN, +0 for max and -0 for min of the two zeros.
  • a48_int_max kernel-checked (decide +kernel)
    A48: at Int, max and min give the elm/core text's result (kernel-checked).
  • a48_int_min kernel-checked (decide +kernel)
  • a49_apply_float native_decide (trusts the compiled evaluator)
    A49: at floats APPLY(clamp, lo, hi, x) is min (max x lo) hi with the IEEE 754-2019 minimum and maximum: hi when lo > hi, NaN when any argument is NaN, +0 for clamp 0 1 -0.
  • a49_float_lo_gt_hi native_decide (trusts the compiled evaluator)
    A49 through the rules: clamp 10 0 5 at Float evaluates to +0 (hi), by r:d-app-basic-partial and r:d-app-basic-apply with APPLY(clamp). [native]
  • a49_float_nan_bound native_decide (trusts the compiled evaluator)
    A49: clamp nan 1 0.5 at Float evaluates to NaN. [native]
  • a49_float_signed_zero native_decide (trusts the compiled evaluator)
    A49: clamp 0 1 -0 at Float evaluates to +0. [native]
  • a49_int_lo_gt_hi kernel-checked (decide +kernel)
    A49: at Int, clamp gives the elm/core text's result: clamp 10 0 5 is 10 (lo, since 5 < 10), kernel-checked.
  • a49_int_apply_singleton tactic proof
    A49: APPLY(clamp, 10, 0, 5) = {10} at Int: the set has one member.
  • a51_true kernel-checked (decide +kernel)
    A51: (\x -> x) == (\x -> x) evaluates to True ...
  • a51_false kernel-checked (decide +kernel)
    ... and to False: both results are derivable.
  • a44_conversions native_decide (trusts the compiled evaluator)
    A44: the conversions to Int at 2.5, -2.5, NaN, the infinities and 1e300, in that order: round rounds a half upward (x + 1/2 exact), and every conversion saturates into [-2^63, 2^63 - 1], NaN giving 0.
  • a44_round_minus_half native_decide (trusts the compiled evaluator)
    A44: round -2.5 is -2, by the rules from E0. [native]

Generated at compile time

  • kc_<Shard>_<n> kernel-checked (decide +kernel)
    1907 theorems made by the command #kernel_checks, one per check of a translated test that the kernel can compare.

StandardElmMech/Generated/ChecksElm.lean

The theorems of the translated tests of shard Elm: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElmCore.lean

The theorems of the translated tests of shard ElmCore: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_ElmCore kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElmCore_CompareI.lean

The theorems of the translated tests of shard ElmCore_CompareI: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_ElmCore_CompareI kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElmCore_CoreIssue115.lean

The theorems of the translated tests of shard ElmCore_CoreIssue115: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_ElmCore_CoreIssue115 kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElmCore_FloatD.lean

The theorems of the translated tests of shard ElmCore_FloatD: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_ElmCore_FloatD kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElmCore_FloatSu.lean

The theorems of the translated tests of shard ElmCore_FloatSu: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_ElmCore_FloatSu kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElmCore_NotEqualBoolP.lean

The theorems of the translated tests of shard ElmCore_NotEqualBoolP: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_ElmCore_NotEqualBoolP kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElmCore_StandardA42.lean

The theorems of the translated tests of shard ElmCore_StandardA42: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_ElmCore_StandardA42 kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElmCore_TaskOnErrorS.lean

The theorems of the translated tests of shard ElmCore_TaskOnErrorS: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_ElmCore_TaskOnErrorS kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_Ap.lean

The theorems of the translated tests of shard Elm_Ap: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_Ap kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_As.lean

The theorems of the translated tests of shard Elm_As: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_As kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_CaseF.lean

The theorems of the translated tests of shard Elm_CaseF: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_CaseF kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_CaseS.lean

The theorems of the translated tests of shard Elm_CaseS: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_CaseS kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_CharU.lean

The theorems of the translated tests of shard Elm_CharU: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_CharU kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_CombinatorL.lean

The theorems of the translated tests of shard Elm_CombinatorL: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_CombinatorL kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_CombinatorP.lean

The theorems of the translated tests of shard Elm_CombinatorP: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_CombinatorP kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_CombinatorSP.lean

The theorems of the translated tests of shard Elm_CombinatorSP: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_CombinatorSP kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_CompilerIssue22.lean

The theorems of the translated tests of shard Elm_CompilerIssue22: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_CompilerIssue22 kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_CovTailRecPairParameters.lean

The theorems of the translated tests of shard Elm_CovTailRecPairParameters: one generated theorem per check the kernel can compare, and the derivability of every check

StandardElmMech/Generated/ChecksElm_EmbeddedNo.lean

The theorems of the translated tests of shard Elm_EmbeddedNo: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_EmbeddedNo kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_Fli.lean

The theorems of the translated tests of shard Elm_Fli: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_Fli kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_ImportE.lean

The theorems of the translated tests of shard Elm_ImportE: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_ImportE kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_InfixPrecO.lean

The theorems of the translated tests of shard Elm_InfixPrecO: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_InfixPrecO kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_LetN.lean

The theorems of the translated tests of shard Elm_LetN: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_LetN kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_LetNumberLo.lean

The theorems of the translated tests of shard Elm_LetNumberLo: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_LetNumberLo kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_Li.lean

The theorems of the translated tests of shard Elm_Li: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_Li kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_M.lean

The theorems of the translated tests of shard Elm_M: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_M kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_PartialAppCh.lean

The theorems of the translated tests of shard Elm_PartialAppCh: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_PartialAppCh kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_PortEchoN.lean

The theorems of the translated tests of shard Elm_PortEchoN: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_PortEchoN kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_RecordAccessorFunctionT.lean

The theorems of the translated tests of shard Elm_RecordAccessorFunctionT: one generated theorem per check the kernel can compare, and the derivability of every check

StandardElmMech/Generated/ChecksElm_SingleCtorPairBoolF.lean

The theorems of the translated tests of shard Elm_SingleCtorPairBoolF: one generated theorem per check the kernel can compare, and the derivability of every check

StandardElmMech/Generated/ChecksElm_StandardL.lean

The theorems of the translated tests of shard Elm_StandardL: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_StandardL kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksElm_TailRecT.lean

The theorems of the translated tests of shard Elm_TailRecT: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Elm_TailRecT kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

StandardElmMech/Generated/ChecksWorker01.lean

The theorems of the translated tests of shard Worker01: one generated theorem per check the kernel can compare, and the derivability of every check

  • ports_canon_Worker01 kernel-checked (decide +kernel)
    Every port of every program of this shard, its helper modules' included, has a canonical payload type (D7).

A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.