subject

Write prolog clauses that define each of the following predicates: a. exactly_3(x) is true if x is a list with exactly three elements. b. at_least_3(x) is true if x is a list with at least three elements. c. at_most_3(x) is true if x is list with at most three elements. hint: use four clauses. d. intersect(x, y) is true if x and y are lists with an element in common. intersect([1,2,3,4],[5,4,1,6]) holds, but intersect([1,2,3,4],[5,6]) does not hold. hint: use member but no recursion. e. all_intersect(z, y) is true if every element of list z is a list x such that intersect(x, y) holds. all_intersect([[1,2,3],[5,4,6]],[3, 4]) holds, and all_intersect([],[3,4]) holds, but all_intersect([[1,2,3],[1,2,5],[5,4 ,6]],[3,4]) does not hold.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 21:40
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings. for each match, add one point to user_score. upon a mismatch, end the game. sample output with inputs: 'rrgbryybgy' 'rrgbbrybgy'
Answers: 3
question
Computers and Technology, 24.06.2019 17:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately
Answers: 2
question
Computers and Technology, 24.06.2019 19:00
In python a floating-point number must be written using scientific notation?
Answers: 1
question
Computers and Technology, 25.06.2019 04:30
What is the purpose of network permissions? a)to control access to network resources b)to convert to wireless networking c)to enable the installation of nics d)to reduce operating costs
Answers: 1
You know the right answer?
Write prolog clauses that define each of the following predicates: a. exactly_3(x) is true if x is...
Questions
question
History, 23.09.2019 00:30
question
Mathematics, 23.09.2019 00:30