Added a reifiction function for modular reification without pmaps.#102
Added a reifiction function for modular reification without pmaps.#102jesper-bengtson wants to merge 18 commits intomasterfrom
Conversation
theories/Reify/ReifyView.v
Outdated
| (rf ++ | ||
| ((Patterns.CVar (@ExprCore.Var typ func)) :: | ||
| (Patterns.CApp (Patterns.CRec 0) (Patterns.CRec 0) (@ExprCore.App typ func)) :: | ||
| (Patterns.CAbs (CCall (reify_scheme typ)) (CRec 0) (@ExprCore.Abs typ func)) :: nil))). |
There was a problem hiding this comment.
Would it make sense to factor out the common code here? Maybe make something that takes both before and after commands and then instantiate it appropriately for both reify_func and reify_func'?
theories/Reify/ReifyView.v
Outdated
| Arguments Reify_func _ _ {_ _} _. | ||
|
|
||
| Arguments reify_func' _ _ {_} _. | ||
| Arguments Reify_func' _ _ {_} _. |
There was a problem hiding this comment.
What are the first two arguments to this function?
|
It would make sense both to refactor the code and to give it a bette name than just adding a prime.
The two first arguments are typ and func, the last is the list of reification rules that are to be wrapped in the CFix. The two implicit arguments are the Reify type class for typ and the partial view to the lookup table (which the primed version lacks).
On 11 Dec 2016, at 03:26, Gregory Malecha <notifications@github.com<mailto:notifications@github.com>> wrote:
@gmalecha requested changes on this pull request.
Tiny bit of cleanup.
________________________________
In theories/Reify/ReifyView.v<#102 (review)>:
Polymorphic Instance Reify_func (rf : list (Command (expr typ func))) : Reify (expr typ func) := {
reify_scheme := reify_func rf
}.
+ Polymorphic Definition reify_func' (rf : list (Command (expr typ func))) : Command (expr typ func) :=
+ @Patterns.CFix (expr typ func)
+ (@Patterns.CFirst_ _
+ (rf ++
+ ((Patterns.CVar (@ExprCore.Var typ func)) ::
+ (Patterns.CApp (Patterns.CRec 0) (Patterns.CRec 0) (@ExprCore.App typ func)) ::
+ (Patterns.CAbs (CCall (reify_scheme typ)) (CRec 0) (@ExprCore.Abs typ func)) :: nil))).
Would it make sense to factor out the common code here? Maybe make something that takes both before and after commands and then instantiate it appropriately for both reify_func and reify_func'?
________________________________
In theories/Reify/ReifyView.v<#102 (review)>:
End ReifyFunc.
Arguments reify_func _ _ {_ _} _.
Arguments Reify_func _ _ {_ _} _.
+
+Arguments reify_func' _ _ {_} _.
+Arguments Reify_func' _ _ {_} _.
What are the first two arguments to this function?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#102 (review)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AE_rNaVgAbpX2eVPP9YQcA3paSMYo-Fiks5rG187gaJpZM4LJ0RJ>.
|
- fixing the Test file.
- NOTE: since type checking was failing, it seems likely that there is an issue with the environments. It would be better to figure out what the problem is and fix it. - we should drop that information entirely
|
This PR is now a lot bigger, it fixes several issue in the plugin. |
| Typeclasses Opaque IgnorePatterns. | ||
|
|
||
| Arguments reify_IgnorePatterns {_} _ {_}. | ||
| *) |
There was a problem hiding this comment.
IgnorePatterns should be moved to another file.
| Require Import MirrorCore.Lib.EqView. | ||
| Require Import MirrorCore.CTypes.BaseType. | ||
| Require Import MirrorCore.Lemma. | ||
| (* Require Import MirrorCore.TCLemma. *) |
| (* This reifies *) | ||
| reify_poly (forall x : nat, True -> True -> x = x -> x = x). | ||
| apply I. | ||
| Qed. |
| type syntax_data = | ||
| { reify : lazy_term -> Term.constr reifier | ||
| ; result_type : Term.constr | ||
| ; result_type : unit (* Term.constr *) |
There was a problem hiding this comment.
The result_type field should be removed entirely.
| (* ++ Printer.pr_constr_env env evm cmd *) | ||
| (* ++ fnl () *) | ||
| (* ++ str "has type" ++ fnl () *) | ||
| (* ++ Printer.pr_constr_env env evm typ) *) |
| let compile_name (prg : Term.constr) = | ||
| let (evm,env) = Lemmas.get_current_context () in | ||
| let typ = get_Command_type env evm prg in | ||
| (* let typ = get_Command_type env evm prg in *) |
| let reify_type (name : Term.constr) = | ||
| let data = get_entry name in | ||
| data.result_type | ||
| *) |
| Eval unfold Lemma.add_var, Lemma.add_prem , Lemma.vars , Lemma.concl , Lemma.premises in | ||
| <:: @eq_refl' ::>. | ||
|
|
||
| Print lem_eq_refl'. |
| Eval unfold Lemma.add_var, Lemma.add_prem , Lemma.vars , Lemma.concl , Lemma.premises in | ||
| <:: @Proper_exists ::>. | ||
|
|
||
| Print lem_Proper_exists. |
| end. | ||
| *) | ||
|
|
||
| Locate ctyp. |
| Qed. | ||
|
|
||
|
|
||
| Locate RewriteHintDb. |
| ; type_cast := ctyp_cast | ||
| ; tyAcc := ctyp_acc }. | ||
|
|
||
| Program Fixpoint ctyp_noVar (c : ctyp) : Prop := |
There was a problem hiding this comment.
Is Program necessary here? It is odd that you didn't need to include anything for it.
|
I should have merged this a while ago, but it needs updates now. |
|
@jesper-bengtson are you developing on 8.5 or have you moved to 8.6? |
No description provided.