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
Brums [2.3K]
3 years ago
13

Write a Common Lisp predicate function that tests for the structural equality of two given lists. Two lists are structurally equ

al if they have the same list structure, although their atoms may be different. A script of defining and testing the function in Clisp on the empress system must be submitted.
Computers and Technology
1 answer:
zysi [14]3 years ago
6 0

Answer:

Explanation:

For the Program plan:

1. Two lists are structurally equal if they have the same list structure, although their atoms may be different.

2. So we are going to write a function that will check if elements in both lists at same position are atoms or not.

3. If yes then it should return true else false.

Program:

#lang scheme

( define (structurally-equal list1 list2)

(cond ((and (null? list1) (null? list2)) #t)

((or (null? list1) (null? list2)) #f)

((and (atom? (car list1)) (atom? (car list2)))

(structurally-equal (cdr list1) (cdr list2)))

((or (atom? (car list1)) (atom? (car list2))) #f)

(else (and (structurally-equal (car list1) (car list2))

(structurally-equal (cdr list1) (cdr list2) )))))

( define (atom? x) (not (or (pair? x) (null? x))))

You might be interested in
Develop an sec (single error correction) code for a 16-bit data word. generate the code for the data word 0101000000111001. show
Kipish [7]

Answer:

code = 010100000001101000101

Explanation:

Steps:

The inequality yields 2^{k} - 1 > = M+K, where M = 16. Therefore,

The second step will be to arrange the data bits and check the bits. This will be as follows:

Bit position              number              Check bits            Data Bits

21                                   10101

20                                  10100

The bits are checked up to bit position 1

Thus, the code is 010100000001101000101

3 0
4 years ago
Read 2 more answers
As a student, how can you help your family to preserve food? *please just needed :( *​
Arlecino [84]

Answer:

sorry I need points

Explanation:

sorry

5 0
3 years ago
Read 2 more answers
IoT is the interconnection of what?<br> Hardware<br> Networks<br> Everyday devices<br> Cables
Natalka [10]

Answer:

Everyday Devices

Explanation:

As we know that Internet of Things (IOT) include connected security systems, thermostats, cars, electronic appliances, lights in household and commercial environments, alarm clocks, speaker systems and vending machines.

3 0
3 years ago
Please help. Will give brainliest
Sergeeva-Olga [200]
I don’t understand it sorry :(.
4 0
3 years ago
Formulas in excel start with​
Bond [772]

Answer:

They usually start with the equal sign (=)

Explanation:

   </3 PureBeauty

6 0
3 years ago
Other questions:
  • What is diffie-hellman most commonly used for?
    15·1 answer
  • The different types of DDR modules are easily identifiable because of what factor?
    8·2 answers
  • When using a line graph, why is it important to only graph 1-3 series of data?
    14·1 answer
  • ________ is a mobile broadband technology that relies on microwave transmissions to blanket large metropolitan areas from microw
    11·1 answer
  • Which of the following is not a component of Google Display ads' value proposition?
    9·1 answer
  • When you open as many links as you want, and still stay in the same browser window instead of cluttering your screen with multip
    5·1 answer
  • Note oj cyber security​
    6·1 answer
  • 1. What does the word “processing” in data pro- cessing mean?
    13·2 answers
  • who here plays overwatch or paladins ps4? I'm getting overwatch soon and need people to play with. please don't report this.​
    14·1 answer
  • How exactly do you find the circumference by using C++ Programming? I really need a specific answer.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!