1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Artyom0805 [142]
3 years ago
10

Define a function in Scheme (or relation in Prolog) that checks whether a set of elements (represented as a list) is a subset of

another set (represented as a list).
Computers and Technology
1 answer:
mafiozo [28]3 years ago
4 0

Answer:

subset([],[]).

       subset([X|L],[X|S]) :-

           subset(L,S).

       subset(L, [_|S]) :-

           subset(L,S).

Success:

     subset([1,3], [1,2,3]).

     subset(X, [1,3,4]).        % error handling to compare sets in a given order

Fail:

     subset([2,1], [1,2,3]).   % compares in a different order from the first.

Explanation:

The function "Subset" in the source code above accepts two sets, then checks if the first set is a subset of the second. The code returns true if the condition is met.

You might be interested in
Describe the history of the Internet and WWW
Sladkaya [172]

Explanation:

 Internet is the worldwide system that is publicly available and it interconnect various computer network in the system for transmission of data. Robert E. Kahn was the founder of internet in 1960s by the creation of Advanced research agency network (ARPANET).

WWW is the world wide web system and it is the combination of various types of resources and the users. The world wide web is the universal network that access data and uses the HTTP( hypertext transfer protocol). It is basically invented by Sir tim berners-Lee in 1989.

6 0
3 years ago
Kiểm tra cặp số hứa hôn
SCORPION-xisa [38]

Answer:

Sorry im not Vietnam so please explain it in English or ask someone who can speak Vietnam to help you

3 0
3 years ago
Which was the first computer network in the world
Igoryamba

Answer:

ARPAnet in 1969

Explanation:

hope this helps :)

3 0
3 years ago
If the variable data refers to the string "No way!", then what does the expression data[-1] evaluate to
kati45 [8]

Answer:

'!'

Explanation:

In python, a string can be traversed from end very easily by using negative indexes, so, if index 0 points to the first element of the string, then, index -1 will point to the last element of the string, that is why, when data[-1] is printed last element of data, which is '!' is printed. Also, it can take more parameters separated by a colon, which are end index and step.

7 0
3 years ago
Keyboards and printers are two examples of _________ devices.
galben [10]
Input device your welcome
8 0
3 years ago
Other questions:
  • Jackson is teaching the decimal number system. He wants his students to know how to expand numbers by powers of 10. Which is the
    13·2 answers
  • What folder is used to store offline files and folders managed by the offline files utility?
    15·1 answer
  • Please explain in simple words. What does a root do to your tablet? And how do you do it? Is it worth doing it if you only play
    13·1 answer
  • In a proper webpage, which tag holds all of a webpages visible HTML?
    5·1 answer
  • Which type of business is best for Juanita to start? a corporation, because she needs a large investment to get started a sole p
    13·2 answers
  • This refers to the people involved in the data processing operation.
    14·1 answer
  • What is the term meaning a Java object that has attributes and methods?
    12·1 answer
  • What is an overview of your opinion of Digital Etiquette? Do not look it up bc I will know!
    7·1 answer
  • A safety procedure that enables a trusted party to have a copy of the encryption key is called key __________.
    9·1 answer
  • Match the definitions to their respective cli hot keys and shortcuts. (not all options are used.)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!