assignment 1.pdf-SOEN331: Introduction t...
assignment_1.pdf-SOEN331: Introduction to Formal Methods for
Showing 3-5 out of 5
assignment 1.pdf-SOEN331: Introduct...
assignment_1.pdf-SOEN331: Introduction to Formal Methods for
##### Page 3
2.
insertDirectedEdge(v, w, x)
: Create and insert a new directed edge with origin
v
and destination
w
and storing element
x
, and return an updated graph.
3.
incomingEdgesOf(v)
: Return the set of all edges incoming into vertex
v
.
4.
inDegreeOf(v)
: Return the indegree of vertex
v
.
5.
outDegreeOf(v)
: Return the outdegree of vertex
v
.
6.
outgoingEdgesOf(v)
: Return the set of all edges outgoing from the speciﬁed vertex.
Notes
: A directed edge is modeled as a set
{〈
v
1
,v
2
,x
}
of its end vertices
v
1
and
v
2
with a
direction from
v
1
to
v
2
, with an element
x
.
Axioms
: Your axioms should correspond to the following principles:
1. Operation
newdirectedgraph
produces a directed graph with an empty collection of
vertices.
2. Operation
newdirectedgraph
produces a directed graph with an empty collection of
edges.
3. The number of vertices in a newly created directed graph is zero.
4. The number of edges in a newly created directed graph is zero.
3

##### Page 4
For each of the axioms 5-8, you should ﬁrst consider creating the following graph:
v
w
x
y
5. The set of incoming edges to vertex
v
in the graph is
{{〈
w,v
,y
}}
.
6. The indegree of vertex
v
in the graph is 1.
7. The outdegree of vertex
v
in the graph is 1.
8. The set of outgoing edges of vertex
v
in the graph is
{{〈
v,w
,x
}}
.
9. For the graph
(v)--x-->(w)<--y--(u)
, the indegree of vertex
w
is 2.
10. For the graph
(v)--x-->(w)<--y--(u)
, the outdegree of vertex
v
is 1.
2
Graph
and
Directed Graph
and
any
language. For the formal speciﬁcation, there is no
need to reproduce the description of the operations. Each axiom must be demonstrated by
a statement in the main body of your implementation.
You must work strictly between the two of you and you may not seek assistance on this
assignment from anyone, including the instructor or the Teaching Assistants. You will only
3
What to submit
Your should package your implementation in a zip ﬁle that will contain all ﬁles.
For the
formal speciﬁcation, plain text is acceptable. Provide internal documentation in the form of
that is the concatenation of the ﬁrst 4 digits of each partner’s id. You should electronically
submit the zip ﬁle.
4

##### Page 5
4
Due date and late submissions
Your assignment is due by February 13 at 21:00. Any late submission by one day will get a
50% penalty and it will subsequently receive a 10% penalty per day.
5
Disputes
viding all details. I will discuss your dispute with the Teaching Assistants and respond to
your email. My decision in my response will be ﬁnal.
5

Browse thousands of Study Materials & Solutions from your Favorite Schools
Concordia University
Concordia_University
School:
S_Formal_Methods_for_Software_Eng
Course:
Great resource for chem class. Had all the past labs and assignments
Leland P.
Santa Clara University
Introducing Study Plan
Using AI Tools to Help you understand and remember your course concepts better and faster than any other resource.
Find the best videos to learn every concept in that course from Youtube and Tiktok without searching.
Save All Relavent Videos & Materials and access anytime and anywhere
Prepare Smart and Guarantee better grades