Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Proost
Manage
Activity
Members
Labels
Plan
Issues
33
Issue boards
Milestones
Code
Merge requests
18
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
loutr
Proost
Commits
47c59414
Commit
47c59414
authored
2 years ago
by
arthur-adjedj
Browse files
Options
Downloads
Patches
Plain Diff
Fix : century-old bug in the type-checker
parent
2f0860c7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/src/term.rs
+14
-0
14 additions, 0 deletions
kernel/src/term.rs
with
14 additions
and
0 deletions
kernel/src/term.rs
+
14
−
0
View file @
47c59414
...
...
@@ -130,6 +130,7 @@ mod tests {
// /!\ most of these tests are on ill-typed terms and should not be used for further testings
use
super
::
Term
::
*
;
use
crate
::
term
::
Environment
;
use
crate
::
universe
::
UniverseLevel
;
#[test]
fn
simple_subst
()
{
...
...
@@ -334,4 +335,17 @@ mod tests {
assert_eq!
(
Const
(
"foo"
.into
())
.beta_reduction
(
&
env
),
id_prop
);
}
#[test]
fn
poly_univ_id
(){
let
id_ty
=
Prod
(
box
Type
(
UniverseLevel
::
Var
(
0
)),
box
Prod
(
box
Var
(
1
.into
()),
box
Var
(
2
.into
())));
let
id_te
=
Abs
(
box
Type
(
UniverseLevel
::
Var
(
0
)),
box
Abs
(
box
Var
(
1
.into
()),
box
Var
(
1
.into
())));
let
id_zero
=
Abs
(
box
Type
(
0
.into
()),
box
Abs
(
box
Var
(
1
.into
()),
box
Var
(
1
.into
())));
assert!
(
id_te
.check
(
&
id_ty
,
&
Environment
::
new
())
.is_ok
());
let
env
=
Environment
::
new
()
.insert
(
"id"
.into
(),
id_te
.clone
()
.into
(),
id_ty
.clone
())
.unwrap
();
assert!
(
Const
(
"id"
.into
(),
vec!
[
0
.into
()])
.is_def_eq
(
&
id_zero
,
&
env
)
.is_ok
())
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment