Nemeth Adam <na498(a)hszk.bme.hu> writes:
ziasztok!
Azt szeretném kérdezni, hogy a honlapon levõ FD predikátumok
jelentését ellenõrzõ segédprogramot hogy kell használni.
A README file-ban ez van:
fdcheck.pl Automatic checking of FD-preds. Load this file, optionally
add a directive describing the intended semantics of your
FD-pred, and another one specifying the test range and
your indexicals will be compared against the given
semantics. (No directives need to be supplied for testing
KHF3, because the defaults are set to support KHF3.)
Azt írja az
fdcheck.pl, hogy "Load this file to have your FD predicates checked
against a Prolog relation.". Betöltöttem, de nem láttam semmi
tesztelést, igaz nem is írtam még meg mind a 4 indexikálist.
A KHF3-rol van szo? Ha igen, akkor lehet, hogy tokeletesen irtad meg,
Ilyenkor alaphelyzetben nem jelez vissza semmit. Ezzel a direktivaval
lehet elerni, hogy a sikeres tesztelest is visszajelezze.
:- fd_check_options([verbose]).
Ha nem a KHF3-beli FD predikátumrol van szo, akkor meg kell adni az elvart
jelentest es a tesztintervallumot is. Erre van pelda a script2 allomanyban,
lasd alabb is.
Kellemes unnepeket es BUEK,
-Peter
sicstus -l fdcheck.pl
% compiling /home/joe/fdpred_semantics/fdcheck.pl...
(...)
% compiled /home/joe/fdpred_semantics/fdcheck.pl in module fd_check, 270 msec 482396
bytes
SICStus 3.9.1 (x86-linux-glibc2.1): Thu Jun 27 22:53:07 CEST 2002
Licensed to IQSOFT
| ?- [user].
% consulting user...
| :- fd_pred_semantics('x=<y=<z'(X,Y,Z), (X=<Y,Y=<Z)).
| :- fd_test_range(1, 3).
| :- fd_check_options([verbose]).
|
| 'x=<y=<z'(X, Y, Z) +:
Y in min(X)..max(Z),
Z in min(Y).. sup,
X in inf..max(Y).
Comparing clause +: , indexical No. 1: Y in min(X)..max(Z)
with relation X=<Y,Y=<Z,
using interval 1..3 ...
... No discrepancy found.
Comparing clause +: , indexical No. 2: Z in min(Y)..sup
with relation X=<Y,Y=<Z,
using interval 1..3 ...
'x=<y=<z'(2,1,1) holds, while 2=<1,1=<1 is not true
'x=<y=<z'(2,1,2) holds, while 2=<1,1=<2 is not true
'x=<y=<z'(2,1,3) holds, while 2=<1,1=<3 is not true
'x=<y=<z'(3,1,1) holds, while 3=<1,1=<1 is not true
'x=<y=<z'(3,1,2) holds, while 3=<1,1=<2 is not true
'x=<y=<z'(3,1,3) holds, while 3=<1,1=<3 is not true
'x=<y=<z'(3,2,2) holds, while 3=<2,2=<2 is not true
'x=<y=<z'(3,2,3) holds, while 3=<2,2=<3 is not true
Comparing clause +: , indexical No. 3: X in inf..max(Y)
with relation X=<Y,Y=<Z,
using interval 1..3 ...
'x=<y=<z'(1,2,1) holds, while 1=<2,2=<1 is not true
'x=<y=<z'(1,3,1) holds, while 1=<3,3=<1 is not true
'x=<y=<z'(1,3,2) holds, while 1=<3,3=<2 is not true
'x=<y=<z'(2,2,1) holds, while 2=<2,2=<1 is not true
'x=<y=<z'(2,3,1) holds, while 2=<3,3=<1 is not true
'x=<y=<z'(2,3,2) holds, while 2=<3,3=<2 is not true
'x=<y=<z'(3,3,1) holds, while 3=<3,3=<1 is not true
'x=<y=<z'(3,3,2) holds, while 3=<3,3=<2 is not true
|
% consulted user in module user, 10 msec 2392 bytes
yes
| ?- [user].
% consulting user...
| 'x=<y=<z'(X, Y, Z) +: % Ez már helyes!}
Y in min(X)..max(Z),
Z in ((inf..max(Y)) /\ dom(X)) ? (min(Y)..sup),
X in ((min(Y)..sup) /\ dom(Z)) ? (inf..max(Y)).
Comparing clause +: , indexical No. 1: Y in min(X)..max(Z)
with relation X=<Y,Y=<Z,
using interval 1..3 ...
... No discrepancy found.
Comparing clause +: , indexical No. 2: Z in((inf..max(Y))/\dom(X))?(min(Y)..sup)
with relation X=<Y,Y=<Z,
using interval 1..3 ...
... No discrepancy found.
Comparing clause +: , indexical No. 3: X in((min(Y)..sup)/\dom(Z))?(inf..max(Y))
with relation X=<Y,Y=<Z,
using interval 1..3 ...
... No discrepancy found.
|
% consulted user in module user, 10 msec -920 bytes
yes
| ?-