pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

Re: Constraint solver in Pharo?

S
stephan
Fri, Nov 6, 2020 2:12 PM

Replacing BTNGVariable>>#nextValue by

nextValue
    | nextValue |
    self currentValue
        ifNotNil: [valuesToExplore remove: self currentValue].
    nextValue := self valuesToExplore ifEmpty: [ nil ]
                ifNotEmpty: [self valuesToExplore anyOne].
    self currentValue: nextValue.
    ^ nextValue

returning nil instead of self when there are no more new values
makes the tests pass in BackTalkNG-Noury.20.mcz (Pharo 9)

That version looks like it is work in progress but has one working
solver.

Stephan

Replacing BTNGVariable>>#nextValue by nextValue     | nextValue |     self currentValue         ifNotNil: [valuesToExplore remove: self currentValue].     nextValue := self valuesToExplore ifEmpty: [ nil ]                 ifNotEmpty: [self valuesToExplore anyOne].     self currentValue: nextValue.     ^ nextValue returning nil instead of self when there are no more new values makes the tests pass in BackTalkNG-Noury.20.mcz (Pharo 9) That version looks like it is work in progress but has one working solver. Stephan
SD
Stéphane Ducasse
Fri, Nov 6, 2020 2:58 PM

Hi stephan did you publish the code?

On 6 Nov 2020, at 15:12, stephan stephan@stack.nl wrote:

Replacing BTNGVariable>>#nextValue by

nextValue
| nextValue |
self currentValue
ifNotNil: [valuesToExplore remove: self currentValue].
nextValue := self valuesToExplore ifEmpty: [ nil ]
ifNotEmpty: [self valuesToExplore anyOne].
self currentValue: nextValue.
^ nextValue

returning nil instead of self when there are no more new values
makes the tests pass in BackTalkNG-Noury.20.mcz (Pharo 9)

That version looks like it is work in progress but has one working
solver.

Stephan


Stéphane Ducasse
http://stephane.ducasse.free.fr / http://www.pharo.org
03 59 35 87 52
Assistant: Aurore Dalle
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Hi stephan did you publish the code? > On 6 Nov 2020, at 15:12, stephan <stephan@stack.nl> wrote: > > Replacing BTNGVariable>>#nextValue by > > nextValue > | nextValue | > self currentValue > ifNotNil: [valuesToExplore remove: self currentValue]. > nextValue := self valuesToExplore ifEmpty: [ nil ] > ifNotEmpty: [self valuesToExplore anyOne]. > self currentValue: nextValue. > ^ nextValue > > returning nil instead of self when there are no more new values > makes the tests pass in BackTalkNG-Noury.20.mcz (Pharo 9) > > That version looks like it is work in progress but has one working > solver. > > Stephan > -------------------------------------------- Stéphane Ducasse http://stephane.ducasse.free.fr / http://www.pharo.org 03 59 35 87 52 Assistant: Aurore Dalle FAX 03 59 57 78 50 TEL 03 59 35 86 16 S. Ducasse - Inria 40, avenue Halley, Parc Scientifique de la Haute Borne, Bât.A, Park Plaza Villeneuve d'Ascq 59650 France
NB
Noury Bouraqadi
Fri, Nov 6, 2020 4:34 PM

Thanx Stefan for the fix.
Since there's some interest in this, I've migrated the code to GitHub and added a baseline.
So, Stefan you can add your fix and make a PR :-)

Noury
On Nov 6 2020, at 3:58 pm, Stéphane Ducasse stephane.ducasse@inria.fr wrote:

Hi stephan did you publish the code?

On 6 Nov 2020, at 15:12, stephan <stephan@stack.nl (mailto:stephan@stack.nl)> wrote:
Replacing BTNGVariable>>#nextValue by
nextValue
| nextValue |
self currentValue
ifNotNil: [valuesToExplore remove: self currentValue].
nextValue := self valuesToExplore ifEmpty: [ nil ]
ifNotEmpty: [self valuesToExplore anyOne].
self currentValue: nextValue.
^ nextValue

returning nil instead of self when there are no more new values
makes the tests pass in BackTalkNG-Noury.20.mcz (Pharo 9)

That version looks like it is work in progress but has one working
solver.

Stephan


