Computer Science: An Overview (12th Edition)
12th Edition
ISBN: 9780133760064
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 6.7, Problem 4QE
Explanation of Solution
Given code:
sibling(X,Y) :- parent(Z,X), parent(Z,Y).
Unexpected conclusion with given relationship:
- The rules state the condition for siblings.
- The above rule is insufficient for Prolog to understand the relationship.
- It may lead to conclude that the sibling of “X” is “X” itself.
- In this case there is no association stated between “X” and “Y”...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Can someone please help me with this question?
6
Study the following program:
a(A,[A|B]).
a(A,[C|B]) :- a(A,B).
Explain in clear steps how Prolog evaluates the following query using the above program: a(b,[c,d,b,f].
Chapter 6 Solutions
Computer Science: An Overview (12th Edition)
Ch. 6.1 - In what sense is a program in a third-generation...Ch. 6.1 - We can summarize the imperative programming...Ch. 6.1 - Prob. 4QECh. 6.2 - Why is the use of a constant considered better...Ch. 6.2 - Prob. 2QECh. 6.2 - Prob. 3QECh. 6.2 - Identity some common control structures found in...Ch. 6.2 - What is the difference between an array and an...Ch. 6.3 - Prob. 1QECh. 6.3 - Prob. 2QE
Ch. 6.3 - Why do many programming languages implement I/O...Ch. 6.3 - Prob. 4QECh. 6.3 - Prob. 5QECh. 6.4 - Prob. 1QECh. 6.4 - What is a symbol table?Ch. 6.4 - What is the difference between a terminal and a...Ch. 6.4 - Prob. 4QECh. 6.4 - Prob. 5QECh. 6.4 - Prob. 6QECh. 6.5 - What is the difference between an object and a...Ch. 6.5 - Prob. 2QECh. 6.5 - Suppose the classes PartTimeEmployee and...Ch. 6.5 - What is a constructor?Ch. 6.5 - Why are some items within a class designated as...Ch. 6.6 - Prob. 1QECh. 6.6 - Prob. 2QECh. 6.6 - Prob. 3QECh. 6.7 - Prob. 2QECh. 6.7 - Prob. 3QECh. 6.7 - Prob. 4QECh. 6 - Prob. 1CRPCh. 6 - Translate the following Python program into the...Ch. 6 - Prob. 3CRPCh. 6 - Why was it necessary to identify the type of data...Ch. 6 - Prob. 6CRPCh. 6 - Suppose the function f expects two numeric values...Ch. 6 - Suppose f is a function that returns the result of...Ch. 6 - Prob. 9CRPCh. 6 - Summarize the distinction between a machine...Ch. 6 - John Programmer argues that the ability to declare...Ch. 6 - Summarize the distinction between declarative...Ch. 6 - Explain the differences between a literal, a...Ch. 6 - a. What is operator precedence? b. Depending on...Ch. 6 - Prob. 16CRPCh. 6 - What is the difference between the meaning of the...Ch. 6 - Draw a flowchart representing the structure...Ch. 6 - Prob. 19CRPCh. 6 - Prob. 20CRPCh. 6 - Draw a flowchart representing the structure...Ch. 6 - Rewrite the following program segment using a...Ch. 6 - Summarize the following rats-nest routine with a...Ch. 6 - Prob. 24CRPCh. 6 - Prob. 25CRPCh. 6 - Suppose the variable X in a program was declared...Ch. 6 - Prob. 27CRPCh. 6 - Why would a large array probably not be passed to...Ch. 6 - Sometimes an actual parameter is passed to a...Ch. 6 - Prob. 32CRPCh. 6 - What ambiguity exists in the statement X = 3 + 2 ...Ch. 6 - Suppose a small company has five employees and is...Ch. 6 - Prob. 35CRPCh. 6 - Prob. 36CRPCh. 6 - Prob. 37CRPCh. 6 - Prob. 38CRPCh. 6 - Prob. 39CRPCh. 6 - Design a set of syntax diagrams that describes the...Ch. 6 - Prob. 41CRPCh. 6 - Prob. 42CRPCh. 6 - Add syntax diagrams to those in Question 5 of...Ch. 6 - Prob. 44CRPCh. 6 - What code optimization could be performed by a...Ch. 6 - Simplify the following program segment Y = 5 if (Y...Ch. 6 - Simplify the following program segment while (X !=...Ch. 6 - In an object-oriented programming environment, how...Ch. 6 - Describe how inheritance might be used to develop...Ch. 6 - What is the difference between the public and...Ch. 6 - a. Give an example of a situation in which an...Ch. 6 - Describe some objects that might be found in a...Ch. 6 - Prob. 53CRPCh. 6 - Prob. 54CRPCh. 6 - Prob. 55CRPCh. 6 - Prob. 56CRPCh. 6 - Prob. 57CRPCh. 6 - Prob. 58CRPCh. 6 - Prob. 59CRPCh. 6 - In general copyright laws support ownership rights...Ch. 6 - By using a high-level programming language, a...Ch. 6 - Prob. 3SICh. 6 - Prob. 4SICh. 6 - Prob. 5SICh. 6 - Suppose an amateur programmer writes a program for...Ch. 6 - Prob. 7SI
Knowledge Booster
Similar questions
- Explain axiomatic semantics and its advantages & disadvantages.arrow_forwardA database of Prolog facts for a group of people contains the following two types of facts: male([, , ... ] ). female ([, , ... ] ). age( , ) E.g., male([alex, tom, vic, ...]). E.g., female([ann, sara, ella, ..]). E.g. age(ann, 66). For these facts write the following rules (you may use Prolog library functions): person(, ). gender(, gender>). oldest(, , ). meanAgeM(). count(, , ). Find the name and the age of a person Find the name and the gender (male or female) Find the name/age/gender of the oldest person Find the mean age of male people Find the number of male, female, and total peoplearrow_forwardCreate Prolog rules for the following predicates and write them in the space provided: mother, father, daughter, son, brother ,sister, sibling, grandchild, grandparent, aunt, uncle, niece, nephew, ancestor, grandson, granddaughter, grandfather, grandmother, mother-in-law Add the rules and Test each of them in Prologarrow_forward
- Can you perhaps explain what you mean by "static semantics" here? Please provide specific instances of static semantic norms that prove difficult to build using BNF.arrow_forwardDiscuss the validity of the following statements. a. An assignment operator like x += expr for some l-value x and expression expr is merely syntactic sugar for x = x + expr. b. The implicit logical operator between Prolog rules is logical or.arrow_forwardQuestion 3 Full explain this question and text typing work only thanksarrow_forward
- PROLOG! (CAN SOMEONE USE THE POWER OF PROLOG LABGUAGE TO SOLVE THESE 2 HW QUESTIONS)? I need someone to use prolog language to solve these 2 questionsarrow_forwardThere are only three basic constructs in Prolog: facts, rules, and queries. A collection of factsand rules is called a knowledge base (or a database).If we have given multiple facts likemale(harry).female(jess).parent_of(jack,jess). Can you make the rules about? 1. father_of(X,Y):-2. mother_of(X,Y):-3. grandfather_of(X,Y):-4. grandmother_of(X,Y):-arrow_forwardHello, need the answer for them as soon as possible. thank youarrow_forward
- Please explain properly the best answerarrow_forwardWhen you mention "static semantics," do you have any idea what you're talking about? Do static semantic norms exist that defy or cannot be explained by BNF?arrow_forwardWrite a grammar for Boolean expressions , assuming that we already have rules in our grammar for arithmetic expressions . Arithmetic expressions might be simple literals like 3 or 97 or may be more complex syntactic units like (3+x)/4. They evaluate to a number. You needn't concern yourself with their structure; just that they can be used as below. Boolean expressions include the literals TRUE and FALSE; they can be combined with the unary operator ! (meaning NOT) and binary operators && and || (meaning AND and OR). Also, arithmetic expressions can be combined with the following binary operators to form new Boolean expressions: , =, !=. When your grammar is complete, you should be able to derive parse trees for expressions like the following: TRUE || FALSE FALSE && !TRUE 27 = TRUE | FALSEarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education