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

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

#ifndef AT_FIXED_LENGTH_BIT_STRING_AND
#define AT_FIXED_LENGTH_BIT_STRING_AND 1

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

#include "AT/Fixed_Length_Bit_String/Kernel.h"

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

abstract_template <
        Integer_constant String_Length,
        /*!
	    satisfies restriction
	        String_Length > 0
	!*/
        concrete_instance class T
        /*!
	    implements
	        abstract_instance Fixed_Length_Bit_String_Kernel <
		                          String_Length
		                      >
	!*/
    >
class Fixed_Length_Bit_String_And :
    extends
	abstract_instance Fixed_Length_Bit_String_Kernel <String_Length>
{
public:

    /*!
        math definition AND (
		bit1: BIT,
		bit2: BIT
	    ): BIT satisfies
	    AND (0, 0) = 0  and
	    AND (0, 1) = 0  and
	    AND (1, 0) = 0  and
	    AND (1, 1) = 1
    !*/
    
    procedure And (
	    preserves T& rhs
	) is_abstract;
    /*!
	ensures
	    for all p: BIT_POSITION
	        (BIT_VALUE_AT (self, p) = AND (BIT_VALUE_AT (#self, p),
		                               BIT_VALUE_AT (rhs, p))
    !*/

};

#endif // AT_FIXED_LENGTH_BIT_STRING_AND

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