: , . , 4.0 3.5.
Predicates
nondeterm Stud(string, real)
nondeterm Do(real,real)
Goal
Do(4.0, 3.5).
Clauses
Stud(,4.5).
Stud(,4.0).
Stud(,3.2).
Do(Bal1,Bal2):-stud(Pr,B), B>Bal1,write(Pr),nl,fail;
stud(Pr, B), B<Bal2,write(Pr),nl,fail.
Do(_,_).
, , . , .
1.2.6 .
. , 3.
:
1) ǒ, ᒺ , ᒺ, ᒺ. : ᒺ , , . ᒺ , .
2) ᒺ, ᒺ. , ᒺ. , Stud(,4.5) count(0).
3) . ǒ . : Stud(,4.5). . count(0). count(1), .
4) , , Predicates. , , Facts.
: Facts
Count(integer)
Predicates
Stud(string, real)
5) ' ( ᒺ AND OR) Goal;
6) , , .
3 䳿:
- 0;
- ;
- 4.0;
- , 0 1;
- 䳿 ;
- .
7) Clauses ;
8) . , , .
9) ;
10) . Test Goal , - Visual Prolog V 5.2.
11) . ϳ WRITE, .
12) Visual Prolog - Debugger.
1.3
1
1. , . , . , , 3 .
2. , : , , . , , .