Repository navigation
Conversation
The checker infers types, reduces terms to weak head normal form and decides definitional equality. The code is a transcription of type_checker.cpp, inductive_reduce_rec and quot_reduce_rec of the official kernel v4.35.0, in the Aeneas subset.
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.
Refers to #3.
Summary
This PR adds the environment and the type checker of engine R to
rulean-core. The code is a transcription oftype_checker.cpp, ofinductive_reduce_recand its helpers ininductive.handinductive.cpp, and ofquot_reduce_recinquot.h, of the official kernel v4.35.0.Changes
env.rs: the constant records ofdeclaration.hand the environment. A lookup returns a slot number and not a reference, because subset rule S10 forbidsOption<&T>.tc.rs: the checker state, the local context, the caches, the sticky fault, the depth bound and type inference in the infer-only mode and in the check mode.whnf.rs:whnf_coreandwhnfin the official order. This includes beta, zeta, projections, recursor iota with K and structure eta for the major premise,Quot.liftandQuot.ind, the 15Natoperations with the size bound, and delta.defeq.rs:is_def_eq_corewith the official order of steps: the quick check, theBool.truereflection step, proof irrelevance, lazy delta reduction with the offset rule, projections, application congruence, eta, structure eta, theStringliteral expansion and unit-like types.tests/tc.rs: 14 tests on small environments that are built by hand.Notes
rulean checkcommand come in the next PRs.Test plan
cargo test -p rulean-corecargo clippy --workspace --all-targets -- -D warningscargo xtask all, which includes the subset checkextractjob in CI