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
e6983f21
Commit
e6983f21
authored
2 years ago
by
arthur-adjedj
Browse files
Options
Downloads
Patches
Plain Diff
feat(kernel): allow printing of universe-polymorph functions with unbound universes
parent
96bf6104
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
kernel/src/command.rs
+6
-0
6 additions, 0 deletions
kernel/src/command.rs
kernel/src/declaration.rs
+5
-0
5 additions, 0 deletions
kernel/src/declaration.rs
kernel/src/environment.rs
+8
-0
8 additions, 0 deletions
kernel/src/environment.rs
kernel/src/universe.rs
+4
-0
4 additions, 0 deletions
kernel/src/universe.rs
with
23 additions
and
0 deletions
kernel/src/command.rs
+
6
−
0
View file @
e6983f21
...
...
@@ -25,6 +25,12 @@ impl Command {
Command
::
CheckType
(
t1
,
t2
)
=>
t1
.check
(
&
t2
,
env
)
.map
(|
_
|
None
),
// This is only a temporary workaround. Once metavariables will be part of the system,
// there won't be any issue with checking/infering with a term with non-unified metavariables
Command
::
GetType
(
Term
::
Const
(
s
,
vec
))
if
vec
.is_empty
()
=>
{
env
.get_type_free_univ
(
&
s
)
.map
(
Some
)
}
Command
::
GetType
(
t
)
=>
t
.infer
(
env
)
.map
(
Some
),
Command
::
Eval
(
t
)
=>
Ok
(
Some
(
t
.normal_form
(
env
)
?
)),
...
...
This diff is collapsed.
Click to expand it.
kernel/src/declaration.rs
+
5
−
0
View file @
e6983f21
...
...
@@ -37,6 +37,11 @@ impl Declaration {
}
}
/// Returns the type linked to a definition in a given environment.
pub
fn
get_type_free_univ
(
&
self
)
->
Term
{
self
.ty
.clone
()
}
/// Returns the term linked to a definition in a given environment.
/// Since the declaration might be an axiom, it might not have an associated term to reduce to, hence the Option.
pub
fn
get_term
(
&
self
,
vec
:
&
[
UniverseLevel
])
->
Result
<
Option
<
Term
>
,
KernelError
>
{
...
...
This diff is collapsed.
Click to expand it.
kernel/src/environment.rs
+
8
−
0
View file @
e6983f21
...
...
@@ -49,4 +49,12 @@ impl Environment {
None
=>
Err
(
KernelError
::
ConstNotFound
(
s
.clone
())),
}
}
/// Returns the type linked to a definition in a given environment.
pub
fn
get_type_free_univ
(
&
self
,
s
:
&
String
)
->
Result
<
Term
,
KernelError
>
{
match
self
.0
.get
(
s
)
{
Some
(
decl
)
=>
Ok
(
decl
.get_type_free_univ
()),
None
=>
Err
(
KernelError
::
ConstNotFound
(
s
.clone
())),
}
}
}
This diff is collapsed.
Click to expand it.
kernel/src/universe.rs
+
4
−
0
View file @
e6983f21
...
...
@@ -87,6 +87,10 @@ impl UniverseLevel {
format!
(
"{} + {}"
,
u
.pretty_print
(),
n
)
}
Max
(
box
n
,
box
m
)
=>
format!
(
"max ({}) ({})"
,
n
.pretty_print
(),
m
.pretty_print
()),
IMax
(
box
_
,
box
Zero
)
=>
"Zero"
.into
(),
IMax
(
box
n
,
box
m
@
Succ
(
_
))
=>
{
format!
(
"max ({}) ({})"
,
n
.pretty_print
(),
m
.pretty_print
())
}
IMax
(
box
n
,
box
m
)
=>
format!
(
"imax ({}) ({})"
,
n
.pretty_print
(),
m
.pretty_print
()),
Var
(
n
)
=>
format!
(
"u{}"
,
n
),
},
...
...
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