diff --git a/solution.pl b/solution.pl index ba06ea9..5d2ccce 100644 --- a/solution.pl +++ b/solution.pl @@ -219,6 +219,12 @@ selec(Table, Selector, Cond, Projection) :- selector(R,Cols, Selector, [],[],ColumnNames,ColumnValue), Projection = ColumnNames/ColumnValue. +selec(Table, *, Cond, Projection) :- + tabl(Table, Cols), + row(Table, R), + does_match(Cond, Table, R), + Projection = Cols/R. + %base case selector(_,_,[],ColumnNames, ColumnValue, ColumnNames, ColumnValue):-!. /** @@ -253,6 +259,11 @@ selec(TableOrTables, Selectors, Projection) :- selector(R,Cols, Selectors, [],[],ColumnNames,ColumnValue), Projection = ColumnNames/ColumnValue. +selec(Table, *, Projection) :- + tabl(Table, Cols), + row(Table, R), + Projection = Cols/R. + :- dynamic query/2. /* where Query is a string whose syntax is defined by the following grammar: