Prevent ERROR when loading solution.pl
This commit is contained in:
parent
dc73df33b0
commit
960c362703
22
solution.pl
22
solution.pl
|
@ -31,14 +31,14 @@ order as they were supplied to create table/2).
|
||||||
If the given table does not exist, the predicate must throw a descriptive
|
If the given table does not exist, the predicate must throw a descriptive
|
||||||
exception (use throw/1).
|
exception (use throw/1).
|
||||||
*/
|
*/
|
||||||
cols(Table, Cols).
|
/* cols(Table, Cols). */
|
||||||
|
|
||||||
:- dynamic row/2.
|
:- dynamic row/2.
|
||||||
/*
|
/*
|
||||||
Unifies Row, one result at a time, with each row in the given Table.
|
Unifies Row, one result at a time, with each row in the given Table.
|
||||||
If the given table does not exist, the predicate should fail.
|
If the given table does not exist, the predicate should fail.
|
||||||
*/
|
*/
|
||||||
row(Table, Row).
|
/* row(Table, Row). */
|
||||||
|
|
||||||
:- dynamic rows/1.
|
:- dynamic rows/1.
|
||||||
/*
|
/*
|
||||||
|
@ -46,7 +46,7 @@ Displays all rows in the given table, one per line (use writeln/1).
|
||||||
If the given table does not exist, the predicate must throw a descriptive
|
If the given table does not exist, the predicate must throw a descriptive
|
||||||
exception.
|
exception.
|
||||||
*/
|
*/
|
||||||
rows(Table).
|
/* rows(Table). */
|
||||||
|
|
||||||
:- dynamic insert/2.
|
:- dynamic insert/2.
|
||||||
/*
|
/*
|
||||||
|
@ -59,7 +59,7 @@ exception.
|
||||||
If the row does not have as many elements as the number of columns in
|
If the row does not have as many elements as the number of columns in
|
||||||
the table, the predicate must throw a descriptive exception.
|
the table, the predicate must throw a descriptive exception.
|
||||||
*/
|
*/
|
||||||
insert(Table, Row).
|
/* insert(Table, Row). */
|
||||||
|
|
||||||
:- dynamic drop/1.
|
:- dynamic drop/1.
|
||||||
/*
|
/*
|
||||||
|
@ -71,7 +71,7 @@ and signature later on.
|
||||||
If the given table does not exist, the predicate must throw a descriptive
|
If the given table does not exist, the predicate must throw a descriptive
|
||||||
exception.
|
exception.
|
||||||
*/
|
*/
|
||||||
drop(Table).
|
/* drop(Table). */
|
||||||
|
|
||||||
:- dynamic delete/1.
|
:- dynamic delete/1.
|
||||||
/*
|
/*
|
||||||
|
@ -81,7 +81,7 @@ more rows.
|
||||||
If the given table does not exist, the predicate must throw a descriptive
|
If the given table does not exist, the predicate must throw a descriptive
|
||||||
exception.
|
exception.
|
||||||
*/
|
*/
|
||||||
delete(Table).
|
/* delete(Table). */
|
||||||
|
|
||||||
:- dynamic delete/2.
|
:- dynamic delete/2.
|
||||||
/*
|
/*
|
||||||
|
@ -95,7 +95,7 @@ prompt, but which may include selectors. Selectors are terms of the form
|
||||||
+<column>where <column>should be replaced by a column name.
|
+<column>where <column>should be replaced by a column name.
|
||||||
(See tests.pl for some concrete usage examples.)
|
(See tests.pl for some concrete usage examples.)
|
||||||
*/
|
*/
|
||||||
delete(Table, Conds).
|
/* delete(Table, Conds). */
|
||||||
|
|
||||||
:- dynamic selec/4.
|
:- dynamic selec/4.
|
||||||
/*
|
/*
|
||||||
|
@ -127,14 +127,14 @@ For example:
|
||||||
findall(Values, selec(persons,[+id,+first],[],Values), Projections)
|
findall(Values, selec(persons,[+id,+first],[],Values), Projections)
|
||||||
returns: Projections = [[0, "Jeffrey"], [1, "Lorena"], [2, "Joseph"], ...
|
returns: Projections = [[0, "Jeffrey"], [1, "Lorena"], [2, "Joseph"], ...
|
||||||
*/
|
*/
|
||||||
selec(Table, Selectors, Conds, Projection).
|
/* selec(Table, Selectors, Conds, Projection). */
|
||||||
|
|
||||||
:- dynamic selec/3.
|
:- dynamic selec/3.
|
||||||
/*
|
/*
|
||||||
Simplified variant of the selec/4 predicate when there are no conditions
|
Simplified variant of the selec/4 predicate when there are no conditions
|
||||||
to be checked.
|
to be checked.
|
||||||
*/
|
*/
|
||||||
selec(TableOrTables, Selectors, Projection).
|
/* selec(TableOrTables, Selectors, Projection). */
|
||||||
|
|
||||||
:- dynamic query/2.
|
:- dynamic query/2.
|
||||||
/*
|
/*
|
||||||
|
@ -182,10 +182,10 @@ selec/4 predicate.
|
||||||
For “INSERT”, nothing needs to be printed by query/1 or in case of
|
For “INSERT”, nothing needs to be printed by query/1 or in case of
|
||||||
success, and if query/2 is used the Result parameter can be ignored.
|
success, and if query/2 is used the Result parameter can be ignored.
|
||||||
*/
|
*/
|
||||||
query(Query, Result).
|
/* query(Query, Result). */
|
||||||
|
|
||||||
:- dynamic query/1.
|
:- dynamic query/1.
|
||||||
/*
|
/*
|
||||||
cf. query/2
|
cf. query/2
|
||||||
*/
|
*/
|
||||||
query(Query).
|
/* query(Query). */
|
||||||
|
|
Loading…
Reference in New Issue