What are the Different Data Types in PROLOG?
Data Types in PROLOG:
There are nine types of Data Types in PROLOG.
1. Char: Character is enclosed between a pair of single quotes.
2. Integer: A whole number in the range of -32768 to 32767.
3. Real: Positive or negative special character followed by digits.
4. String: Any set of characters enclosed within a pair of double-quotes. Strings can include up to 255 characters.
5. Symbol: A sequence of letters (A to Z or a to z) digits (0 to 9) and the special character underscore(_).
6. Variables: A variable is a symbol that can be assigned different values at different stages of the execution of the program.
7. Reserved words: PROLOG has some reserved words and it must not be used in place of user-defined names.
and, asserta, assertz, bound, clauses, database, domains, fail, findall, free, global, goal, if, include, not, or, predicate, readterm, retract.
8. Arithmetic Operators: +, -, * and / are basic arithmetic operators in PROLOG.
9. Relational Operators: PROLOG uses <, <=, =, >, >= <> relational operators. In PROLOG, a relational operator can be a goal or subgoal. The relational operator (=) looks the same as an assignment operator.