Skip to Content.
Sympa Menu

coq-club - [Coq-Club] about recursive definition

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] about recursive definition


chronological Thread 
  • From: ldou AT cs.ecnu.edu.cn
  • To: coq-club AT inria.fr
  • Subject: [Coq-Club] about recursive definition
  • Date: Mon, 11 Jul 2011 22:18:46 +0800

Hi,all.
I have the following codes in Coq:
========================
Require Import String Bool ListSet List Classical.
Definition Event := string.
Definition Trace := list Event.


Definition Trace_dec :forall (a b:Trace) ,{a = b} + {a <> b}.
repeat decide equality.
Defined.

Fixpoint map_prefix (e:Event) (O:set Trace) : set Trace :=
match O with
| nil => nil
| t::R => (e::t) :: (map_prefix e R)
end.

Fixpoint interleave_t (t1 t2:Trace) {struct t1}: set Trace :=
match t1, t2 with
| nil, _ => t2::nil
| _, nil => t1::nil
| x::u, y::v => set_union Trace_dec (map_prefix x (interleave_t u t2)) (map_prefix y (interleave_t t1 u))
end.

================
I got error for the last fixpoint:
Recursive call to interleave_t has principal argument equal to "t1" instead of u.
Any idea to fix the problem?Thanks!



----------------
===========================================================
Best regards!
 
ñ¼ÁÁ

(Department of Computer Science, East China Normal University)

E-mail:ldou AT cs.ecnu.edu.cn   
 
===========================================================



Archive powered by MhonArc 2.6.16.

Top of Page