Resolve/C++ Catalog
AT/Fixed_Length_Bit_String/Integer_Value_Of_Substring.h
Copyright © 2010, Reusable Software Research Group, The Ohio State University

//  /*-------------------------------------------------------------------*\
//  |   Abstract Template : Fixed_Length_Bit_String_Set_Substring_From_Integer
//  \*-------------------------------------------------------------------*/

#ifndef AT_FIXED_LENGTH_BIT_STRING_INTEGER_VALUE_OF_SUBSTRING
#define AT_FIXED_LENGTH_BIT_STRING_INTEGER_VALUE_OF_SUBSTRING 1

///------------------------------------------------------------------------
/// Global Context --------------------------------------------------------
///------------------------------------------------------------------------

#include "AT/Fixed_Length_Bit_String/Kernel.h"

///------------------------------------------------------------------------
/// Interface -------------------------------------------------------------
///------------------------------------------------------------------------

abstract_template <
	Integer_constant String_Length
        /*!
	    satisfies restriction
	        String_Length > 0
	!*/
    >
class Fixed_Length_Bit_String_Integer_Value_Of_Substring :
    extends
	abstract_instance Fixed_Length_Bit_String_Kernel <String_Length>
{
public:

    function Integer Integer_Value_Of_Substring (
	    preserves Integer pos,
	    preserves Integer len
	) is_abstract;
    /*!
	requires
	    0 <= pos < String_Length  and
	    0 < len <= String_Length - pos  and
	    len <= BITS_FOR_INTEGER
	ensures
	    there exists x, y, z: string of BIT
		(self = x * y * z  and
		 |z| = pos and
		 |y| = len  and
		 Integer_Value_Of_Substring =
		     SIMPLE_BINARY_DECODING (y))
    !*/

};

#endif // AT_FIXED_LENGTH_BIT_STRING_INTEGER_VALUE_OF_SUBSTRING

Last modified: Wed Aug 27 14:43:39 EDT 2008