(* as it is dynamically inferred by simpl *) Arguments minus !n / m.
Lemma foo x y : S (S x) - S y = 0. simpl. matchgoalwith |- (match y with O => S x | S _ => _ end = 0) => idtacend. Abort.
(* we avoid exposing a match *) Arguments minus n m : simpl nomatch.
Lemma foo x : minus 0 x = 0. simpl. matchgoalwith |- (0 = 0) => idtacend. Abort.
Lemma foo x y : S (S x) - S y = 0. simpl. matchgoalwith |- (S x - y = 0) => idtacend. Abort.
Lemma foo x y : S (S x) - (S (match y with O => O | S z => S z end)) = 0. simpl. matchgoalwith |-(S x - (match y with O => _ | S _ => _ end) = 0) => idtacend. Abort.
(* we unfold as soon as we have 1 args, but we avoid exposing a match *) Arguments minus n / m : simpl nomatch.
Lemma foo : minus 0 = fun x => 0. simpl. matchgoalwith |- minus 0 = _ => idtacend. Abort. (* This does not work as one may expect. The point is that simpl is implemented as "strong (whd_simpl_state)" and after unfolding minus you have (fun m => match 0 => 0 | S n => ...) that is already in whd and exposes a match, that of course "strong" would reduce away but at that stage
we don't know, and reducing by hand under the lambda is against whd *)
(* extra tuning for the usual heuristic *) Arguments minus !n / m : simpl nomatch.
Lemma foo x y : S (S x) - S y = 0. simpl. matchgoalwith |- (S x - y = 0) => idtacend. Abort.
Lemma foo x y : S (S x) - (S (match y with O => O | S z => S z end)) = 0. simpl. matchgoalwith |-(S x - (match y with O => _ | S _ => _ end) = 0) => idtacend. Abort.
(* full control *) Arguments minus !n !m /.
Lemma foo x y : S (S x) - S y = 0. simpl. matchgoalwith |- (S x - y = 0) => idtacend. Abort.
Lemma foo x y : S (S x) - (S (match y with O => O | S z => S z end)) = 0. simpl. matchgoalwith |-(S x - (match y with O => _ | S _ => _ end) = 0) => idtacend. Abort.
(* omitting /, that being immediately after the last ! is irrelevant *) Arguments minus !n !m.
Lemma foo x y : S (S x) - S y = 0. simpl. matchgoalwith |- (S x - y = 0) => idtacend. Abort.
Lemma foo x y : S (S x) - (S (match y with O => O | S z => S z end)) = 0. simpl. matchgoalwith |-(S x - (match y with O => _ | S _ => _ end) = 0) => idtacend. Abort.
Definition pf (D1 C1 : Type) (f : D1 -> C1) (D2 C2 : Type) (g : D2 -> C2) := fun x => (f (fst x), g (snd x)).
DelimitScope foo_scope with F. Notation"@@" := nat (only parsing) : foo_scope. Notation"@@" := (fun x => x) (only parsing).
Arguments pf {D1%_F C1%_type} f [D2 C2] g x : simpl never.
Lemma foo x : @pf @@ nat @@ nat nat @@ x = pf @@ @@ x. Abort.
Definition fcomp A B C f (g : A -> B) (x : A) : C := f (g x).
(* fcomp is unfolded if applied to 6 args *) Arguments fcomp {A B C}%_type f g x /.
Notation"f \o g" := (fcomp f g) (at level 50).
Lemma foo (f g h : nat -> nat) x : pf (f \o g) h x = pf f h (g (fst x), snd x). simpl. matchgoalwith |- (pf (f \o g) h x = _) => idtacend. case x; intros x1 x2. simpl. matchgoalwith |- (pf (f \o g) h _ = pf f h _) => idtacend. unfold pf; simpl. matchgoalwith |- (f (g x1), h x2) = (f (g x1), h x2) => idtacend. Abort.
Definition volatile := fun x : nat => x. Arguments volatile / _.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.