Tutorial by Examples

Let's consider the predicate sumDif/2, verified if the structure of a list matches several constraints. The first term represents the list to analyze and the second term another list that holds the part of the first list that is unknown to our constraints. For the demonstration, sumDif/2 recognizes...
Let's define a grammar enabling us to perform additions, multiplications with the usage of parenthesis. To add more value to this example, we are going to compute the result of the arithmetic expression. Summary of the grammar: expression → times expression → times '+' expression times → elemen...

Page 1 of 1