--  F6: an enclave's types do not cross to foreign code
package Lists
  with Annotate => (Verada, Enclave)
is
   type List is limited private;
   function Model (L : List) return Natural with Ghost;
   function Length (L : List) return Natural
     with Post => Length'Result = Model (L);
   procedure Show (L : List)
     with Import, Convention => C, External_Name => "show_list", Global => null;
private
   type Node;
   type Node_Ptr is access Node;
   type Node is record
      Value : Integer;
      Next : Node_Ptr;
   end record;
   type List is limited record
      Head : Node_Ptr;
      Count : Natural := 0;
   end record
     with Type_Invariant => List.Count < Natural'Last;
   function Model (L : List) return Natural is (L.Count);
   function Length (L : List) return Natural is (L.Count);
end Lists;
