Well, since Goal is determined, nothing can do better than this:

----------------------
fun {NTimesE N E}
  if N == 0 then nil else E|{NTimesE N-1 E} end
end

proc {ForAllNeighbs L P}
  {ForAllTail L
      proc {$ T}
         case T of X|Y|_ then (P X Y} else skip end
      end}
end

fun {MySpecialConstr Goal Len}
  L = {FD.list Goal-1 1#Goal}
in
  {ForAllNeighbs L proc {$ A B} (A <: 5) =: (A <: B) end}
  {List.forAllInd L proc {$ I D} I =<: D end}
  {Append L {NTimesE Len-Goal+1 Goal}}
end
-----------------------

However, this looks like something nobody should ever need :o)

Cheers,

Jorge.

Kilian Sprotte escreveu:
> Hi,
>
> I am looking for a way to constrain a sequence to be "ascending
> towards a goal". The goal is determined before posting, let's say its
> 5, so a solution could be:
>
> [1 2 4 5 5]
>
> I could say something like the following for all neighbors A B in the
> sequence:
>
> (A <: 5) =: (A <: B)
>
> But my problem is that starting from the following
>
> [1#5 1#5 1#5 1#5 1#5]
>
> I would like to get immediate propagation to
>
>   [1#5 2#5 3#5 4#5 5]
>
> --
>
> I imagine that this would be a slight variation to the <: propagator,
> but I was looking for a way to build this from given primitives, if
> possible.
>
> What approach would you suggest?
>
> Thanks for any hints,
>    Kilian
>
>
> _________________________________________________________________________________
> mozart-users mailing list
> [email protected]
> http://www.mozart-oz.org/mailman/listinfo/mozart-users


Jorge M. Pelizzoni
ICMC - Universidade de São Paulo

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to