Re: Efficiently finding combinations
- From: "arv832" <andrew.verden@xxxxxxxxxxxxx>
- Date: 20 May 2005 05:32:48 -0700
In IF/Prolog (see http://www.ifcomputer.de/Products/Prolog/ )
:- import const_domain.
:- import const_delay.
one_hundred(A,B,C,D,E) :-
[A,B,C,D,E] in 1..100,
A + B + C + D + E ?= 100,
A ?=< B, B ?=< C, C ?=< D, D ?=< E,
const_div([A,B,C,D,E]),
label([A,B,C,D,E]).
const_div([]).
const_div([V|T]) :-
freeze(V,once((0 is V mod 2 ; 0 is V mod 5))),
const_div(T).
.
- References:
- Efficiently finding combinations
- From: publiustemp-googlegroups
- Re: Efficiently finding combinations
- From: Bill Spight
- Re: Efficiently finding combinations
- From: Warwick Harvey
- Efficiently finding combinations
- Prev by Date: Re: Efficiently finding combinations
- Next by Date: help with parsing and dcg (swi-prolog in particular)
- Previous by thread: Re: Efficiently finding combinations
- Next by thread: Re: Efficiently finding combinations
- Index(es):