I have the following definitions in Coq:
Inductive list_variable : Type :=
| nil
| cons (s : string) (l : list_variable).
Fixpoint getElement (l : list_variable) (s : Variabile) (v : Address) {struct l} : Address :=
match l with
| nil => v
| str :: nil => (updateValues v ((updateState (updateState s "memPointer" (s("memPointer")+1)) str (s("memPointer"))) "memPointer") undef)
| str :: l => getElement l s v
end.
For some reason, the bottom and second line return Found a constructor of inductive type list while a constructor of list_variable is expected.
For reference, the long return on str::nil
works fine in another place. It's for a memory-like simulation.
Any ideas as to why this happens?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…