mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
Estimated hours taken: 1.5
Branches: main
Add G12's backjump module to the standard library.
This will not be inlcuded in the library documentation or announced until
more of the XXXs have been dealt with.
I've included a diff between the G12 version of the backjump
module and this one below.
library/backump.m:
A module (from G12) that provides support for backjumping.
There are a number of minor modifications from the G12 version in
order to make this compile in .par and .profdeep grades but it is
otherwise unchanged.
library/library.m:
Include the new module.
doc/Mmakefile:
Do not include the backjump module in the library reference guide
for now.
tests/hard_coded/Mmakefile:
tests/hard_coded/backjump_test.{m,exp}:
Test backjumping (from the G12 nogood example.)
26 lines
393 B
Plaintext
26 lines
393 B
Plaintext
label A = 1, (0)
|
|
label B = 1, (1)
|
|
label C = 1, (2)
|
|
label C = 2, (3)
|
|
backjump (3)
|
|
label C = 3, (4)
|
|
solution 1, 1, 3
|
|
label B = 2, (5)
|
|
label C = 1, (6)
|
|
backjump (0)
|
|
label A = 2, (7)
|
|
label B = 1, (8)
|
|
label C = 1, (9)
|
|
solution 2, 1, 1
|
|
label C = 2, (10)
|
|
backjump (8)
|
|
label B = 2, (11)
|
|
label C = 1, (12)
|
|
label C = 2, (13)
|
|
solution 2, 2, 2
|
|
label C = 3, (14)
|
|
Solutions:
|
|
{1, 1, 3},
|
|
{2, 1, 1},
|
|
{2, 2, 2}
|