Changeset 4432 for trunk/examples
- Timestamp:
- 08/18/08 17:07:31 (5 months ago)
- Location:
- trunk/examples/constraints
- Files:
-
- 3 added
- 9 modified
-
bp/clique.lgt (added)
-
bp/loader.lgt (modified) (1 diff)
-
bp/magic.lgt (added)
-
bp/NOTES.txt (modified) (1 diff)
-
bp/SCRIPT.txt (modified) (1 diff)
-
bp/steiner.lgt (added)
-
swipl/hexagon.lgt (modified) (2 diffs)
-
swipl/NOTES.txt (modified) (1 diff)
-
swipl/puzzle.lgt (modified) (1 diff)
-
swipl/queens.lgt (modified) (1 diff)
-
swipl/sudoku.lgt (modified) (1 diff)
-
yap/NOTES.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/constraints/bp/loader.lgt
r4415 r4432 1 1 2 2 :- initialization(( 3 logtalk_load([ puzzle]))).3 logtalk_load([clique, magic, puzzle, steiner]))). -
trunk/examples/constraints/bp/NOTES.txt
r4415 r4432 12 12 To load this example and for sample queries, please see the SCRIPT.txt file. 13 13 14 This folder contains a simple example illustrating how to use B-Prolog 15 constraint support with Logtalk. 14 This folder contains a set of simple examples illustrating how to use B-Prolog 15 constraint support with Logtalk. These examples are adapted with permission 16 from the original author, Neng-Fa Zhou. 17 18 The B-Prolog ::/2 finite-domain built-in predicate clashes with the Logtalk 19 ::/2 message sending operator. The solution is to use instead the alternative 20 in/2 predicate. 21 22 The built-in predicate_property/2 predicate fails to report some of the 23 constraint predicates as built-in predicates. The solution is to encapsulate 24 calls to these predicates using the {}/1 Logtalk control construct. -
trunk/examples/constraints/bp/SCRIPT.txt
r4415 r4432 16 16 17 17 18 | ?- clique::go. 19 clique(17) 20 clique(16) 21 clique(15) 22 clique(14) 23 clique(13) 24 clique(12) 25 clique(11) 26 clique(10) 27 clique(9) 28 clique(8) 29 clique(7) 30 clique(6) 31 clique(5) 32 {13,14,15,16,17} 33 cputime=447 34 yes 35 36 37 | ?- magic::go. 38 [[2,6,38,41,42,43,3],[29,4,30,39,28,5,40],[22,32,24,33,31,17,16],[34,36,21,1,11,35,37],[19,25,44,15,47,13,12],[23,45,8,26,7,48,18],[46,27,10,20,9,14,49]] 39 execution time is 357milliseconds 40 yes 41 42 18 43 | ?- puzzle::solve(V). 19 44 V = [9,5,6,7,1,0,8,2] ? 20 45 yes 46 47 48 | ?- steiner::go. 49 [{1,2,3},{1,4,5},{1,6,7},{1,8,9},{2,4,6},{2,5,8},{2,7,9},{3,4,9},{3,5,7},{3,6,8},{4,7,8},{5,6,9}] 50 cputime=80 51 yes -
trunk/examples/constraints/swipl/hexagon.lgt
r4415 r4432 1 2 % code adapted to Logtalk by Paulo Moura from one of the CLP(FD) examples 3 % written by Markus Triska (August 2008) 4 5 1 6 % Written 2006 by Markus Triska triska@gmx.at 2 7 % Public domain code. … … 9 14 Q R S 10 15 */ 16 11 17 12 18 :- object(hexagon). -
trunk/examples/constraints/swipl/NOTES.txt
r4428 r4432 13 13 14 14 This folder contains a set of simple examples illustrating how to use Markus 15 Triska's CLP(FD) library distributed with SWI-Prolog with Logtalk. 15 Triska's CLP(FD) library distributed with SWI-Prolog with Logtalk. These 16 examples are adapted with permission from the original author, Markus Triska. 17 18 The CLP(FD) library is loaded from the "loader.lgt" auxiliary loader file. 19 This library must always be loaded prior to compilation of the individual 20 example files. -
trunk/examples/constraints/swipl/puzzle.lgt
r4415 r4432 1 1 2 % code adapted from one of the examples distributed with the CLP(FD) library 2 % code adapted to Logtalk by Paulo Moura from one of the CLP(FD) examples 3 % written by Markus Triska (August 2008) 4 3 5 4 6 :- object(puzzle). -
trunk/examples/constraints/swipl/queens.lgt
r4421 r4432 1 2 % code adapted to Logtalk by Paulo Moura from one of the CLP(FD) examples 3 % written by Markus Triska (August 2008) 4 5 1 6 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 7 N Queens animation demo. -
trunk/examples/constraints/swipl/sudoku.lgt
r4421 r4432 1 2 % code adapted to Logtalk by Paulo Moura from one of the CLP(FD) examples 3 % written by Markus Triska (August 2008) 4 5 1 6 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 7 Sudoku CLP(FD) animation. -
trunk/examples/constraints/yap/NOTES.txt
r4428 r4432 13 13 14 14 This folder contains a set of simple examples illustrating how to use Markus 15 Triska's CLP(FD) library distributed with YAP with Logtalk. 15 Triska's CLP(FD) library distributed with YAP with Logtalk. These examples 16 are adapted with permission from the original author, Markus Triska. 17 18 The CLP(FD) library is loaded from the "loader.lgt" auxiliary loader file. 19 This library must always be loaded prior to compilation of the individual 20 example files.
