1: 1 1 CALL pred interactive.main/2-0 (cc_multi) interactive.m:27 mdb> echo on Command echo enabled. mdb> step 4 5: 3 2 CALL pred interactive.queen/2-0 (nondet) interactive.m:48 (interactive.m:28) mdb> query interactive list ?- append(X, Y, ['a', 'b', 'c']). :001: Inferred :- pred query(mdb_query.inputs, list.list(character), :001: list.list(character)). X = [], Y = ['a', 'b', 'c'], true ; X = ['a'], Y = ['b', 'c'], true ; X = ['a', 'b'], Y = ['c'], true ; X = ['a', 'b', 'c'], Y = [], true ; fail. No (more) solutions. ?- qperm([1,2,3], List). :001: Inferred :- pred query(mdb_query.inputs, list.list(int)). List = [1, 2, 3], true ; List = [1, 3, 2], true ; List = [2, 1, 3], true ; List = [2, 3, 1], true ; List = [3, 1, 2], true ; List = [3, 2, 1], true ; fail. No (more) solutions. ?- qperm([1,2,3], List), List = [2 | _]. :001: Inferred :- pred query(mdb_query.inputs, list.list(int)). List = [2, 1, 3], true ; List = [2, 3, 1], true ; fail. No (more) solutions. ?- qperm([1,2,3], List), List = [4 | _]. :001: Inferred :- pred query(mdb_query.inputs, list.list(int)). fail. No (more) solutions. ?- qperm([1,2,"foo"], List). :001: In clause for predicate `query'/2: :001: in argument 1 of call to predicate `qperm'/2: :001: in list element #2: :001: type error in unification of argument :001: and constant `"foo"'. :001: argument has type `int', :001: constant `"foo"' has type `string'. For more information, recompile with `-E'. Compilation error(s) occurred. ?- qperm(List, [1]). :001: In clause for `query(in, out)': :001: in argument 1 of call to predicate `interactive.qperm'/2: :001: mode error: variable `List' has instantiatedness `free', :001: expected instantiatedness was `ground'. :001: Inferred :- pred query(mdb_query.inputs, list.list(int)). Compilation error(s) occurred. ?- queen(Data, Solution). :001: Inferred :- pred query(mdb_query.inputs, list.list(int)). Solution = [1, 3, 5, 2, 4], true ; Solution = [1, 4, 2, 5, 3], true ; Solution = [2, 4, 1, 3, 5], true ; Solution = [2, 5, 3, 1, 4], true ; Solution = [3, 1, 4, 2, 5], true ; Solution = [3, 5, 2, 4, 1], true ; Solution = [4, 1, 3, 5, 2], true ; Solution = [4, 2, 5, 3, 1], true ; Solution = [5, 2, 4, 1, 3], true ; Solution = [5, 3, 1, 4, 2], true ; fail. No (more) solutions. ?- det_take(10, Data, Start). :001: Inferred :- pred query(mdb_query.inputs, list.list(int)). *** caught exception: software_error("list.m: predicate `list.det_take\'/3: Unexpected: index out of range") No (more) solutions. ?- quit. mdb> cc_query interactive list ?- append(X, Y, ['a', 'b', 'c']). :001: Inferred :- pred query(mdb_query.inputs, list.list(character), :001: list.list(character)). X = [], Y = ['a', 'b', 'c'], true. ?- qperm([1,2,3], List). :001: Inferred :- pred query(mdb_query.inputs, list.list(int)). List = [1, 2, 3], true. ?- qperm([1,2,3], List), List = [2 | _]. :001: Inferred :- pred query(mdb_query.inputs, list.list(int)). List = [2, 1, 3], true. ?- qperm([1,2,3], List), List = [4 | _]. :001: Inferred :- pred query(mdb_query.inputs, list.list(int)). No solution. ?- queen(Data, Solution). :001: Inferred :- pred query(mdb_query.inputs, list.list(int)). Solution = [1, 3, 5, 2, 4], true. ?- det_take(10, Data, Start). :001: Inferred :- pred query(mdb_query.inputs, list.list(int)). *** caught exception: software_error("list.m: predicate `list.det_take\'/3: Unexpected: index out of range") ?- quit. mdb> io_query interactive list run <-- main. :001: Inferred :- pred query(mdb_query.inputs, io.state, io.state). [1, 3, 5, 2, 4] run <-- if { append(X, Y, ['a', 'b', 'c']) } then print("X = "), print(X), print(", Y = "), print(Y), nl else print("No solution\n"). :001: Inferred :- pred query(mdb_query.inputs, io.state, io.state). X = [], Y = ['a', 'b', 'c'] run <-- if { qperm([1,2,3], List) } then print(List), nl else []. :001: Inferred :- pred query(mdb_query.inputs, io.state, io.state). [1, 2, 3] run <-- if { qperm([1,2,3], List), List = [2 | _] } then print(List), nl else { true }. :001: Inferred :- pred query(mdb_query.inputs, io.state, io.state). [2, 1, 3] run <-- if { qperm([1,2,3], List), List = [4 | _] } then print(List), nl else print("No solution, as expected."), io__nl. :001: Inferred :- pred query(mdb_query.inputs, io.state, io.state). No solution, as expected. run <-- if { queen(Data, Solution) } then print(Solution), nl else { true }. :001: Inferred :- pred query(mdb_query.inputs, io.state, io.state). [1, 3, 5, 2, 4] run <-- { det_take(10, Data, Start) }, print(Start), nl. :001: Inferred :- pred query(mdb_query.inputs, io.state, io.state). *** caught exception: software_error("list.m: predicate `list.det_take\'/3: Unexpected: index out of range") run <-- quit. mdb> continue -n -S [1, 3, 5, 2, 4]