Stéphane Ducasse
http://stephane.ducasse.free.fr / http://www.pharo.org
03 59 35 87 52
Assistant: Aurore Dalle
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Thanx Stefan for the fix. Since there's some interest in this, I've migrated the code to GitHub and added a baseline. So, Stefan you can add your fix and make a PR :-) Noury On Nov 6 2020, at 3:58 pm, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote: > Hi stephan did you publish the code? > > > On 6 Nov 2020, at 15:12, stephan <stephan@stack.nl (mailto:stephan@stack.nl)> wrote: > > Replacing BTNGVariable>>#nextValue by > > nextValue > > | nextValue | > > self currentValue > > ifNotNil: [valuesToExplore remove: self currentValue]. > > nextValue := self valuesToExplore ifEmpty: [ nil ] > > ifNotEmpty: [self valuesToExplore anyOne]. > > self currentValue: nextValue. > > ^ nextValue > > > > returning nil instead of self when there are no more new values > > makes the tests pass in BackTalkNG-Noury.20.mcz (Pharo 9) > > > > That version looks like it is work in progress but has one working > > solver. > > > > Stephan > > -------------------------------------------- > Stéphane Ducasse > http://stephane.ducasse.free.fr / http://www.pharo.org > 03 59 35 87 52 > Assistant: Aurore Dalle > FAX 03 59 57 78 50 > TEL 03 59 35 86 16 > S. Ducasse - Inria > 40, avenue Halley, > Parc Scientifique de la Haute Borne, Bât.A, Park Plaza > Villeneuve d'Ascq 59650 > France > > > > > > > >
S
stephan
Fri, Nov 6, 2020 5:32 PM

https://github.com/bouraqadi/BackTalkNG/pull/1

On 06-11-2020 17:34, Noury Bouraqadi wrote:

Thanx Stefan for the fix.
Since there's some interest in this, I've migrated the code to GitHub
and added a baseline.
So,  Stefan you can add your fix and make a PR :-)

Noury

On Nov 6 2020, at 3:58 pm, Stéphane Ducasse
stephane.ducasse@inria.fr wrote:

 Hi stephan did you publish the code?

     On 6 Nov 2020, at 15:12, stephan <stephan@stack.nl
     <mailto:stephan@stack.nl>> wrote:

     Replacing BTNGVariable>>#nextValue by

     nextValue
         | nextValue |
         self currentValue
             ifNotNil: [valuesToExplore remove: self currentValue].
         nextValue := self valuesToExplore ifEmpty: [ nil ]
                     ifNotEmpty: [self valuesToExplore anyOne].
         self currentValue: nextValue.
         ^ nextValue

     returning nil instead of self when there are no more new values
     makes the tests pass in BackTalkNG-Noury.20.mcz (Pharo 9)

     That version looks like it is work in progress but has one working
     solver.

     Stephan


 --------------------------------------------
 Stéphane Ducasse
 http://stephane.ducasse.free.fr / http://www.pharo.org
 03 59 35 87 52
 Assistant: Aurore Dalle
 FAX 03 59 57 78 50
 TEL 03 59 35 86 16
 S. Ducasse - Inria
 40, avenue Halley,
 Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
 Villeneuve d'Ascq 59650
 France
https://github.com/bouraqadi/BackTalkNG/pull/1 On 06-11-2020 17:34, Noury Bouraqadi wrote: > Thanx Stefan for the fix. > Since there's some interest in this, I've migrated the code to GitHub > and added a baseline. > So,  Stefan you can add your fix and make a PR :-) > > Noury > > On Nov 6 2020, at 3:58 pm, Stéphane Ducasse > <stephane.ducasse@inria.fr> wrote: > > Hi stephan did you publish the code? > > On 6 Nov 2020, at 15:12, stephan <stephan@stack.nl > <mailto:stephan@stack.nl>> wrote: > > Replacing BTNGVariable>>#nextValue by > > nextValue >     | nextValue | >     self currentValue >         ifNotNil: [valuesToExplore remove: self currentValue]. >     nextValue := self valuesToExplore ifEmpty: [ nil ] >                 ifNotEmpty: [self valuesToExplore anyOne]. >     self currentValue: nextValue. >     ^ nextValue > > returning nil instead of self when there are no more new values > makes the tests pass in BackTalkNG-Noury.20.mcz (Pharo 9) > > That version looks like it is work in progress but has one working > solver. > > Stephan > > > -------------------------------------------- > Stéphane Ducasse > http://stephane.ducasse.free.fr / http://www.pharo.org > 03 59 35 87 52 > Assistant: Aurore Dalle > FAX 03 59 57 78 50 > TEL 03 59 35 86 16 > S. Ducasse - Inria > 40, avenue Halley, > Parc Scientifique de la Haute Borne, Bât.A, Park Plaza > Villeneuve d'Ascq 59650 > France >
NB
Noury Bouraqadi
Tue, Nov 10, 2020 1:57 PM

Thanks Stefan. I've integrated your PR.

On Nov 6 2020, at 6:32 pm, stephan stephan@stack.nl wrote:

https://github.com/bouraqadi/BackTalkNG/pull/1

On 06-11-2020 17:34, Noury Bouraqadi wrote:

Thanx Stefan for the fix.
Since there's some interest in this, I've migrated the code to GitHub and added a baseline.
So, Stefan you can add your fix and make a PR :-)

Noury
On Nov 6 2020, at 3:58 pm, Stéphane Ducasse stephane.ducasse@inria.fr (mailto:stephane.ducasse@inria.fr) wrote:

Hi stephan did you publish the code?

On 6 Nov 2020, at 15:12, stephan <stephan@stack.nl (mailto:stephan@stack.nl)> wrote:
Replacing BTNGVariable>>#nextValue by
nextValue
| nextValue |
self currentValue
ifNotNil: [valuesToExplore remove: self currentValue].
nextValue := self valuesToExplore ifEmpty: [ nil ]
ifNotEmpty: [self valuesToExplore anyOne].
self currentValue: nextValue.
^ nextValue

returning nil instead of self when there are no more new values
makes the tests pass in BackTalkNG-Noury.20.mcz (Pharo 9)

That version looks like it is work in progress but has one working
solver.

Stephan


Stéphane Ducasse
http://stephane.ducasse.free.fr / http://www.pharo.org
03 59 35 87 52
Assistant: Aurore Dalle
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Thanks Stefan. I've integrated your PR. On Nov 6 2020, at 6:32 pm, stephan <stephan@stack.nl> wrote: > > https://github.com/bouraqadi/BackTalkNG/pull/1 > > > On 06-11-2020 17:34, Noury Bouraqadi wrote: > > > > Thanx Stefan for the fix. > > Since there's some interest in this, I've migrated the code to GitHub and added a baseline. > > So, Stefan you can add your fix and make a PR :-) > > > > Noury > > On Nov 6 2020, at 3:58 pm, Stéphane Ducasse <stephane.ducasse@inria.fr> (mailto:stephane.ducasse@inria.fr) wrote: > > > Hi stephan did you publish the code? > > > > > > > On 6 Nov 2020, at 15:12, stephan <stephan@stack.nl (mailto:stephan@stack.nl)> wrote: > > > > Replacing BTNGVariable>>#nextValue by > > > > nextValue > > > > | nextValue | > > > > self currentValue > > > > ifNotNil: [valuesToExplore remove: self currentValue]. > > > > nextValue := self valuesToExplore ifEmpty: [ nil ] > > > > ifNotEmpty: [self valuesToExplore anyOne]. > > > > self currentValue: nextValue. > > > > ^ nextValue > > > > > > > > returning nil instead of self when there are no more new values > > > > makes the tests pass in BackTalkNG-Noury.20.mcz (Pharo 9) > > > > > > > > That version looks like it is work in progress but has one working > > > > solver. > > > > > > > > Stephan > > > > > > -------------------------------------------- > > > Stéphane Ducasse > > > http://stephane.ducasse.free.fr / http://www.pharo.org > > > 03 59 35 87 52 > > > Assistant: Aurore Dalle > > > FAX 03 59 57 78 50 > > > TEL 03 59 35 86 16 > > > S. Ducasse - Inria > > > 40, avenue Halley, > > > Parc Scientifique de la Haute Borne, Bât.A, Park Plaza > > > Villeneuve d'Ascq 59650 > > > France > > > > > > > > > > > > > > > > > > > > > > > > > > >