What is the difference between primrec and entertainment at Isabelle / HOL?

I am reading a Isabelle tutorial and trying to clear my concept of using primrec and fun. With what I have been searching so far, including the answer here ; I understand that the constructor inside primrec can have only one equation, and primrec has [simp] by default, while fun can have several equations, and automation tactics should be specified explicitly. However, I am still trying to understand this clearly.

Is anyone enough to explain some examples?

+4
source share
1 answer

primrec ( -, , , , ; ). , , :

  • (.. , ). - f (x#xs) (y#ys) = … f n = (if n = 0 then … else …).
  • (.. x # xs, x # y # xs)
  • , , f (Node l r) = … f l … f r …, f (Node l r) = … f (Node r l) ….
  • , .

fun function, , . , ; , function . .

fun primrec , fun , primrec. fun . , , primrec, fun.

function , - , (.. , ), .. .

function , , , , cases, induction, elims .. , fun_cases. .

TL; DR: . fun , . , function. primrec , . , , , , inductive.

+4

All Articles