Repository navigation
Models of the operations other than strings that agree with each language - #172
Merged
Merged
Conversation
… the aliases of a translated function
… them, and refuse functions that the flags, attributes, or pragmas change
…nts in checkModel
…nd compare the models of the operations with JavaScript
…conditions A literal of a fixed-width type wraps around as in Lean, and the bounds beyond 2^53 are exact.
- float64 products outside float64(...) and sums of unrounded operands are refused, since Go fuses them on arm64 and with GOAMD64=v3. - Fields of the Lean types Char, Fin, USize, ISize, and of definitions that unfold to a type, are read as values of the Go type. - Models name constants from the root, so that a Go function cannot take the place of one, and a method is no enum constructor. - Constants and types that another build may define otherwise are refused, and a function that names a declaration in a file with build constraints replaces no spec. - All panics and endless loops are one failure, since Go leaves their order open.
…d doubles, and test boundary values
…om tests, and test functions that differ from their spec there
…tegers in random tests, and tell 0.0 from -0.0
…value the model does not have
…d coercions of a block do not replace them
…nd type attributes, and document the checks
… with every validator
…15186-thr_h7fkgc2qif
…, and keep the functions that use them
…he decoders read, and read integral JSON numbers A UInt64 and a USize are the pattern of the decimals of their range and of their conditions, as in C. The decoders read only those decimals, and read 1.0 and 1e2 as integers, as JSON Schema does. TypeScript keeps the bounds of the type where a condition is looser, and wraps the literals of its fixed-width types.
…ince a block may not add coercions between standard types
…ntegral numbers of JSON
…15186-thr_h7fkgc2qif # Conflicts: # docs/c-development.md # docs/c-guide.md # langs/C/LeanC/Embed/Verify.lean # langs/C/LeanC/Verify/Translate.lean # langs/C/tests/verify/translation/unsupported.c # langs/C/tests/verify/translation/unsupported.txt # langs/Rust/crates/leanfran-macros/src/model.rs # langs/Rust/tests/verify/test.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make every non-string operation that the seven
translates accept either return the same value and the same failure as the language for every value of the model's types, or leave the functionunextracted.tests/ops, Pythontests/ops, TypeScripttest/verify/values.mjs, Clojurecore_model_test/refused_test, PHPtests/Verify/operations.php, Gotestdata/verify/operations, Cmaint/C/test-translate.sh), and has fixtures of the refused forms with their reasons.ensures, endless loops proved byrfl(Python, PHP, TypeScript),assertunderpython -O, reference equality of TypeScript arrays, FMA contraction in Go, enumerators and-fshort-enumsin C,Drop,cfg!andget_mut(i..)in Rust,Option Booltruthiness and NaN keys in Clojure, and names of functions that capture Lean names in every language.Leanfran.Checkleaves a functionunextractedwhen a Lean block or another module of the project changes how Lean reads its translation: a macro or an elaborator for syntax of Lean, a syntax that starts like a syntax of Lean, or an instance that replaces a coercion of Lean (tests/lean/LeanfranTest/Syntax.lean).mismatchwith the default runs and seed.UInt64/USizepattern of C, Go and TypeScript accepts exactly the strings that their decoders read.Assisted-by: Claude Code