val move_requires
      (#a: Type)
      (#p #q: (a -> Type))
      ($_: (x: a -> Lemma (requires (p x)) (ensures (q x))))
      (x: a)
    : Lemma (p x ==> q x)
let move_requires #a #p #q f x =
  give_proof (bind_squash (get_proof (l_or (p x) (~(p x))))
        (fun (b: l_or (p x) (~(p x))) ->
            bind_squash b
              (fun (b': Prims.sum (p x) (~(p x))) ->
                  match b' with
                  | Prims.Left hp ->
                    give_witness hp;
                    f x;
                    get_proof (p x ==> q x)
                  | Prims.Right hnp -> give_witness hnp)))
val move_requires
      (#a: Type)
      (#p #q: (a -> Type))
      ($_: (x: a -> Lemma (requires (p x)) (ensures (q x))))
      (x: a)
    : Lemma (p x ==> q x)
let move_requires #a #p #q f x =
give_proof (bind_squash (get_proof (l_or (p x) (~(p x))))
      (fun (b: l_or (p x) (~(p x))) ->
          bind_squash b
            (fun (b': Prims.sum (p x) (~(p x))) ->
                match b' with
                | Prims.Left hp ->
                  give_witness hp;
                  f x;
                  get_proof (p x ==> q x)
                | Prims.Right hnp -> give_witness hnp)))
FStar.Classical.fst.checked
prims.fst.checked FStar.Squash.fsti.checked FStar.Pervasives.fsti.checked
FStar.Classical.fst
Prims.unit Prims.squash Prims.Nil FStar.Pervasives.pattern FStar.Squash.give_proof Prims.l_imp FStar.Squash.bind_squash Prims.l_or Prims.l_not FStar.Squash.get_proof Prims.sum FStar.Classical.give_witness
(*
   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.Classical

open FStar.Squash

let give_witness #a x = return_squash x

let give_witness_from_squash #a x = x

let lemma_to_squash_gtot #a #p f x =
  f x;
  get_proof (p x)

val get_squashed (#b a: Type) : Pure a (requires (a /\ a == squash b)) (ensures (fun _ -> True))

#push-options "--smtencoding.valid_intro true --smtencoding.valid_elim true"
[@@ noextract_to "FSharp"]
let get_squashed #b a =
  let p = get_proof a in
  join_squash #b p
#pop-options

let get_equality #t a b = get_squashed #(equals a b) (a == b)

let impl_to_arrow #a #b impl sx =
  bind_squash #(a -> GTot b) impl (fun f -> bind_squash sx (fun x -> return_squash (f x)))

let arrow_to_impl #a #b f = squash_double_arrow (return_squash (fun x -> f (return_squash x)))

let impl_intro_gtot #p #q f = return_squash f

let impl_intro_tot #p #q f = return_squash #(p -> GTot q) f

let impl_intro #p #q f =
  give_witness #(p ==> q) (squash_double_arrow (return_squash (lemma_to_squash_gtot f)))
val move_requires
      (#a: Type)
      (#p #q: (a -> Type))
      ($_: (x: a -> Lemma (requires (p x)) (ensures (q x))))
      (x: a)
    : Lemma (p x ==> q x)
$f: (x: a -> FStar.Pervasives.Lemma (requires p x) (ensures q x)) -> x: a
  -> FStar.Pervasives.Lemma (ensures p x ==> q x)