#  Copyright (c) 1997-2010
#  Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Darmstadt, Germany)
#  http://www.polymake.de
#
#  This program is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by the
#  Free Software Foundation; either version 2, or (at your option) any
#  later version: http://www.gnu.org/licenses/gpl.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#-------------------------------------------------------------------------------
#  $Project: polymake $$Id: face_lattice.rules 9547 2010-03-09 07:21:34Z smoeser $

# Lattice represented as a directed acyclic graph.

declare object FaceLattice : Graph<Directed> {

   # Each node of the FaceLattice corresponds to a face. The node attribute is a set of vertices comprising the face.
   # Incident edges lead to the containing faces of the next (higher) dimension.
   property FACES : NodeMap<Directed,Set>;

   # Indices of the first nodes in each level.
   # Intended for internal use only; please use [[nodes_of_dim]] instead
   property DIMS : Array<Int>;

   my @attrs=(via_object => 'HasseDiagram', include => [ 'HasseDiagram.h' ]);

   # Index of the node representing __the whole thing__
   user_method top_node() : c++ (@attrs);

   # Index of the node representing the empty face
   user_method bottom_node() : c++ (@attrs);

	# Dimension of the lattice = number of levels - 1
	user_method dim() : c++ (@attrs);

	method dual_faces() : c++ (@attrs);


	# Indices of nodes representing faces of the given dimension
	# @return Set<Int>
	user_method nodes_of_dim($) : c++ (@attrs);
}


# Local Variables:
# mode: perl
# c-basic-offset:3
# End:
