Skip to content

feat: Add fixpoints#30

Draft
ontomaquia wants to merge 10 commits intomainfrom
fixpoint
Draft

feat: Add fixpoints#30
ontomaquia wants to merge 10 commits intomainfrom
fixpoint

Conversation

@ontomaquia
Copy link
Collaborator

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2022

Codecov Report

Merging #30 (d82f85b) into main (6f52123) will decrease coverage by 3.76%.
The diff coverage is 11.32%.

@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
- Coverage   45.74%   41.97%   -3.77%     
==========================================
  Files          13       13              
  Lines         811      910      +99     
==========================================
+ Hits          371      382      +11     
- Misses        440      528      +88     
Impacted Files Coverage Δ
lib/castCIC.ml 28.44% <0.00%> (-4.89%) ⬇️
lib/common/gCIC.ml 27.94% <0.00%> (-3.73%) ⬇️
lib/common/std.ml 45.83% <0.00%> (-9.17%) ⬇️
lib/elaboration/cast_CIC.ml 39.44% <0.00%> (-1.37%) ⬇️
lib/main.ml 52.23% <0.00%> (-0.80%) ⬇️
lib/typing/cast_CIC.ml 43.87% <0.00%> (-5.55%) ⬇️
lib/common/castCIC.ml 48.83% <17.64%> (-4.21%) ⬇️
lib/reduction/cast_CIC.ml 48.50% <22.50%> (-5.83%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f52123...d82f85b. Read the comment docs.

{ fix_id : Name.t
; fix_body : term
; fix_type : term
; fix_rarg : int (* index of the recursive argument *)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's link the example in metacoq?

| Ok (HInductive i), Ok (HInductive j) -> i = j
| _, _ -> assert false

let rec is_fix_neutral (t : term) : bool =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add ref to metacoq

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a small explanation as well?

| Universe _ | Unknown (Universe _) | Err (Universe _) | Inductive _ -> true
| _ -> is_neutral term

let is_fix_canonical term : bool =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem, explain a bit?

term, KCast_term (source, target) :: cont
| term, KCast_term (source, target) :: cont when is_canonical term ->
Cast { source; target; term }, cont
| term, KFix_app (fi, args) :: cont when is_canonical term ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add some explanation, we didn't remember it lol

| Match { ind; discr; z; pred; f; branches }, _ ->
discr, KMatch_discr (ind, z, pred, f, branches) :: cont
| Fixpoint fi, cont ->
let rec get_args acc n cont =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem, explain maybe?

type i = (term, errors) result
type c = (unit, errors) result

let fix_guard _term = Ok ()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe leave this one for the next PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants