Variables are specialised → terms to store information during runtime. They can be used to define → literals with a placeholder and (in contrast to → atoms or literals) begin with an upper-case letter.
There are two kinds of variables
_
, which can be used as a substitute in cases where the content of the variable is not of interest, but a variable has to be provided.Examples:
Based on the → time example we added some variables to extract the hour and minute part of the literal
Note: The upper-case variablestime( current( hour( Hour ), minute( Minute ), period( Period ) ) )
Hour
,Minute
andPeriod
can be assigned to values automatically. This mechanism is called → unification.