val list_ref : (#a:Type) -> (#p:(a -> Type)) -> (l:list a) ->
                    Pure (list (x:a{p x}))
                         (requires (forallP p l))
                         (ensures (fun _ -> True))
let rec list_ref #a #p l =
    match l with
    | [] -> []
    | x::xs -> x :: list_ref #a #p xs
val list_ref : (#a:Type) -> (#p:(a -> Type)) -> (l:list a) ->
                    Pure (list (x:a{p x}))
                         (requires (forallP p l))
                         (ensures (fun _ -> True))
let rec list_ref #a #p l =
match l with
| [] -> []
| x :: xs -> x :: list_ref #a #p xs
FStar.Reflection.V2.Derived.Lemmas.fst.checked
prims.fst.checked FStar.Reflection.V2.Derived.fst.checked FStar.Reflection.V2.Data.fsti.checked FStar.Reflection.V2.Builtins.fsti.checked FStar.Reflection.Types.fsti.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked FStar.List.Tot.fst.checked FStar.Classical.fsti.checked
FStar.Reflection.V2.Derived.Lemmas.fst
Prims.list Prims.Nil Prims.Cons FStar.Reflection.V2.Derived.Lemmas.list_ref
(*
   Copyright 2008-2018 Microsoft Research

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*)
module FStar.Reflection.V2.Derived.Lemmas

open FStar.Reflection.Types
open FStar.Reflection.V2.Builtins
open FStar.Reflection.V2.Data
open FStar.Reflection.V2.Derived
open FStar.List.Tot

let rec forall_list (p:'a -> Type) (l:list 'a) : Type =
    match l with
    | [] -> True
    | x::xs -> p x /\ forall_list p xs

let forallP (p: 'a -> Type) (l: list 'a): Type
  = forall (x: 'a). memP x l ==> p x
// Precedence relation on the element of a list
unfold let (<<:) (l: list 'a) (r: 'r)
  = forallP (fun x -> x << r) l

// A glorified `id`
val list_ref : (#a:Type) -> (#p:(a -> Type)) -> (l:list a) ->
                    Pure (list (x:a{p x}))
                         (requires (forallP p l))
                         (ensures (fun _ -> True))
val list_ref : (#a:Type) -> (#p:(a -> Type)) -> (l:list a) ->
                    Pure (list (x:a{p x}))
                         (requires (forallP p l))
                         (ensures (fun _ -> True))
l: Prims.list a -> Prims.Pure (Prims.list (x: a{p x}))