]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/dama/dama/models/list_support.ma
...
[helm.git] / helm / software / matita / contribs / dama / dama / models / list_support.ma
index a9d26a9ce890c6636932c5015dbc5ff39a204c60..eb70322a9a30a0307aceb63500bf1d3085060392 100644 (file)
@@ -264,3 +264,19 @@ lemma sorted_near:
      apply H3; apply le_S_S_to_le; apply H4]
 qed.  
  
+definition last ≝
+ λT:Type.λd.λl:list T. \nth l d (pred (\len l)).
+
+notation > "\last" non associative with precedence 90 for @{'last}.
+notation < "\last d l" non associative with precedence 70 for @{'last2 $d $l}.
+interpretation "list last" 'last = (last _). 
+interpretation "list last applied" 'last2 d l = (last _ d l).
+
+definition head ≝
+ λT:Type.λd.λl:list T.\nth l d O.
+
+notation > "\hd" non associative with precedence 90 for @{'hd}.
+notation < "\hd d l" non associative with precedence 70 for @{'hd2 $d $l}.
+interpretation "list head" 'hd = (head _).
+interpretation "list head applied" 'hd2 d l = (head _ d l).
+