#  Copyright (c) 1997-2004
#  Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
#  http://www.math.tu-berlin.de/polymake,  mailto:polymake@math.tu-berlin.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: complex_properties.rules,v 1.12 2004/11/17 13:03:46 witte Exp $

object SimplicialComplex;

# category: Basic properties
# Description of the <code>topaz</code> object.

property DESCRIPTION
$type="text";


# category: Basic properties
# Any description of the faces of a simplicial complex.  Redundancy allowed.

property INPUT_FACES
$type="array<set>";


# category: Basic properties
# Labels of the vertices.

property VERTEX_LABELS
$type="array<label>";
$diff=\&diff_labels;


# category: Basic properties
# Number of vertices.

property N_VERTICES
$type="cardinal";


# category: Basic properties
# Inclusion maximal faces of the (abstract) simplicial complex, encoded as their ordered set of vertices.
# The vertices must be numbered 0..n-1.

property FACETS
$type="array<set>";
$diff=\&diff_list_of_sets;
$apply_diff{VERTEX_LABELS}=\&permute_cols;


# category: Basic properties
# Number of @see FACETS.

property N_FACETS
$type="cardinal";


# category: Combinatorics
# Inclusion minimal non-faces (vertex subsets which are not faces of the simplicial complex).

property MINIMAL_NON_FACES
$type="array<set>";
$diff=\&diff_list_of_sets;
$apply_diff{VERTEX_LABELS}=\&permute_cols;


# category: Combinatorics
# Number of @see MINIMAL_NON_FACES.

property N_MINIMAL_NON_FACES
$type="cardinal";


# category: Basic properties
# Maximal dimension of the @see FACETS, where the dimension of a facet is defined as the number of its vertices less one.

property DIM
$type="cardinal";


# category: Basic properties
# A simplicial complex is pure if all its facets have the same dimension.

property PURE
$type="boolean";


# category: Combinatorics
# `f_k` is the number of `k`-faces, for `k = 0,..,d`, where `d` is the dimension.

property F_VECTOR
$type="vector<cardinal>";


# category: Combinatorics
# `f_ik` is the number of incident pairs of `i`-faces and `k`-faces; the main diagonal contains the @see F_VECTOR.

property F2_VECTOR
$type="matrix<cardinal>";


# topic: $this/properties/Topology
# The following properties are topological invariant to different
# triangulations of the same topological space.


# category: Topology
# Reduced Euler characteristic.  Alternating sum of the @see F_VECTOR.

property EULER_CHARACTERISTIC
$type="cardinal";


# category: Visualization
# Coordinates for the vertices of the simplicial complex, such that the complex is embedded without crossings in some `R^e`.
# Vector `(x_1 .. x_e)` represents a point in Euclidean `e`-space.

property GEOMETRIC_REALIZATION
$type="matrix";


# category: Visualization
# Dimension `e` of the space the @see GEOMETRIC_REALIZATION of the complex is embedded in.

property G_DIM
$type="cardinal";


# category: Topology
# Reduced simplicial homology groups `H_0,...,H_d` (integer coefficients), listed in increasing dimension order.
#
# Each group `G` is encoded as a sequence `({ (t_1 m_1) ...  (t_n  m_n) } f)` of non-negative integers,
# with `t_1 > t_2 > ... > t_n > 1`, plus an extra non-negative integer `f`.
# The group `G` is isomorphic to `(Z/t_1)^{m_1} \times ... \times (Z/t_n)^{m_n} \times Z^f`, 
# where `Z^0` is the trivial group.

property HOMOLOGY
$type="array< tuple< list< tuple<cardinal,cardinal> >, cardinal> >";


# category: Topology
# Reduced cohomology groups, listed in increasing co-dimension order.
# Encoding similar to @see HOMOLOGY.

property COHOMOLOGY
$type="array< tuple< list< tuple<cardinal,cardinal> >, cardinal> >";


# category: Topology
# Representatives of cycle groups, listed in increasing dimension order.
#
# The first component in each dimension is a matrix of integer coefficients,
# the second component is a vector of faces. To obtain the chains, one must multiply (symbolically)
# both components.
#
property CYCLES
$type="array< tuple< sparse_matrix<integer>, array<set> > >";


# category: Topology
# Representatives of co-cycle groups, listed in increasing co-dimension order.
# Encoding similar to @see CYCLES.
#
property COCYCLES
$type="array< tuple< sparse_matrix<integer>, array<set> > >";


# category: Topology
# Parity and signature of the intersection form of a closed oriented 4-manifold.
#
property INTERSECTION_FORM
$type="tuple<cardinal,cardinal,cardinal>";


# category: Topology
# Mod 2 cycle representation of Stiefel-Whitney classes.  Each cycle is represented as a set of simplices.
#
property STIEFEL_WHITNEY
$type="array<powerset>";


