


assignment 1.pdf
assignment_1.pdf
Showing 35 out of 5
assignment 1.pdfSOEN331: Introduction to Formal M...
assignment_1.pdfSOEN331: Introduction to Formal Methods for
assignment 1.pdfSOEN331: Introduct...
assignment_1.pdfSOEN331: 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 58, 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
Your assignment
Your task is to a) deploy an Algebraic Speciﬁcation to deﬁne
Graph
and
Directed Graph
and
b) implement your speciﬁcation in
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
receive feedback upon submission.
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
comments to clearly indicate your names and id’s. Your zip ﬁle should have an 8digit name
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
If you wish to dispute the grade that you receive on your assignment, please email me, pro
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
Ace your assessments! Get Better Grades
Browse thousands of Study Materials & Solutions from your Favorite Schools
Concordia University
Concordia_University
School:
S_Formal_Methods_for_Software_Eng
Course:
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
Students also viewed documents
lab 18.docx
lab_18.docx
Course
Course
3
Module5QuizSTA2023.d...
Module5QuizSTA2023.docx.docx
Course
Course
10
Week 7 Test Math302....
Week_7_Test_Math302.docx.docx
Course
Course
30
Chapter 1 Assigment ...
Chapter_1_Assigment_Questions.docx.docx
Course
Course
5
Week 4 tests.docx.do...
Week_4_tests.docx.docx
Course
Course
23
Week 6 tests.docx.do...
Week_6_tests.docx.docx
Course
Course
106