File Edit View Navigation Templates Queries Tools Compile Debug Windows Help projectfianl ex_02_sumlist Require Import Coq.Lists. List. Import ListNotations. Section LinkedList. Variable A: Type. Inductive LinkedList = LNil LCons (x: A) (xs LinkedList). End LinkedList. Section Append. Fixpoint append (xs ys: LinkedList) : LinkedList := match xs with LNil => ys | LCons x xs' => LCons x (append xs' ys) end. End Append. From iris.base_logic Require Import invariants. From iris.proofmode Require Import tactics. Section AppendProof. Context inG E (authR (listUR A))). Lemma append_nil_r (xs: LinkedList) Proof. induction xs; simpl; auto. Qed. append xs LNil xs. Lemma append_assoc (xs ys zs LinkedList) : append (append xs ys) zs = append xs (append ys zs). Proof. induction xs; simpl; auto. rewrite IHxs. reflexivity. Qed. Lemma append_comm (xs ys: LinkedList) : append xs ys = append ys xs. Proof. induction xs; simpl; auto. rewrite IHxs. reflexivity. Qed. Lemma append_cons_r (x: A) (xs ys: LinkedList) : append xs (LCons x ys) = LCons x (append xs ys). Proof. induction xs: simpl: auto. Messages Errors Jobs The term "LinkedList" has type "Type -> Type" which should be Set, Prop or Type.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Can you Fix this error in the following image 

Require Import Coq.Lists.List.
Import ListNotations.

Section LinkedList.

  Variable A : Type.

  Inductive LinkedList :=
  | LNil
  | LCons (x : A) (xs : LinkedList).

End LinkedList.

Section Append.

  Fixpoint append (xs ys : LinkedList) : LinkedList :=
    match xs with
    | LNil => ys
    | LCons x xs' => LCons x (append xs' ys)
    end.

End Append.

From iris.base_logic Require Import invariants.
From iris.proofmode Require Import tactics.

Section AppendProof.

  Context `{!inG Σ (authR (listUR A))}.

  Lemma append_nil_r (xs : LinkedList) : append xs LNil = xs.
  Proof.
    induction xs; simpl; auto.
  Qed.

  Lemma append_assoc (xs ys zs : LinkedList) :
    append (append xs ys) zs = append xs (append ys zs).
  Proof.
    induction xs; simpl; auto.
    rewrite IHxs. reflexivity.
  Qed.

  Lemma append_comm (xs ys : LinkedList) :
    append xs ys = append ys xs.
  Proof.
    induction xs; simpl; auto.
    rewrite IHxs. reflexivity.
  Qed.

  Lemma append_cons_r (x : A) (xs ys : LinkedList) :
    append xs (LCons x ys) = LCons x (append xs ys).
  Proof.
    induction xs; simpl; auto.
  Qed.

End AppendProof.



File
Edit View Navigation Templates Queries Tools Compile Debug Windows Help
projectfianl
ex_02_sumlist
Require Import Coq.Lists. List.
Import ListNotations.
Section LinkedList.
Variable A: Type.
Inductive LinkedList =
LNil
LCons (x: A) (xs LinkedList).
End LinkedList.
Section Append.
Fixpoint append (xs ys: LinkedList) : LinkedList :=
match xs with
LNil => ys
| LCons x xs' => LCons x (append xs' ys)
end.
End Append.
From iris.base_logic Require Import invariants.
From iris.proofmode Require Import tactics.
Section AppendProof.
Context
inG E (authR (listUR A))).
Lemma append_nil_r (xs: LinkedList)
Proof.
induction xs; simpl; auto.
Qed.
append xs LNil xs.
Lemma append_assoc (xs ys zs LinkedList) :
append (append xs ys) zs = append xs (append ys zs).
Proof.
induction xs; simpl; auto.
rewrite IHxs. reflexivity.
Qed.
Lemma append_comm (xs ys: LinkedList) :
append xs ys = append ys xs.
Proof.
induction xs; simpl; auto.
rewrite IHxs. reflexivity.
Qed.
Lemma append_cons_r (x: A) (xs ys: LinkedList) :
append xs (LCons x ys) = LCons x (append xs ys).
Proof.
induction xs: simpl: auto.
Messages
Errors
Jobs
The term "LinkedList" has type "Type -> Type" which should be Set, Prop or Type.
Transcribed Image Text:File Edit View Navigation Templates Queries Tools Compile Debug Windows Help projectfianl ex_02_sumlist Require Import Coq.Lists. List. Import ListNotations. Section LinkedList. Variable A: Type. Inductive LinkedList = LNil LCons (x: A) (xs LinkedList). End LinkedList. Section Append. Fixpoint append (xs ys: LinkedList) : LinkedList := match xs with LNil => ys | LCons x xs' => LCons x (append xs' ys) end. End Append. From iris.base_logic Require Import invariants. From iris.proofmode Require Import tactics. Section AppendProof. Context inG E (authR (listUR A))). Lemma append_nil_r (xs: LinkedList) Proof. induction xs; simpl; auto. Qed. append xs LNil xs. Lemma append_assoc (xs ys zs LinkedList) : append (append xs ys) zs = append xs (append ys zs). Proof. induction xs; simpl; auto. rewrite IHxs. reflexivity. Qed. Lemma append_comm (xs ys: LinkedList) : append xs ys = append ys xs. Proof. induction xs; simpl; auto. rewrite IHxs. reflexivity. Qed. Lemma append_cons_r (x: A) (xs ys: LinkedList) : append xs (LCons x ys) = LCons x (append xs ys). Proof. induction xs: simpl: auto. Messages Errors Jobs The term "LinkedList" has type "Type -> Type" which should be Set, Prop or Type.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education