Answer to Question #203508 in Prolog for Taj Aldin almosely

Question #203508

Write a list of facts that are points on a graph (ex: point(1,3).)

  • Sample fact: point(1,3).
  • Add at least 6 more.

Write a rule that determines whether a line going through 2 points is horizontal. A Horizontal line requires that the Y value be the same. The X value must be different.

Write another rule that determines whether a line going through 2 points is vertical.

Save the file with a .pl extension.

Open a prolog session on panther (swipl)

consult your knowledgebase by typing [your filename without the .pl].

list the knowledgebase using : listing.

  • see all the lines in your .pl file

Run a query to see all the points in your knowledgebase that start with X=1.

Run a query to test two points in your knowledgebase

Run these queries that show all the possible horizontal lines made with the points in the database: horizontal (X1,Y1,X2,Y2). . Repeat for vertical (X1,Y1,X2,Y2).

  • A will bind to a point(? , ?) and B will bind to another point(? ?).
  • type ; to keep getting all the answer
1
Expert's answer
2021-06-07T04:39:42-0400
Dear Taj Aldin almosely, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS