?- X is 10.5+4.7*2. Your Answer: ?- X is 6+2. Your answer: ?- X is 6*2. Your answer: ?-R is mod(7,2). Your answer:

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter3: Performing Calculations With Formulas And Functions
Section: Chapter Questions
Problem 4.14CP
icon
Related questions
Question
?- X is 6+2.
Your answer:
?- X is 6*2.
Your answer:
?-R is mod(7,2). Your answer:
?- X is 10.5+4.7*2. Your Answer:
?- Y is 10, Z is Y+1. Your Answer:
?- X is sqrt (36).
Your Answer:
?- X is 10, Y is -X-2. Your Answer:
?- X is 30, Y is 5, Z is X+Y+X*Y+sin(X).
Your Answer:
?- X is 7, X is 6+1.
Your Answer:_
?- 88+15-3=:=110-5*2. Your Answer:
?- 100=l=99.
Your Answer:
?- 6+4=:=6*3-8.
Your Answer:_
?- sqrt (36) +4=:=5*11-45. Your Answer:
?- X is 5/2,Y is 5//2,Z is 5 mod 2,W is mod(10,3).
Your Answer:
?- checkeven(N):-M is N//2, N=:=2*M.
Your Answer: (for this write the above checkeven (N) on prolog editor compile, then ask
the query)
?- checkeven(12).
Your answer_
?- checkeven(11).
Your Answer
?- 10=\=8+3.
Your Answer:
Equality of Prolog expressions
X = Y, X \=Y
Tests whether X and Y can be unified, or cannot, respectively. For example,
X= ,Y= , R= []
?- [X,Y|R] = [a,b,c].
Your answer
?- [X,Y,Z] = [a,b].
Tests whether X and Y are currently co-bound, i.e., have been bound to or share same
value, or not, respectively. For example,
X==Y, X == Y
?- X = 3, Y = 1 * 3, X == Y.
Transcribed Image Text:?- X is 6+2. Your answer: ?- X is 6*2. Your answer: ?-R is mod(7,2). Your answer: ?- X is 10.5+4.7*2. Your Answer: ?- Y is 10, Z is Y+1. Your Answer: ?- X is sqrt (36). Your Answer: ?- X is 10, Y is -X-2. Your Answer: ?- X is 30, Y is 5, Z is X+Y+X*Y+sin(X). Your Answer: ?- X is 7, X is 6+1. Your Answer:_ ?- 88+15-3=:=110-5*2. Your Answer: ?- 100=l=99. Your Answer: ?- 6+4=:=6*3-8. Your Answer:_ ?- sqrt (36) +4=:=5*11-45. Your Answer: ?- X is 5/2,Y is 5//2,Z is 5 mod 2,W is mod(10,3). Your Answer: ?- checkeven(N):-M is N//2, N=:=2*M. Your Answer: (for this write the above checkeven (N) on prolog editor compile, then ask the query) ?- checkeven(12). Your answer_ ?- checkeven(11). Your Answer ?- 10=\=8+3. Your Answer: Equality of Prolog expressions X = Y, X \=Y Tests whether X and Y can be unified, or cannot, respectively. For example, X= ,Y= , R= [] ?- [X,Y|R] = [a,b,c]. Your answer ?- [X,Y,Z] = [a,b]. Tests whether X and Y are currently co-bound, i.e., have been bound to or share same value, or not, respectively. For example, X==Y, X == Y ?- X = 3, Y = 1 * 3, X == Y.
?- increase(4,X). Your answer:_
Relational Operations
max(N1, N2, N2):-
N2 >=N1.
max(N1, N2, N1):-
N2<N1.
Write the query to check maximum of two numbers
Translate the following statements into prolog rules:
(a) Everybody who has a child is happy (introduce a one-argument relation happy).
(b) For all X, if X has a child who has a sister then X has two children (introduce new
relation hastwochildren).
wen
1262
de T
algsa o ga ou
ouley
Transcribed Image Text:?- increase(4,X). Your answer:_ Relational Operations max(N1, N2, N2):- N2 >=N1. max(N1, N2, N1):- N2<N1. Write the query to check maximum of two numbers Translate the following statements into prolog rules: (a) Everybody who has a child is happy (introduce a one-argument relation happy). (b) For all X, if X has a child who has a sister then X has two children (introduce new relation hastwochildren). wen 1262 de T algsa o ga ou ouley
Expert Solution
steps

Step by step

Solved in 2 steps with 8 images

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage