Make automatic termination proof use different size function

南笙酒味 提交于 2019-12-01 04:48:18

问题


I have written a custom size function size2 for my datatype. Using this function I can manually prove the termination of my function:

termination 
apply (relation "measure (λ(a,b,c). size2 c)")
apply auto
done

Is there a way to make fun use my alternative size function for the automatic termination proof?


回答1:


A function f can be registered as a measure function for the termination prover by declaring the lemma is_measure f with the attribute measure_function. In your case, this looks as follows.

lemma is_measure_size2 [measure_function]: "is_measure size2" ..

Then, lexicographic_order, which fun uses, and size_change try size2, too.



来源:https://stackoverflow.com/questions/29534558/make-automatic-termination-proof-use-different-size-function

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