.


:




:

































 

 

 

 


2.




/
write(Term) Term.
read(Term) Term. .
tell(File) .
told .
see(File) .
seen .
append(List1,List2, List3) , List3 List1 List2. . .
append(ListOfLists, List) , ListOfLists List. : .
member(Elem, List) , Elem List. Elem.
nextto(X, Y, List) , Y X List.
delete(List1, Elem, List2) List1 Elem. List2.
select(Elem, List, Rest) , Rest List Elem. . : ?- select(a,L,[1,2,3]). L = [a, 1, 2, 3]; L = [1, a, 2, 3]; L = [1, 2, a, 3]; L = [1, 2, 3, a]; false.
nth0(Index, List, Elem) , List Index Elem. 0.
nth1(Index, List, Elem) , nth0/3, 1
last(List, Elem) , Elem List. List , .
reverse(List1, List2) List1 List2.
permutation(List1, List2) , List1 List2 .
sumlist(List, Sum) Sum List.
max_list(List, Max) Max List.
min_list(List,Min) Min List.
IntExpr1 mod IntExpr2 IntExpr1 IntExpr2.
IntExpr1 // IntExpr2 IntExpr1 IntExpr2
sleep(Time) Time .
Term =.. List Term List, , . : ?- a(b(1),2,3,X)=..L. L = [a, b(1), 2, 3, X]. ?- a(b(1),2,3,X)=..[a,b(X)|_]. X = 1. ?- a(Y,2,3,X)=..[a,b(2)|_]. Y = b(2). ?- Term=..[a,b,c(4),1,2,3,X]. Term = a(b, c(4), 1, 2, 3, X). .
call(Goal) Goal. , , . : ?- assert(a(1)). ?-read(Y),X=..[a,Y],call(X). |: 1. Y = 1, X = a(1). ?- read(Y),X=..[a,Y],call(X). |: 23. false.
op(Precedence, Type, Name) Name, Precedence Type Name. ( . 17)

SWI-Prolog . Help->Online Manual ?-help. ( ) .

 

1. . . - .: , 1988. - 349 .

2. ., . . - .: , 1987. - 336 .

3. ., . . - .: , 1989, - 235 .

4. . . - .: , 1990. - 560 .

5. . . - .: , 1990. - 280 .

6. . . - .: , 1990.- 464 .

7. .. . - .: , 1993. - 368 .

 

 

1. SWI/PROLOG. ... 3

1.1. ... 3

1.2. .. 3

1.3. .. 8

1.4. ... 9

2. . .. 16

2.1. .. 16

2.2. -... 16

2.3. ... 17

2.4. .. 18

3. .. 20

3.1. .. 20

3.2. .. 23

3.3. ... 24

4. ... 24

4.1. (CUT) 24

4.2. BAF-.. 26

4.3. UDR-.. 27

4.4. (SNIP) 28

5. .. 30

6. . . 32

7. 1. SWI/PROLOG.. 36

7.1. .. 36

7.2. ... 36

7.3. . 37

7.4. .. 37

7.5. .. 38

7.6. .. 38

7.7. ... 38

8. 2. . 39

.. 42

 


[1] .

[2] SWI/PROLOG- .

[3] .

[4] ( ) .

[5] , X>0, ( ).

[6] .

[7] .. .

[8] (') (").

[9] .





:


: 2015-10-01; !; : 472 |


:

:

: , , , , .
==> ...

1464 - | 1341 -


© 2015-2024 lektsii.org - -

: 0.017 .