Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using Logic Programming Prolog like Example 1 and 2 Example: Counting the elements of a list: DOMAINS list=integer* PREDICATES length_of_list(list, integer) CLAUSES length_of_list([],0). length_of_list([HT], L):-

using Logic Programming "Prolog" like Example

image text in transcribedimage text in transcribedimage text in transcribed

1 and 2

Example: Counting the elements of a list: DOMAINS list=integer* PREDICATES length_of_list(list, integer) CLAUSES length_of_list([],0). length_of_list([HT], L):- length_of_list(T,M), L=M+1. GOAL length_of_list([1,2,3], L). % length_of_list([1,2,3,4,5), L). Visual Prolog Licensed to Javier Enriquez - (noname.pro] File Edit Project Purchase Web Options Window Help PORSG 16:33 Insert Indent Modif DOMAINS list- integer* PREDICATES length_of_list (list, integer) Buy CLAUSES online length_of_list([],0). VISA length_of_list([HII], 1):- length_of_list(1,M), L=H+1. GOAL length_of_list([1,2,3], 1). * length_of_list([1,2,3,4,5),L). Output: [Inactive C:\Users\Qureshi AppData\Local\Temp goal$000.exe] L=3 1 Solution Lab Assessment 1. Write a prolog program to insert Real numbers into a list. 2. Write a prolog program to insert Strings into a list

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago