Re: Constraint solver in Pharo?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Constraint solver in Pharo?

Stephan Eggermont-3
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

Reply | Threaded
Open this post in threaded view
|

Re: Constraint solver in Pharo?

Stéphane Ducasse
Hi stephan did you publish the code?

On 6 Nov 2020, at 15:12, stephan <[hidden email]> 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
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

Reply | Threaded
Open this post in threaded view
|

Re: Constraint solver in Pharo?

Noury Bouraqadi-2
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 <[hidden email]> wrote:
Hi stephan did you publish the code?

On 6 Nov 2020, at 15:12, stephan <[hidden email]> 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
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
Reply | Threaded
Open this post in threaded view
|

Re: Constraint solver in Pharo?

Stephan Eggermont-3

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 [hidden email] wrote:
Hi stephan did you publish the code?

On 6 Nov 2020, at 15:12, stephan <[hidden email]> 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
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
Reply | Threaded
Open this post in threaded view
|

Re: Constraint solver in Pharo?

Noury Bouraqadi-2
Thanks Stefan. I've integrated your PR.

On Nov 6 2020, at 6:32 pm, stephan <[hidden email]> wrote:
 

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 [hidden email] wrote:
Hi stephan did you publish the code?

On 6 Nov 2020, at 15:12, stephan <[hidden email]> 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
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