Library mcertikos.mm.PTBitGenLinkSource

***********************************************************************
*                                                                     *
*            The CertiKOS Certified Kit Operating System              *
*                                                                     *
*                   The FLINT Group, Yale University                  *
*                                                                     *
*  Copyright The FLINT Group, Yale University.  All rights reserved.  *
*  This file is distributed under the terms of the Yale University    *
*  Non-Commercial License Agreement.                                  *
*                                                                     *
*********************************************************************** 

Require Import liblayers.compat.CompatLayers.
Require Import liblayers.compat.CompatClightSem.
Require Import LAsmModuleSemDef.
Require Import CompCertiKOS.
Require Import GlobIdent.
Require Import CDataTypes.
Require Import MPTInitCSource.

Require Import CompCertiKOSproof.
Require Import RealParams.
Require Import I64Layer.

Require Import MPTInit.

Section WITHCOMPCERTIKOS.

  Context `{compcertikos_prf: CompCertiKOS}.

  Context `{real_params_prf : RealParams}.

  Definition MPTBit_impl: res LAsm.module :=
    M1 <- (M_set_bit <- CompCertiKOS.transf_module (set_bit f_set_bit);
           M_is_used <- CompCertiKOS.transf_module (is_used f_is_used);
           _ <- eassert nil (LayerOK ((〚(M_set_bit M_is_used)〛
                                         ((mptinit L64) PTP_LOC ptp_loc_type)
                                          (mptinit L64) PTP_LOC ptp_loc_type)));
           ret ((M_set_bit M_is_used) PTP_LOC ptp_loc_type));
    M <- ret (M1 );
    _ <- eassert nil (LayerOK (M (mptinit L64) mptinit L64));
    
watch out parentheses here:
    ret (
        
group primitives according to the global variables that they use
        M
for L64 and other passthrough primitives
      ).

End WITHCOMPCERTIKOS.