Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Prolog.pptx
1.
2.
3. CONSTANT
ATOM
– names or objects
- strings of letters, digits, underscore
- start with lower case letter
- sai,b59, target_2025,
- ‘Varma’ – if we enclose in single quotes, it is a atom
NUMBER
- 500
- 345.567
- -342.5675
4. VARIABLE
- Start with Upper-case letter or underscore
- X
- Sum
- Student_list
- Shoppinglist
- _a50
- Anonymous variable – no name
- This is written using single underscore _
- The name is not revealed, only true/false is given
5. STRUCTURE
- They are data objects that contain multiple components
- For example to represent Date – day, month & year
- date( 9, jun, 2022 ).
- Structure can have another structure
- E.g:
- p1 – point(1,1)
- p2 – point(2,3)
- S – seg(p1,p2)
- T – triangle( point( 4,9), point( 6,4 ), point( 7,1 ) )
6. OPERATORS
1. COMPARISION / RELATIONAL
X >Y X is greater than Y
X >=Y X is greater than or equal to Y
X < Y X is less than Y
X =< Y X is less than or equal to Y
X =:= Y X and Y values are equal
X == Y X and Y values are not equal
?- 5 > 10
7. OPERATORS
ARITHMETIC
+ addition
- subtraction
* multiplication
/ decimal division 20 / 8 give 2.5
** power
// integer division 20 // 8 give 2
mod modulus
24 mod 8 give 0
24 mod 9 give 6
15 mod 20 give 15