Prolog/Predicati built-in: differenze tra le versioni

Wikibooks, manuali e libri di testo liberi.
Contenuto cancellato Contenuto aggiunto
Tux3 (discussione | contributi)
m Nuova pagina: List of built-in predicates in ISO Prolog. ==Term unification== ;=/2 :Prolog unification ;unify_with_occurs_check/2 : ;(\=)/2 :Not Prolog unifiable ==Type testing== ;var/1 :True if t...
 
Tux3 (discussione | contributi)
mNessun oggetto della modifica
Riga 1: Riga 1:
List of built-in predicates in ISO Prolog.
Lista di predicati built-in nel Prolog iso standard.


==unificazione Termini==
==Term unification==
;=/2
;=/2
:Unificazione Prolog
:Prolog unification
;unify_with_occurs_check/2
;unify_with_occurs_check/2
:
:
;(\=)/2
;(\=)/2
:Not Prolog unifiable
:Prolog non unificabile


==Type testing==
==Test==
;var/1
;var/1
:Vero se il termine corrente e' una variabile
:True if term currently is a variable
;atom/1
;atom/1
:Vero se il termine corrente e' legato ad un atomo
:True if term is bound to an atom
;integer/1
;integer/1
:Vero se il temirne e' intero
:True if term is bound to an integer
;float/1
;float/1
:Vero se il termine e' un numero in virgola mobile
:True if term is bound to a floating point number
;atomic/1
;atomic/1
:Veor se il termine e' atomo intero o in virgola mobile
:True if term is bound to an atom, integer or floating point number
;compound/1
;compound/1
:Vero se il termine e' composto
:True if term is bound to a compound term
;nonvar/1
;nonvar/1
:Vero se il termine corrente non e' una variabile
:True if term is not a variable
;number/1
;number/1
:True if term is bound to an integer or floating point number
:True if term is bound to an integer or floating point number


==Term comparison==
==Comparazione==
;(@=<)/2
;(@=<)/2
:Termine meno di o uguale a
:Term less than or equal to
;(==)/2
;(==)/2
:Termine identico
:Term identical
;(\==)/2
;(\==)/2
:Termine non identico
:Term not identical
;(@<)/2
;(@<)/2
:Termine inferiore a
:Term less than
;(@>)/2
;(@>)/2
:Termine superiore a
:Term greater than
;(@>=)/2
;(@>=)/2
:Termine piu' grande di o uguale a
:Term greater than or equal to


==Creazione e decomposizione di termini==
==Term creation and decomposition==
;functor/3
;funtore/3
:
:
;arg/3
;arg/3
Riga 51: Riga 51:
:
:


==Valutazione aritmetica==
==Arithmetic evaluation==
;is/2
;is/2
:
:


==Comparazione aritmetica==
==Arithmetic comparison==
;'=:='/2
;'=:='/2
:uguaglianza aritmetica
:Arithmetic equal
;'=\='/2
;'=\='/2
:Disuguaglianza aritmetica
:Arithmetic not equal
;'<'/2
;'<'/2
:minore aritmetico
:Arithmetic less than
;'=<'/2
;'=<'/2
:minore o uguale di aritmetico
:Arithmetic less than or equal to
;'>'/2
;'>'/2
:Maggiore aritmetico
:Arithmetic greater than
;'>='/2
;'>='/2
:"Maggiore o uguale di" aritmetico
:Arithmetic greater than or equal to


==Clauses==
==Vincoli==


===Clause retrieval and information===
===Clause retrieval and information===
Riga 77: Riga 77:
:
:


===Creazione e distruzione di vincoli===
===Clause creation and destruction===
; asserta/1
; asserta/1
:
:
Riga 87: Riga 87:
:
:


==All solutions==
==Tutte le soluzioni==
;findall/3
;findall/3
:
:
Riga 95: Riga 95:
:
:


==Input and output==
==Input e output==


===Selezione e controllo di flusso===
===Stream selection and control===
;current_input/1
;current_input/1
:
:
Riga 107: Riga 107:
:
:
;open/4, open/3
;open/4, open/3
:Opening a stream
:Aprire uno stream di dati
;close/1, close/2
;close/1, close/2
:Closing a stream
:Chiudere uno stream di dati
;stream_property/2
;stream_property/2
:
:
Riga 117: Riga 117:
:
:


===Character input-output===
===Caratteri input-output===
;get_char/2, get_char/1
;get_char/2, get_char/1
:
:
Riga 132: Riga 132:
;nl/0, nl/1
;nl/0, nl/1
:
:
===Reading from binary streams===
===Lettura da stream binari===
;get_byte/2, get_byte/1
;get_byte/2, get_byte/1
:
:
Riga 140: Riga 140:
:
:


