This commit is contained in:
2023-03-09 15:38:54 +01:00
parent 01f700ec4d
commit c8da38880b
3 changed files with 19 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
left(1,wine). left(1,year). right(1,quality).
left(2,wine). left(2,year). right(2,price).
row(10,wine,chablis). row(10,year,1995). row(10,quality,good). row(10,price,17).
row(9,wine,chablis). row(9,year,1995). row(9,quality,good). row(9,price,18).
row(11,wine,chablis). row(11,year,1996). row(11,quality,excellent). row(11,price,23).
row(12,wine,rothschild). row(12,year,1997). row(12,quality,good). row(12,price,29).
row(13,wine,rothschild). row(13,year,1997). row(13,quality,excellent). row(13,price,29).

2
pip3/q1.db Normal file
View File

@@ -0,0 +1,2 @@
qrow(100,wine,chablis). qrow(100,quality,excellent). qrow(100,year,1996).
qrow(101,wine,rothschild). qrow(101,quality,excellent).

16
pip3/sat.lp Normal file
View File

@@ -0,0 +1,16 @@
%#show qunsat/2.
%#show qsat/1.
%#show sat/0.
#show unsat/0.
%#show exist/4.
qsat(Q,R) :- qrow(Q,A,V), row(R,A,V), not qunsat(Q,R).
qunsat(Q,R) :- qrow(Q,_,_), row(R,_,_), not qsat(Q,R).
:- qsat(Q,R), qrow(Q,A,V), not row(R,A,V).
%qunsat(I) :- qrow(I,A1,V1), qrow(I,A2,V2), not exist(A1,V1,A2,V2), A1 != A2.
qsat(I) :- qsat(I,_).
%unsat() :- qrow(I,G1,G2), not qsat(I).
:- qrow(I,G1,G2), not qsat(I).
%sat() :- not unsat().