Removing tcast for tuples

自作多情 提交于 2021-01-29 09:16:15

问题


I'm in a bind with a goal equality like this (the details don't matter, I think):

tcast tc0
[tuple of take i (s_bs bs) ++ drop i.+1 (s_bs bs) ++ [:: [ffun⇒ 0]]] 
=
...

How do I get rid of the tcast and tuple to go back to simple seq (I tried the val_inj trick, but this didn't seem to remove the type cast)?

Thanks in advance.

Bye,

Pierre


回答1:


Giving a precise answer is a bit difficult, since you did not provide any reproducible testcase. But you could try rewriting your goal using the following lemma, once you have applied val_inj.

Lemma val_tcast {T} m n (tc : n = m) (x : n.-tuple T) :
  val (tcast tc x) = val x.
Proof. now case tc. Qed.



回答2:


I figured that, at least in the cases I had to handle, a proper use of rewrites using tcastE and tnth_nth (which forced a cast to nat), followed by a partial evaluation via /=, gets rid of the tcast.



来源:https://stackoverflow.com/questions/61684692/removing-tcast-for-tuples

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!