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

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

#ifndef AT_BINARY_TREE_SYMMETRIC_COMPOSE
#define AT_BINARY_TREE_SYMMETRIC_COMPOSE 1
   
///------------------------------------------------------------------------
/// Global Context --------------------------------------------------------
///------------------------------------------------------------------------

#include "AT/Binary_Tree/Kernel.h"

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

abstract_template <
        concrete_instance class Item,
        concrete_instance class Binary_Tree_Base
        /*!
            implements
                abstract_instance Binary_Tree_Kernel <
		        Item,
		        Binary_Tree_Base
		    >
        !*/
    >
class Binary_Tree_Symmetric_Compose :
    extends
        abstract_instance Binary_Tree_Kernel <Item, Binary_Tree_Base>
{
public:

    /*!
        math definition SYMMETRIC_ORDER (
	        tree: binary tree of Item
	    ): string of Item satisfies
	    if tree = empty_tree
	    then SYMMETRIC_ORDER (tree) = empty_string
	    else there exists root: Item,
			      left, right: binary tree of Item
		     (tree = compose (root, left, right) and
		      SYMMETRIC_ORDER (tree) =
		          SYMMETRIC_ORDER (left) * <root> *
		             SYMMETRIC_ORDER (right))
    !*/
    
    procedure Symmetric_Compose (
            consumes Item& x,
            consumes Binary_Tree_Base& left_subtree,
            consumes Binary_Tree_Base& right_subtree
        ) is_abstract;
    /*!
	produces self
	ensures
	    SYMMETRIC_ORDER (self) =
	        SYMMETRIC_ORDER (compose (#x, #left_subtree, #right_subtree))
    !*/
};

//-------------------------------------------------------------------------

#endif // AT_BINARY_TREE_SYMMETRIC_COMPOSE

Last modified: Wed Oct 10 13:12:47 EDT 2007