# category: Combinatorics
# All faces of co-dimension -2 that are contained in an odd number of faces of co-dimension -1.
#
property ODD_SUBCOMPLEX
$type="array<set>";
$diff=\&diff_list_of_sets;
$apply_diff{VERTEX_LABELS}=\&permute_cols;


# category: Topology
# True if this is a @see PURE simplicial complex with the property that each ridge is contained in either one or two facets.
#
property PSEUDO_MANIFOLD
$type="boolean";


# category: Topology
# True if this is a compact simplicial manifold with boundary.
#
property MANIFOLD
$type="boolean";


# category: Topology
# True if this is a @see PURE simplicial complex with the property that each ridge is contained in exactly two facets.
#
property CLOSED_PSEUDO_MANIFOLD
$type="boolean";


# category: Topology
# True if this is a @see PSEUDO_MANIFOLD with top level homology isomorphic to Z.
#
property ORIENTED_PSEUDO_MANIFOLD
$type="boolean";


# category: Topology
# An orientation of the facets of an @see ORIENTED_PSEUDO_MANIFOLD, such that the induced orientations
# of a common ridge of two neighboring facets cancel each other out. Each facet is marked with @c true,
# iff the orientation is given by the increasing vertex ordering and is marked with @c false, if the
# orientation is obtained from the increasing vertex ordering by a transposition.
#
property ORIENTATION
$type="array<boolean>";


# category: Topology
# True if the topological space is homeomorphic to either a ball or a sphere.
#
property BALL_OR_SPHERE
$type="boolean";


# category: Topology
# True if the topological space homeomorphic to a sphere.
#
property SPHERE
$type="boolean";


# category: Topology
# True if the topological space homeomorphic to a ball.
#
property BALL
$type="boolean";


# category: Topology
# True if @see GRAPH is a connected graph.
#
property CONNECTED
$type="boolean";


# category: Topology
# True if @see DUAL_GRAPH is a connected graph.
#
property DUAL_CONNECTED
$type="boolean";


# category: Topology
# The connected components of the @see GRAPH, encoded as node sets.
#
property CONNECTED_COMPONENTS
$type="array<set>";


# category: Topology
# The connected components of the @see DUAL_GRAPH, encoded as node sets.
#
property DUAL_CONNECTED_COMPONENTS
$type="array<set>";


# category: Topology
# The maximal cliques of the @see GRAPH, encoded as node sets.
#
property MAX_CLIQUES
$type="array<set>";


# category: Topology
# The maximal cliques of the @see DUAL_GRAPH, encoded as node sets.
#
property DUAL_MAX_CLIQUES
$type="array<set>";


# category: Combinatorics
# Node connectivity of the @see GRAPH, that is, the minimal number of nodes to be removed
# from the graph such that the result is disconnected.
#
property CONNECTIVITY
$type="cardinal";


# category: Combinatorics
# Node connectivity of the @see DUAL_GRAPH. Dual to @see CONNECTIVITY.
#
property DUAL_CONNECTIVITY
$type="cardinal";


# category: Basic properties
# The subcomplex consisting of all 1-faces.
#
property GRAPH
$type="graph";


# category: Basic properties
# The graph of facet neighborhood.
# Two @see FACETS are neighbors if they share a `d-1`-dimensional face.
#
property DUAL_GRAPH
$type="graph";


# category: Basic properties
# The face lattice of the simplical complex organized as a directed graph.
# Each node corresponds to some face of the simplical complex. It is represented
# as the list of vertices comprising the face. The outgoing arcs
# point to the containing faces of the next dimension.
#
property HASSE_DIAGRAM
$type="face_lattice";
$apply_diff{VERTEX_LABELS}=
$apply_diff{FACETS}=
sub { die "update of HASSE_DIAGRAM too complicated\n" };
@upgrade=(
   v2.0,
   sub {
      my ($value)=@_;
      $value->[1] =~ s/^(?!\s*<)/</;
      push @$value, ">\n";
      return $value;
   }
);


# category: Topology
# True if this is a @see CONNECTED @see MANIFOLD of dimension 2.
#
property SURFACE
$type="boolean";


# category: Topology
# True if the vertex star of each vertex is @see DUAL_CONNECTED.
#
property LOCALLY_STRONGLY_CONNECTED
$type="boolean";


# category: Basic properties
# Co-dimension -1 faces of a @see PSEUDO_MANIFOLD which are contained in one facet only.
#
property BOUNDARY_OF_PSEUDO_MANIFOLD
$type="array<set>";


# category: Combinatorics
# Orbit decomposition of the group of projectivities acting on the set of vertices of facet 0.
#
property PROJ_ORBITS
$type="powerset";


# category: Combinatorics
# For each vertex the corresponding vertex of facet 0 with respect to the action of the group of projectivities.
#
property PROJ_DICTIONARY
$type="array<cardinal>";


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