===Term input and output===
===Termini input e output===
;read_term/2, read_term/3
;read_term/2, read_term/3
:
:
Riga 224: Riga 224:
:Valore assoluto
:Valore assoluto
;(sign)/1
;(sign)/1
:Segno
:Sign
;(float_integer_part)/1
;(float_integer_part)/1
:Parte intera
:Integer part
;(float_fractional_part)/1
;(float_fractional_part)/1
:Parte frazionale
:Fractional part
;(float)/1
;(float)/1
:Float coercion
:Float coercion
;(floor)/1
;(floor)/1
:Eccesso
:Floor
;(truncate)/1
;(truncate)/1
:Troncamento
:Truncate
;(round)/1
;(round)/1
:Arrotondamento
:Round
;(ceiling)/1
;(ceiling)/1
:Ceiling
:Ceiling

Versione delle 23:53, 18 dic 2008

Lista di predicati built-in nel Prolog iso standard.

unificazione Termini

=/2
Unificazione Prolog
unify_with_occurs_check/2
(\=)/2
Prolog non unificabile

Test

var/1
Vero se il termine corrente e' una variabile
atom/1
Vero se il termine corrente e' legato ad un atomo
integer/1
Vero se il temirne e' intero
float/1
Vero se il termine e' un numero in virgola mobile
atomic/1
Veor se il termine e' atomo intero o in virgola mobile
compound/1
Vero se il termine e' composto
nonvar/1
Vero se il termine corrente non e' una variabile
number/1
True if term is bound to an integer or floating point number

Comparazione

(@=<)/2
Termine meno di o uguale a
(==)/2
Termine identico
(\==)/2
Termine non identico
(@<)/2
Termine inferiore a
(@>)/2
Termine superiore a
(@>=)/2
Termine piu' grande di o uguale a

Creazione e decomposizione di termini

funtore/3
arg/3
(=../2)
copy_term/2

Valutazione aritmetica

is/2

Comparazione aritmetica

'=:='/2
uguaglianza aritmetica
'=\='/2
Disuguaglianza aritmetica
'<'/2
minore aritmetico
'=<'/2
minore o uguale di aritmetico
'>'/2
Maggiore aritmetico
'>='/2
"Maggiore o uguale di" aritmetico

Vincoli

Clause retrieval and information

clause/2
current_predicate/1

Creazione e distruzione di vincoli

asserta/1
assertz/1
retract/1
abolish/1

Tutte le soluzioni

findall/3
bagof/3
setof/3

Input e output

Selezione e controllo di flusso

current_input/1
current_output/1
set_input/1
set_output/1
open/4, open/3
Aprire uno stream di dati
close/1, close/2
Chiudere uno stream di dati
stream_property/2
at_end_of_stream/1, at_end_of_stream/0
set_stream_position/2

Caratteri input-output

get_char/2, get_char/1
get_code/2, get_code/1
peek_char/2, peek_char/1
peek_code/2, peek_code/1
put_char/2, put_char/1
put_code/2, put_code/1
nl/0, nl/1

Lettura da stream binari

get_byte/2, get_byte/1
peek_byte/2, peek_byte/1
put_byte/2, put_byte/1

Termini input e output

read_term/2, read_term/3
read/1, read/2

Termini di scrittura

write_term/3, write_term/2
write/1, write/2
writeq/1, writeq/2
write_canonical/1, write_canonical/2

Operatori

op/3
current_op/3

Conversione di caratteri

char_conversion/2
current_char_conversion/2

Logica e controllo

(\+)/1
Not provable
once/1
repeat/0

Atom processing

atom_length/2
atom_concat/3
sub_atom/5
atom_chars
atom_codes/2
char_code/2
number_chars/2
number_codes/2

Implementazione definita

set_prolog_flag/2
current_prolog_flag/2
halt/0, halt/1

Funtori

Funtori di valore

(+)/2
Addizione
(-)/2
Sottrazione
(*)/2
Moltiplicazione
(//)/2
Divisione intero
(/)/2
Divisione
(rem)/2
Rimando
(mod)/2
Modulo
(-)/1
Negazione
(abs)/1
Valore assoluto
(sign)/1
Segno
(float_integer_part)/1
Parte intera
(float_fractional_part)/1
Parte frazionale
(float)/1
Float coercion
(floor)/1
Eccesso
(truncate)/1
Troncamento
(round)/1
Arrotondamento
(ceiling)/1
Ceiling

Funzioni aritmetiche e di bit

(**)/2
Potenza
sin/1
Seno
cos/1
Coseno
atan/1
Arcotangente
exp/1
Esponente
log/1
Logaritmo
sqrt/1
Radice quadrata
(>>)/2
Scorrimento Bit a destra
(<<)/2
Scorrimento bit a sinistra
(/\)/2
Bitwise and
(\/)/2
Bitwise or
(\)/1
Bitwise complemento