
- Prolog - Home
- Prolog - Introduction
- Prolog - Environment Setup
- Prolog - Hello World
- Prolog - Basics
- Prolog - Relations
- Prolog - Data Objects
- Loop & Decision Making
- Conjunctions & Disjunctions
Prolog Operators
- Prolog - Type of Operators
- Prolog - Arithmetic Comparison Operators
- Prolog - Unification Operators
- Prolog - Term Comparision Operators
- Prolog - Arithmetic Operators
- Prolog - Logical Operators
- Prolog - List Operators
- Prolog - Custom Operators
Prolog Lists
- Prolog - Lists
- Prolog - Member of List
- Prolog - Length of List
- Prolog - Concatenating Lists
- Prolog - Appending to a List
- Prolog - Deleting from a List
- Prolog - Inserting into a List
- Prolog - Permutation Operation
- Prolog - Combination Operation
- Prolog - Reverse Items of a List
- Prolog - Shift Items of a List
- Prolog - Check Order of a List
- Prolog - SubSet of a Set
- Prolog - Union of Sets
- Prolog - Intersection of Sets
- Prolog - Even and Odd Length Finding
- Prolog - Divide a List
- Prolog - Find Maximum of a List
- Prolog - Find Minimum of a List
- Prolog - Find Sum of a List
- Prolog - Sorting List using MergeSort
Built-In Predicates
- Prolog - Built-In Predicates
- Prolog - Identifying Terms
- Prolog - Decomposing Structures
- Prolog - Collecting All
- Prolog - Mathematical Predicates
- Prolog - Scientific Predicates
Miscellaneous
- Recursion and Structures
- Prolog - Backtracking
- Prolog - Preventing Backtracking
- Prolog - Different and Not
- Prolog - Inputs and Outputs
- Tree Data Structure (Case Study)
- Prolog - Examples
- Prolog - Basic Programs
- Prolog - Practical Arithmetic Examples
- Prolog - Examples of Cuts
- Towers of Hanoi Problem
- Prolog - Linked Lists
- Monkey and Banana Problem
- Prolog Useful Resources
- Prolog - Quick Guide
- Prolog - Useful Resources
- Prolog - Discussion
Prolog - Scientific Predicates
Following are the scientific predicates −
Predicates | Description |
---|---|
sin(X). | Sine of X where X is in radians. |
cos(X). | Cosine of X where X is in radians. |
tan(X). | Tangent of X where X is in radians. |
asin(X). | Arcsine of X where X is in radians. |
acos(X). | Arccosine of X where X is in radians. |
atan(X) | Arctangent of X where X is in radians. |
sinh(X) | Hyperbolic Sine of X where X is in radians. |
cosh(X). | Hyperbolic Cosine of X where X is in radians. |
tanh(X) | Hyperbolic Tangent of X where X is in radians. |
asinh(X). | Hyperbolic Arcsine of X where X is in radians. |
acosh(X) | Hyperbolic Arccosine of X where X is in radians. |
atanh(X) | Hyperbolic Arctangent of X where X is in radians. |
log(X) | Log of X |
log10(X) | Log10 of X |
exp(X) | Exponential of X |
Now let us see some of these functions in action using Prolog programs.
Example
| ?- X is sin(0) . X = 0.0 yes | ?- X is sin(1). X = 0.8414709848078965 yes | ?- X is cos(0). X = 1.0 yes | ?- X is cos(1). X = 0.54030230586813977 yes | ?- X is tan(0). X = 0.0 yes | ?- X is tan(1). X = 1.5574077246549023 yes | ?-
Example
| ?- X is asin(1). X = 1.5707963267948966 yes | ?- X is sinh(1). X = 1.1752011936438014 yes | ?- X is asinh(1). X = 0.88137358701954305 yes | ?-
Example
| ?- X is log(10). X = 2.3025850929940459 yes | ?- X is log10(10). X = 1.0 yes | ?- X is exp(2). X = 7.3890560989306504 yes | ?-
Advertisements