Question
I need a correct, different and distinctive solution Task1: Citation Graph Consider the following directed acyclic graph that represents citations between publications. In information science
I need a correct, different and distinctive solution
Task1: Citation Graph
Consider the following directed acyclic graph that represents citations between publications. In information science and bibliometrics, a citation graph is a directed graph that describes the citations within a collection of documents. Each vertex (or node) in the graph represents a document in the collection, and each edge (arc) is directed from one document toward another that it cites. For instance, in the given citation graph below, document b cites documents d and e, and document b is cited by document a.
1)Considering nodes (document names) as constants, represent the facts in the given citation graph in Prolog.
2)Represent the following scenario in your Prolog program:
a.Two documents are connected if there is a directed path from the first document to the second document in the directed acyclic graph. Is there any specific property that you need to use to define this sentence in your program? What is it? Explain it briefly.
b.Query the SWI-Prolog to show whether document a and document g are connected.
c.Query the SWI-Prolog to show whether document b and document h are connected.
d.Receive the first and the second documents to check the existence of a path between them from the user's keyboard. The output is as follows:
e.Using forward chain reasoning, properly explain the answer of (b) or (c).
3)Find a list of documents that are cited by document a (using the findall built-in predicate).
a. If two documents are connected, we need the program to show the path from the first to the last node as a list. For example, the path from document a to document g are [doc_a, doc_b, doc_e, doc_g] and [doc_a, doc_c, doc_f doc_g]. If the two nodes are not connected, we should get false as an answer from SWI- Prolog. One way to represent this is by introducing a new three-arguments predicate where the first will match the initial node, the second will match the final node, and the third will match a list consisting of the nodes in a path. Query to SWI-Prolog to show the path between different pairs of nodes as shown in the figure below. Note: you need to use the connected predicate that you defined in 2.a to define the path rule.
Welcome to SWI-Prolog (threaded, 64 bits, version 9.0.3) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details. For online help and background, visit https://ww. swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos (Word). ?- consult("/Users/Huda/Dropbox/Taif University 2/Second Semester 1444/AI/practical_examples/assignment1.pl'). true. ?- go. Enter the first node: doc_a. Enter the second node: 1: doc_g. true . ?- go. Enter the first node: doc_b. Enter the second node: /: doc_h. false. Welcome to SWI-Prolog (threaded, 64 bits, version 9.0.3) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details. For online help and background, visit https://ww. swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos(Word). ?- consult('TUsers/Huda/Dropbox/Taif University 2/Second Semester 1444/AI/practical_examples/assignment1.pl'). true. ?- path(doc_a,doc_g, X). x= [doc_a, doc_b, doc_e, doc_g] ; x= [doc_a, doc_c, doc_f, doc_g]; false. ?- path(doc_a,doc_b, X). x= [doc_a, doc_b]; false. ?- path(doc_a,doc_h,X). false. ?- path(doc_b, doc_g, X). x= [doc_b, doc_e, doc_g] ; falseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started