Generated on Mon Nov 30 23:53:26 2009 for Gecode by doxygen 1.6.1

layered-graph.hpp

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christian Schulte <schulte@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Christian Schulte, 2004
00008  *
00009  *  Last modified:
00010  *     $Date: 2009-10-12 17:36:53 +0200 (Mon, 12 Oct 2009) $ by $Author: schulte $
00011  *     $Revision: 9878 $
00012  *
00013  *  This file is part of Gecode, the generic constraint
00014  *  development environment:
00015  *     http://www.gecode.org
00016  *
00017  *  Permission is hereby granted, free of charge, to any person obtaining
00018  *  a copy of this software and associated documentation files (the
00019  *  "Software"), to deal in the Software without restriction, including
00020  *  without limitation the rights to use, copy, modify, merge, publish,
00021  *  distribute, sublicense, and/or sell copies of the Software, and to
00022  *  permit persons to whom the Software is furnished to do so, subject to
00023  *  the following conditions:
00024  *
00025  *  The above copyright notice and this permission notice shall be
00026  *  included in all copies or substantial portions of the Software.
00027  *
00028  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00029  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00030  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00031  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00032  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00033  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00034  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00035  *
00036  */
00037 
00038 #include <climits>
00039 #include <algorithm>
00040 
00041 namespace Gecode { namespace Int { namespace Extensional {
00042 
00043   /*
00044    * States
00045    */
00046   template<class View, class Val, class Degree, class StateIdx>
00047   forceinline
00048   LayeredGraph<View,Val,Degree,StateIdx>::State::State(void) 
00049     : i_deg(0), o_deg(0) {}
00050 
00051 
00052   /*
00053    * Value iterator
00054    */
00055   template<class View, class Val, class Degree, class StateIdx>
00056   forceinline
00057   LayeredGraph<View,Val,Degree,StateIdx>::LayerValues::LayerValues(void) {}
00058   template<class View, class Val, class Degree, class StateIdx>
00059   forceinline
00060   LayeredGraph<View,Val,Degree,StateIdx>::LayerValues
00061   ::LayerValues(const Layer& l)
00062     : s1(l.support), s2(l.support+l.size) {}
00063   template<class View, class Val, class Degree, class StateIdx>
00064   forceinline void
00065   LayeredGraph<View,Val,Degree,StateIdx>::LayerValues::init(const Layer& l) {
00066     s1=l.support; s2=l.support+l.size;
00067   }
00068   template<class View, class Val, class Degree, class StateIdx>
00069   forceinline bool
00070   LayeredGraph<View,Val,Degree,StateIdx>::LayerValues
00071   ::operator ()(void) const {
00072     return s1<s2;
00073   }
00074   template<class View, class Val, class Degree, class StateIdx>
00075   forceinline void
00076   LayeredGraph<View,Val,Degree,StateIdx>::LayerValues::operator ++(void) {
00077     s1++;
00078   }
00079   template<class View, class Val, class Degree, class StateIdx>
00080   forceinline int
00081   LayeredGraph<View,Val,Degree,StateIdx>::LayerValues::val(void) const {
00082     return s1->val;
00083   }
00084 
00085 
00086   /*
00087    * Index advisors
00088    *
00089    */
00090   template<class View, class Val, class Degree, class StateIdx>
00091   forceinline
00092   LayeredGraph<View,Val,Degree,StateIdx>::Index::Index(Space& home, Propagator& p,
00093                                                        Council<Index>& c,
00094                                                        StateIdx i0)
00095     : Advisor(home,p,c), i(i0) {}
00096 
00097   template<class View, class Val, class Degree, class StateIdx>
00098   forceinline
00099   LayeredGraph<View,Val,Degree,StateIdx>::Index::Index(Space& home, bool share,
00100                                                        Index& a)
00101     : Advisor(home,share,a), i(a.i) {}
00102 
00103 
00104   /*
00105    * Index ranges
00106    *
00107    */
00108   template<class View, class Val, class Degree, class StateIdx>
00109   forceinline
00110   LayeredGraph<View,Val,Degree,StateIdx>::IndexRange::IndexRange(void)
00111     : _fst(INT_MAX), _lst(INT_MIN) {}
00112   template<class View, class Val, class Degree, class StateIdx>
00113   forceinline void
00114   LayeredGraph<View,Val,Degree,StateIdx>::IndexRange::reset(void) {
00115     _fst=INT_MAX; _lst=INT_MIN;
00116   }
00117   template<class View, class Val, class Degree, class StateIdx>
00118   forceinline void
00119   LayeredGraph<View,Val,Degree,StateIdx>::IndexRange::add(int i) {
00120     _fst=std::min(_fst,i); _lst=std::max(_lst,i);
00121   }
00122   template<class View, class Val, class Degree, class StateIdx>
00123   forceinline int
00124   LayeredGraph<View,Val,Degree,StateIdx>::IndexRange::fst(void) const {
00125     return _fst;
00126   }
00127   template<class View, class Val, class Degree, class StateIdx>
00128   forceinline int
00129   LayeredGraph<View,Val,Degree,StateIdx>::IndexRange::lst(void) const {
00130     return _lst;
00131   }
00132 
00133 
00134 
00135   /*
00136    * The layered graph
00137    *
00138    */
00139 
00140   template<class View, class Val, class Degree, class StateIdx>
00141   template<class Var>
00142   forceinline
00143   LayeredGraph<View,Val,Degree,StateIdx>::LayeredGraph(Home home,
00144                                                        const VarArgArray<Var>& x, 
00145                                                        const DFA& dfa)
00146     : Propagator(home), c(home), n(x.size()), n_states(dfa.n_states()) {
00147     assert(n > 0);
00148   }
00149 
00150   template<class View, class Val, class Degree, class StateIdx>
00151   template<class Var>
00152   forceinline ExecStatus
00153   LayeredGraph<View,Val,Degree,StateIdx>::initialize(Space& home,
00154                                                      const VarArgArray<Var>& x, 
00155                                                      const DFA& dfa) {
00156     // Allocate memory
00157     layers = home.alloc<Layer>(n+2)+1;
00158     states = home.alloc<State>((n+1)*n_states);
00159 
00160     // Mark initial state as being reachable
00161     states[0].i_deg = 1;
00162 
00163     // Mark final states as reachable as well
00164     for (int s = dfa.final_fst(); s < dfa.final_lst(); s++)
00165       states[n*n_states + s].o_deg = 1;
00166 
00167     // Temporary memory for edges
00168     Region r(home);
00169     Edge* edges = r.alloc<Edge>(dfa.max_degree());
00170 
00171     // Forward pass: add transitions
00172     for (int i=0; i<n; i++) {
00173       layers[i].x = x[i];
00174       layers[i].support = home.alloc<Support>(layers[i].x.size());
00175       unsigned int j=0;
00176       // Enter links leaving reachable states (indegree != 0)
00177       for (ViewValues<View> nx(layers[i].x); nx(); ++nx) {
00178         Degree n_edges=0;
00179         for (DFA::Transitions t(dfa,nx.val()); t(); ++t)
00180           if (states[i*n_states + t.i_state()].i_deg != 0) {
00181             StateIdx i_s = static_cast<StateIdx>(i*n_states + t.i_state());
00182             states[i_s].o_deg++;
00183             StateIdx o_s = static_cast<StateIdx>((i+1)*n_states +  t.o_state());
00184             states[o_s].i_deg++;
00185             edges[n_edges].i_state = i_s;
00186             edges[n_edges].o_state = o_s;
00187             n_edges++;
00188           }
00189         assert(n_edges <= dfa.max_degree());
00190         // Found support for value
00191         if (n_edges > 0) {
00192           layers[i].support[j].val = static_cast<Val>(nx.val());
00193           layers[i].support[j].n_edges = n_edges;
00194           layers[i].support[j].edges = home.alloc<Edge>(n_edges);
00195           for (Degree d=n_edges; d--; )
00196             layers[i].support[j].edges[d] = edges[d];
00197           j++;
00198         }
00199       }
00200       if ((layers[i].size = j) == 0)
00201         return ES_FAILED;
00202     }
00203 
00204     // Backward pass: prune all transitions that do not lead to final state
00205     for (int i=n; i--; ) {
00206       unsigned int k=0;
00207       for (unsigned int j=0; j<layers[i].size; j++) {
00208         for (Degree d=layers[i].support[j].n_edges; d--; )
00209           if (states[layers[i].support[j].edges[d].o_state].o_deg == 0) {
00210             // Adapt states
00211             states[layers[i].support[j].edges[d].i_state].o_deg--;
00212             states[layers[i].support[j].edges[d].o_state].i_deg--;
00213             // Unreachable, prune edge
00214             layers[i].support[j].edges[d] = 
00215               layers[i].support[j].edges[--layers[i].support[j].n_edges];
00216           }
00217         // Value has support, copy the support information
00218         if (layers[i].support[j].n_edges > 0)
00219           layers[i].support[k++]=layers[i].support[j];
00220       }
00221       if ((layers[i].size = k) == 0)
00222         return ES_FAILED;
00223       LayerValues lv(layers[i]);
00224       GECODE_ME_CHECK(layers[i].x.narrow_v(home,lv,false));
00225       if (!layers[i].x.assigned())
00226         layers[i].x.subscribe(home, *new (home) Index(home,*this,c,i));
00227     }
00228     // Schedule if subsumption is needed
00229     if (c.empty())
00230       View::schedule(home,*this,ME_INT_VAL);
00231     return ES_OK;
00232   }
00233 
00234   template<class View, class Val, class Degree, class StateIdx>
00235   ExecStatus
00236   LayeredGraph<View,Val,Degree,StateIdx>::advise(Space& home,
00237                                              Advisor& _a, const Delta& d) {
00238     // Check whether state information has already been created
00239     if (states == NULL) {
00240       states = home.alloc<State>((n+1)*n_states);
00241       for (int i=n; i--; )
00242         for (unsigned int j=layers[i].size; j--; )
00243           for (Degree d=layers[i].support[j].n_edges; d--; ) {
00244             states[layers[i].support[j].edges[d].i_state].o_deg++;
00245             states[layers[i].support[j].edges[d].o_state].i_deg++;
00246           }
00247     }
00248     
00249     Index& a = static_cast<Index&>(_a);
00250     Layer& l = layers[a.i];
00251 
00252     if (l.size <= l.x.size())
00253       // Propagator has already done everything
00254       if (View::modevent(d) == ME_INT_VAL) {
00255         a.dispose(home,c);
00256         return c.empty() ? ES_NOFIX : ES_FIX;
00257       } else {
00258         return ES_FIX;
00259       }
00260 
00261     bool i_mod = false;
00262     bool o_mod = false;
00263 
00264     if (View::modevent(d) == ME_INT_VAL) {
00265       Val n = static_cast<Val>(l.x.val());
00266       unsigned int j=0;
00267       for (; l.support[j].val < n; j++)
00268         // Supported value not any longer in view
00269         for (Degree d=l.support[j].n_edges; d--; ) {
00270           // Adapt states
00271           o_mod |= ((--states[l.support[j].edges[d].i_state].o_deg) == 0);
00272           i_mod |= ((--states[l.support[j].edges[d].o_state].i_deg) == 0);
00273         }
00274       assert(l.support[j].val == n);
00275       l.support[0] = l.support[j++];
00276       unsigned int s=l.size;
00277       l.size = 1;
00278       for (; j<s; j++)
00279         for (Degree d=l.support[j].n_edges; d--; ) {
00280           // Adapt states
00281           o_mod |= ((--states[l.support[j].edges[d].i_state].o_deg) == 0);
00282           i_mod |= ((--states[l.support[j].edges[d].o_state].i_deg) == 0);
00283         }
00284     } else if (l.x.any(d)) {
00285       unsigned int j=0;
00286       unsigned int k=0;
00287       unsigned int s=l.size;
00288       for (ViewRanges<View> rx(l.x); rx() && (j<s);)
00289         if (l.support[j].val < static_cast<Val>(rx.min())) {
00290           // Supported value not any longer in view
00291           for (Degree d=l.support[j].n_edges; d--; ) {
00292             // Adapt states
00293             o_mod |= ((--states[l.support[j].edges[d].i_state].o_deg) == 0);
00294             i_mod |= ((--states[l.support[j].edges[d].o_state].i_deg) == 0);
00295           }
00296           ++j;
00297         } else if (l.support[j].val > static_cast<Val>(rx.max())) {
00298           ++rx;
00299         } else {
00300           l.support[k++]=l.support[j++];
00301         }
00302       assert(k > 0);
00303       l.size = k;
00304       // Remove remaining values
00305       for (; j<s; j++)
00306         for (Degree d=l.support[j].n_edges; d--; ) {
00307           // Adapt states
00308           o_mod |= ((--states[l.support[j].edges[d].i_state].o_deg) == 0);
00309           i_mod |= ((--states[l.support[j].edges[d].o_state].i_deg) == 0);
00310         }
00311     } else {
00312       Val min = static_cast<Val>(l.x.min(d));
00313       unsigned int j=0;
00314       // Skip values smaller than min (to keep)
00315       for (; l.support[j].val < min; j++) {}
00316       Val max = static_cast<Val>(l.x.max(d));
00317       unsigned int k=j;
00318       unsigned int s=l.size;
00319       // Remove pruned values
00320       for (; (j<s) && (l.support[j].val <= max); j++)
00321         for (Degree d=l.support[j].n_edges; d--; ) {
00322           // Adapt states
00323           o_mod |= ((--states[l.support[j].edges[d].i_state].o_deg) == 0);
00324           i_mod |= ((--states[l.support[j].edges[d].o_state].i_deg) == 0);
00325         }
00326       // Keep remaining values
00327       while (j<s)
00328         l.support[k++]=l.support[j++];
00329       l.size =k;
00330       assert(k > 0);
00331     }
00332 
00333     bool fix = true;
00334     if (o_mod && (a.i > 0)) {
00335       o_ch.add(a.i-1); fix = false;
00336      }
00337     if (i_mod && (a.i+1 < n)) {
00338       i_ch.add(a.i+1); fix = false;
00339     }
00340     if (fix) {
00341       if (View::modevent(d) == ME_INT_VAL) {
00342         a.dispose(home,c);
00343         return c.empty() ? ES_NOFIX : ES_FIX;
00344       }
00345       return ES_FIX;
00346     } else {
00347       return (View::modevent(d) == ME_INT_VAL)
00348         ? ES_SUBSUMED_NOFIX(a,home,c) : ES_NOFIX;
00349     }
00350   }
00351 
00352   template<class View, class Val, class Degree, class StateIdx>
00353   ExecStatus
00354   LayeredGraph<View,Val,Degree,StateIdx>::propagate(Space& home,
00355                                                     const ModEventDelta&) {
00356     // Forward pass
00357     for (int i=i_ch.fst(); i<=i_ch.lst(); i++) {
00358       bool i_mod = false;
00359       bool o_mod = false;
00360       unsigned int j=0;
00361       unsigned int k=0;
00362       unsigned int s=layers[i].size;
00363       do {
00364         for (Degree d=layers[i].support[j].n_edges; d--; )
00365           if (states[layers[i].support[j].edges[d].i_state].i_deg == 0) {
00366             // Adapt states
00367             o_mod |= ((--states[layers[i].support[j].edges[d].i_state].o_deg)
00368                       == 0);
00369             i_mod |= ((--states[layers[i].support[j].edges[d].o_state].i_deg)
00370                       == 0);
00371             // Remove edge
00372             layers[i].support[j].edges[d] = 
00373               layers[i].support[j].edges[--layers[i].support[j].n_edges];
00374           }
00375         // Check whether value is still supported
00376         if (layers[i].support[j].n_edges == 0) {
00377           layers[i].size--;
00378           GECODE_ME_CHECK(layers[i].x.nq(home,layers[i].support[j++].val));
00379         } else {
00380           layers[i].support[k++]=layers[i].support[j++];
00381         }
00382       } while (j<s);
00383       assert(k > 0);
00384       // Update modification information
00385       if (o_mod && (i > 0))
00386         o_ch.add(i-1);
00387       if (i_mod && (i+1 < n))
00388         i_ch.add(i+1);
00389     }
00390     i_ch.reset();
00391 
00392     // Backward pass
00393     for (int i=o_ch.lst(); i>=o_ch.fst(); i--) {
00394       bool o_mod = false;
00395       unsigned int j=0;
00396       unsigned int k=0;
00397       unsigned int s=layers[i].size;
00398       do {
00399         for (Degree d=layers[i].support[j].n_edges; d--; )
00400           if (states[layers[i].support[j].edges[d].o_state].o_deg == 0) {
00401             // Adapt states
00402             o_mod |= ((--states[layers[i].support[j].edges[d].i_state].o_deg) 
00403                       == 0);
00404             --states[layers[i].support[j].edges[d].o_state].i_deg;
00405             // Remove edge
00406             layers[i].support[j].edges[d] = 
00407               layers[i].support[j].edges[--layers[i].support[j].n_edges];
00408           }
00409         // Check whether value is still supported
00410         if (layers[i].support[j].n_edges == 0) {
00411           layers[i].size--;
00412           GECODE_ME_CHECK(layers[i].x.nq(home,layers[i].support[j++].val));
00413         } else {
00414           layers[i].support[k++]=layers[i].support[j++];
00415         }
00416       } while (j<s);
00417       assert(k > 0);
00418       // Update modification information
00419       if (o_mod && (i > 0))
00420         o_ch.add(i-1);
00421     }
00422     o_ch.reset();
00423 
00424     // Check subsumption
00425     if (c.empty()) {
00426       c.dispose(home);
00427       return ES_SUBSUMED(*this,sizeof(*this));
00428     }
00429     return ES_FIX;
00430   }
00431 
00432 
00433   template<class View, class Val, class Degree, class StateIdx>
00434   forceinline size_t
00435   LayeredGraph<View,Val,Degree,StateIdx>::dispose(Space& home) {
00436     c.dispose(home);
00437     (void) Propagator::dispose(home);
00438     return sizeof(*this);
00439   }
00440 
00441   template<class View, class Val, class Degree, class StateIdx>
00442   template<class Var>
00443   ExecStatus
00444   LayeredGraph<View,Val,Degree,StateIdx>::post(Home home, 
00445                                                const VarArgArray<Var>& x,
00446                                                const DFA& dfa) {
00447     if (x.size() == 0) {
00448       // Check whether the start state 0 is also a final state
00449       if ((dfa.final_fst() <= 0) && (dfa.final_lst() >= 0))
00450         return ES_OK;
00451       return ES_FAILED;
00452     }
00453     assert(x.size() > 0);
00454     for (int i=x.size(); i--; ) {
00455       DFA::Symbols s(dfa);
00456       typename VarViewTraits<Var>::View xi(x[i]);
00457       GECODE_ME_CHECK(xi.inter_v(home,s,false));
00458     }
00459     LayeredGraph<View,Val,Degree,StateIdx>* p =
00460       new (home) LayeredGraph<View,Val,Degree,StateIdx>(home,x,dfa);
00461     return p->initialize(home,x,dfa);
00462   }
00463 
00464   template<class View, class Val, class Degree, class StateIdx>
00465   forceinline
00466   LayeredGraph<View,Val,Degree,StateIdx>
00467   ::LayeredGraph(Space& home, bool share,
00468                  LayeredGraph<View,Val,Degree,StateIdx>& p)
00469     : Propagator(home,share,p), n(p.n), n_states(p.n_states),
00470       layers(home.alloc<Layer>(n+2)+1), states(NULL) {
00471     c.update(home,share,p.c);
00472     // The states are not copied but reconstructed when needed (advise)
00473     // Copy layers
00474     for (int i=n; i--; ) {
00475       layers[i].x.update(home,share,p.layers[i].x);
00476       assert(layers[i].x.size() == p.layers[i].size);
00477       layers[i].size = p.layers[i].size;
00478       layers[i].support = home.alloc<Support>(layers[i].size);
00479       for (unsigned int j=layers[i].size; j--; ) {
00480         layers[i].support[j].val = p.layers[i].support[j].val;
00481         layers[i].support[j].n_edges = p.layers[i].support[j].n_edges;
00482         assert(layers[i].support[j].n_edges > 0);
00483         layers[i].support[j].edges = 
00484           home.alloc<Edge>(layers[i].support[j].n_edges);
00485         for (Degree d=layers[i].support[j].n_edges; d--; )
00486           layers[i].support[j].edges[d] = p.layers[i].support[j].edges[d];
00487       }
00488     }
00489   }
00490 
00491   template<class View, class Val, class Degree, class StateIdx>
00492   PropCost
00493   LayeredGraph<View,Val,Degree,StateIdx>::cost(const Space&,
00494                                                const ModEventDelta&) const {
00495     return PropCost::linear(PropCost::HI,n);
00496   }
00497 
00498   template<class View, class Val, class Degree, class StateIdx>
00499   Actor*
00500   LayeredGraph<View,Val,Degree,StateIdx>::copy(Space& home, bool share) {
00501     // Eliminate an assigned prefix
00502     if (layers[0].size == 1) {
00503       /*
00504        * The state information is always available: either the propagator
00505        * has been created (hence, also the state information has been
00506        * created), or the first variable become assigned and hence
00507        * an advisor must have been run (which then has created the state
00508        * information).
00509        */
00510       assert(states != NULL);
00511       // Skip all layers corresponding to assigned views
00512       StateIdx k = 1;
00513       while (layers[k].size == 1)
00514         k++;
00515       // There is only a single edge
00516       assert((layers[k-1].support[0].n_edges == 1) &&
00517              (states[layers[k-1].support[0].edges[0].o_state].i_deg == 1));
00518       // Eliminate assigned layers
00519       n -= k; layers += k;
00520       // Update advisor indices
00521       for (Advisors<Index> as(c); as(); ++as)
00522         as.advisor().i -= k;
00523       // Update states
00524       states += k*n_states;
00525       for (int i=n; i--; )
00526         for (unsigned int j=layers[i].size; j--; )
00527           for (Degree d=layers[i].support[j].n_edges; d--; ) {
00528             layers[i].support[j].edges[d].i_state -= k*n_states;
00529             layers[i].support[j].edges[d].o_state -= k*n_states;
00530           }
00531     }
00532     return new (home) LayeredGraph<View,Val,Degree,StateIdx>(home,share,*this);
00533   }
00534 
00536   template<class Var>
00537   forceinline ExecStatus
00538   post_lgp(Home home, const VarArgArray<Var>& x, const DFA& dfa) {
00539     Gecode::Support::IntType t_state_idx =
00540       Gecode::Support::s_type((x.size()+2)*dfa.n_states());
00541     Gecode::Support::IntType t_degree =
00542       Gecode::Support::u_type(dfa.max_degree());
00543     Gecode::Support::IntType t_val = 
00544       std::max(Support::s_type(dfa.symbol_min()),
00545                Support::s_type(dfa.symbol_max()));
00546     switch (t_val) {
00547     case Gecode::Support::IT_CHAR:
00548     case Gecode::Support::IT_SHRT:
00549       switch (t_state_idx) {
00550       case Gecode::Support::IT_CHAR:
00551         switch (t_degree) {
00552         case Gecode::Support::IT_CHAR:
00553           return Extensional::LayeredGraph
00554             <typename VarViewTraits<Var>::View,short int,unsigned char,signed char>
00555             ::post(home,x,dfa);
00556         case Gecode::Support::IT_SHRT:
00557           return Extensional::LayeredGraph
00558             <typename VarViewTraits<Var>::View,short int,unsigned short int,signed char>
00559             ::post(home,x,dfa);
00560         case Gecode::Support::IT_INT:
00561           return Extensional::LayeredGraph
00562             <typename VarViewTraits<Var>::View,short int,unsigned int,signed char>
00563             ::post(home,x,dfa);
00564         default: GECODE_NEVER;
00565         }
00566         break;
00567       case Gecode::Support::IT_SHRT:
00568         switch (t_degree) {
00569         case Gecode::Support::IT_CHAR:
00570           return Extensional::LayeredGraph
00571             <typename VarViewTraits<Var>::View,short int,unsigned char,short int>
00572             ::post(home,x,dfa);
00573         case Gecode::Support::IT_SHRT:
00574           return Extensional::LayeredGraph
00575             <typename VarViewTraits<Var>::View,short int,unsigned short int,short int>
00576             ::post(home,x,dfa);
00577         case Gecode::Support::IT_INT:
00578           return Extensional::LayeredGraph
00579             <typename VarViewTraits<Var>::View,short int,unsigned int,short int>
00580             ::post(home,x,dfa);
00581         default: GECODE_NEVER;
00582         }
00583         break;
00584       case Gecode::Support::IT_INT:
00585         switch (t_degree) {
00586         case Gecode::Support::IT_CHAR:
00587           return Extensional::LayeredGraph
00588             <typename VarViewTraits<Var>::View,short int,unsigned char,int>
00589             ::post(home,x,dfa);
00590         case Gecode::Support::IT_SHRT:
00591           return Extensional::LayeredGraph
00592             <typename VarViewTraits<Var>::View,short int,unsigned short int,int>
00593             ::post(home,x,dfa);
00594         case Gecode::Support::IT_INT:
00595           return Extensional::LayeredGraph
00596             <typename VarViewTraits<Var>::View,short int,unsigned int,int>
00597             ::post(home,x,dfa);
00598         default: GECODE_NEVER;
00599         }
00600         break;
00601       default: GECODE_NEVER;
00602       }
00603 
00604     case Gecode::Support::IT_INT:
00605       switch (t_state_idx) {
00606       case Gecode::Support::IT_CHAR:
00607         switch (t_degree) {
00608         case Gecode::Support::IT_CHAR:
00609           return Extensional::LayeredGraph
00610             <typename VarViewTraits<Var>::View,int,unsigned char,signed char>
00611             ::post(home,x,dfa);
00612         case Gecode::Support::IT_SHRT:
00613           return Extensional::LayeredGraph
00614             <typename VarViewTraits<Var>::View,int,unsigned short int,signed char>
00615             ::post(home,x,dfa);
00616         case Gecode::Support::IT_INT:
00617           return Extensional::LayeredGraph
00618             <typename VarViewTraits<Var>::View,int,unsigned int,signed char>
00619             ::post(home,x,dfa);
00620         default: GECODE_NEVER;
00621         }
00622         break;
00623       case Gecode::Support::IT_SHRT:
00624         switch (t_degree) {
00625         case Gecode::Support::IT_CHAR:
00626           return Extensional::LayeredGraph
00627             <typename VarViewTraits<Var>::View,int,unsigned char,short int>
00628             ::post(home,x,dfa);
00629         case Gecode::Support::IT_SHRT:
00630           return Extensional::LayeredGraph
00631             <typename VarViewTraits<Var>::View,int,unsigned short int,short int>
00632             ::post(home,x,dfa);
00633         case Gecode::Support::IT_INT:
00634           return Extensional::LayeredGraph
00635             <typename VarViewTraits<Var>::View,int,unsigned int,short int>
00636             ::post(home,x,dfa);
00637         default: GECODE_NEVER;
00638         }
00639         break;
00640       case Gecode::Support::IT_INT:
00641         switch (t_degree) {
00642         case Gecode::Support::IT_CHAR:
00643           return Extensional::LayeredGraph
00644             <typename VarViewTraits<Var>::View,int,unsigned char,int>
00645             ::post(home,x,dfa);
00646         case Gecode::Support::IT_SHRT:
00647           return Extensional::LayeredGraph
00648             <typename VarViewTraits<Var>::View,int,unsigned short int,int>
00649             ::post(home,x,dfa);
00650         case Gecode::Support::IT_INT:
00651           return Extensional::LayeredGraph
00652             <typename VarViewTraits<Var>::View,int,unsigned int,int>
00653             ::post(home,x,dfa);
00654         default: GECODE_NEVER;
00655         }
00656         break;
00657       default: GECODE_NEVER;
00658       }
00659 
00660     default: GECODE_NEVER;
00661     }
00662     return ES_OK;
00663   }
00664 
00665 }}}
00666 
00667 // STATISTICS: int-prop
00668