Codificate 3 predicates in PROLOG with 6 tests cases for each one

Job ID: 30672141

Budget: $10 – $30 USD

Topic:
Lists and Arithmetic in PROLOG

Description:
1. Code a predicate called sumList/2 that takes two parameters. The first is a list of whole numbers, the other a list of whole numbers. The first parameter is the input to the program and the second the output. The predicate must determine if the output list is equal to the input list where one (1) has been added to each element.

2. Code a predicate named listMapSum/2 that takes two parameters. The first is a list of whole numbers and the second is just a number. The predicate will determine if the number passed as a parameter is the sum of all the elements in the list.

3. Code a predicate called sumList2/3 that takes three parameters. The first is a list of whole numbers, the second is just a number, and the third is another list of whole numbers. The first parameter is the input to the program and the third the output. The predicate must determine if the output list is equal to the input list where the integer number passed as the second parameter has been added to each element.

Notes:
- Must deliver the code.
- Six test cases (3 positive and 3 negative) for each one.
- Each one must have a short description specifying how the problem was solved.

Date to deliver:
Jun 27, 2021 - 9:00 PM
Related categories: Prolog