Lecturer: OGATA, Kazuhiro (email: ogata at jaist dot ac dot
jp)
Room: i1&2
Term: 2-2 (Dec 8, 2020 - Feb 3, 2021)
TAs: Canh
Minh Do (canhdominh), Yato Phyo (yatiphyo) & Win Sin Khine Shwe
(winshwesinkhine)
Contents:
News
Software tools used in the course
Lecture
schedule (Lecture
materials can be downloaded there.)
Assignments
Useful links
Software tools used in the course
- Java: Version 1.8.0_111 is used in the course.
For
Windows 64x, you can downlod jdk-8u111-windows-x64.exe and double click it to
install the version of Java.
For other operating systems, please visit
the webpage.
- Text editor: You can use
any text editor of your preference, but I recoomed you to use Emacs.
-
UMLet: Version 14.1.1 is used. You can downlod umlet-standalone-14.1.1.zip and unzip it to
install the version of UMLet.
For more info, please visit the website.
- Java Path Finder (JPF): v8.0 (rev 31) is used in the
course.
Please go to A
way to install JPF on this page to install the
version of JPF.
For more info, please visit the
website.
- Shell (or command prompt): I recommend
you to use commands, such as javac and java, on a shell.
You can use any
shell (or command prompt) of your preference.
If you use Emacs, you can
launch and use a shell on Emacs.
Note: Please do not use any
sophisticated software development platforms, such as Eclipse and
NetBeans.
Let us just suppose that JPFDIR is C:. You may use another directory such as your home directory. PrintUserHome.java lets you know your home directory.
ii. Download .jpf.zip and unzip it to make the directory
(folder) .jpf in which you can find the following
file:
site.properties
Edit the file such that C:/Users/ogata/projects in
the file is changed to C:/projects (namely, JPFDIR followed by /projects), and
save the file. Note that you should use "/" instead of "\" in the file. Move the
directory .jpf to C: (namely, JPFDIR). Now, there exists the directory .jpf on
C: (namely, JPFDIR).
iii. Download projects.zip and unzip it to make the directory projects. Move the directory projects to C: (namely, JPFDIR). Now, there exist the directories .jpf & projects on C: (namely, JPFDIR).
iv. Add C:\projects\jpf-core\bin (namely, JPFDIR followed by \projects\jpf-core\bin) to Path (environment variable).
v. Add a new environment variable JAVA_HOME with C:\Program
Files\Java\jdk1.8.0_111 as its value.
Note that C:\Program
Files\Java\jdk1.8.0_111 is the directory in which jdk has been installed on your
computer.
vii. Download UnsafeInc.java and UnsafeInc.jpf, and do
the following to check if JPF has been successfully installed:
% javac
UnsafeInc.java
% jpf UnsafeInc.jpf
- Other OSs, such as Mac and Linux
.jpf.zip and projects.zip are
independent from any specific machines, and then JPF may be installed
likewise.
2. Write your explanation on those diagrams. You can consult
lecture note 3.
The report will be used to judge how well you understand the
programs. So, if no explanation is given, your score for this assignment will be
zero. The report should be made as one .pdf file.
3. Make one zip file containing four .uxf files and one .pdf file, and then send it to the lecturer as an email attachment by the deadline.
2. Draw with UMLet four class diagrams used in lecture note
2
such that the first one consists of class BlueClass and class
BlueClassUndo, the second one consists of class ArrayList<KeyValPair> and
class BlueClass2, the third one consists of interface ExpParseTree, class
NumParseTree and class AddParseTree, and the fourth one consists of interface
ParseTree, abstract class StmParseTree and interface ExpParseTree. Four .uxf
files are made.
3. Write your explanation on those diagrams. You can consult
lecture notes 3, 4, 5 & 6.
The report will be used to judge how well you
understand the programs. So, if no explanation is given, your score for this
assignment will be zero. The report should be made as one .pdf file.
4. Make one zip file containing two .java files, four .uxf files and one .pdf file, and then send it to the lecturer as an email attachment by the deadline.
2. Write your explanation on those diagrams.
The report will
be used to judge how well you understand the programs. So, if no explanation is
given, your score for this assignment will be zero. The report should be made as
one .pdf file.
3. Make one zip file containing those .uxf files and one .pdf file, and then send it to the lecturer as an email attachment by the deadline.
Interfaces:
PointInterface
Abstract classes:
AbstractPoint
AbstractPointPolarCoordinates
Classes:
Point
RandomWalking
PointIn3D
PointPolarCoordinatesRadian
PointException
DistanceBetweenTwoPoints
Each of them is supposed to be written in one file whose name should obey the name convention. There are some occurrences of ... that are not explicitly explained, but since all class files are given and you can launch with java the class files whose names start with Test and whose name is DistanceBetweenTwoPoints, you can know what you should replace those occurrences of ... with. Nine .java files are made. You are supposed to compile with javac your programs together with the given programs and conduct testing the programs by launching with java the generated class files whose names start with Test and whose name is DistanceBetweenTwoPoints.
2. Write your explanation on those programs as a report.
The
report will be used to judge how well you understand the programs. So, if no
explanation is given, your score for this assignment will be zero. The report
should be made as one .pdf file.
3. Make one zip file containing the nine .java files and one .pdf file, and then send it to the lecturer as an email attachment by the deadline.
2. Send the .pdf file to the lecturer as an email attachment by the deadline.
BSLeaf.java
BSNlTree.java
BSTree.java
BinarySearchTree.java
GList.java
GNil.java
GNnList.java
Nat.java
NzNat.java
TBSLeaf.java
TBSNlTree.java
TBSTree.java
TentativeBinarySearchTree.java
Zero.java
You are supposed to compile with javac your programs together with the given programs and conduct testing the programs by launching with java the generated class files whose names start with Test.
2. Write your explanation on those programs as a report.
The
report will be used to judge how well you understand the programs. So, if no
explanation is given, your score for this assignment will be zero. The report
should be made as one .pdf file.
3. Make one zip file containing those .java files and one .pdf file, and then send it to the lecturer as an email attachment by the deadline.
2. Write in Java the interfaces and classes appearing on the class diagram. You are supposed to compile with javac the those .java files together with the other given programs and conduct testing your programs by launching with java the two files TestMap1(.class) and TestMap2(.class).
3. Let us consider the two objects. One is referred by the variable map just after executing map.put("x",6); on the page (whose title is Reuse) of lecture note 7, and the other is (by replacing BSTMap with ListMap) referred by the same variable at the same position. Draw the two object diagrams corresponding to the two objects. Two .uxf files are made.
4. Write your explanation on those diagrams and programs as a report. The report should be made as one .pdf file.
5. Make one zip file containing those .java files, those .uxf files and one .pdf file, and then send it to the lecturer as an email attachment by the deadline.
2. Write in Java all classes appearing in the class diagram except for those provided by Java libraries. You are supposed to compile with javac the those .java files (together with the other given programs if necessary) and conduct testing your programs by launching the application with Java.
3. Write your explanation on those diagrams and programs as a report. The report should be made as one .pdf file.
4. Make one zip file containing those .java files, those .uxf files and one .pdf file, and then send it to the lecturer as an email attachment by the deadline.
2. Write in Java the following classes:
SimpleCalculator
VirtualMachine
ExpParseTree
NumParseTree
AddParseTree
MulParseTree
QuoParseTree
SubParseTree
You are supposed to compile with javac the those .java files (together with the other given programs if necessary) and conduct testing your programs by launching the application with Java.
3. Write your explanation on those diagrams and programs as a report. The report should be made as one .pdf file.
4. Make one zip file containing those .java files, those .uxf
files and one .pdf file, and then send it to the lecturer as an email attachment
by the deadline.
2. Write your explanation on each program. You are especially supposed to explain each flaws of a program if the program has any flaws and include in your report some evidence, such as (part of) the result produced by each application, showing that you have conducted testing each application.
3. Make one zip file containing those .java files and one .pdf file, and then send it to the lecturer as an email attachment by the deadline.
2. Model check with JPF each application, which requires you to prepare a .jpf file for each application.
3. Write your explanation on each program. You are supposed to include in your report the result produced by JPF for each application and to explain the result if JPF detects any flaws.
4. Make one zip file containing those .java files, those .jpf files and one .pdf file, and then send it to the lecturer as an email attachment by the deadline.
2. Confirm that the dining philosopher problem causes deadlock if all philosophers are allowed to enter the dining room at the same time (namely that DiningRoom(n-1) is changed to DiningRoom(n) in class DiningPhilosopherProblem) with JPF, where the number of philosophers is 3 and the number of dinners each philosopher has is 1, and explains the execution path (trace) that is produced by JPF and leads to deadlock.
3. Come up with a different solution to the dining philosopher problem than what is described in the course, and explains your solution. You do not need to come up with a really new solution but can consult books, papers, etc. If you have consulted books, websites, papers, etc., however, you need to enumerate all such books, websites, papers, etc.
4. Implement your solution in Java, and explain your programs.
5. Model check that your solution does not lead to deadlock with JPF. You are supposed to check two cases: (1) the number of philosophers is 3 and the number of dinners each philosopher has is 1, and (2) the number of philosophers is 5 and the number of dinners each philosopher has is 1. You are also supposed to include the two results produced by JPF in your report.
6. Write all explanations (descriptions) in one file named report3.pdf (in pdf), put all .java & .jpf files related to 1. into a directory (folder) named Deadlock, put all .java & .jpf files related to 2. into a directory named DPPDeadlock, and put all .java & .jpf files related to 4. & 5. into a directory named NewSolutionToDPP; put report3.pdf, Deadlock, DPPDeadlock and NewSolutionToDPP into a directory whose name is your name followed by your student identification number (for example, if your name is Sentan & your student identification number is 123450, then the directory name is Sentan123450); zip the directory to make one zip file (for example, Sentan123450.zip) and send it to the lecturer by the deadline.
1. There are five missing classes. One missing class is VirtualMachine. Write the five missing classes in Java. Five .java files are made.
2. Complete the class IfParseTree. One .java file is made.
3. Complete the class WhileParseTree. One .java file is made.
4. Write your explanation on the programs you have written as a report. One .pdf file is made.
5. Make one zip file containing seven .java files and one .pdf file, and then send it to the lecturer as an email attachment by the deadline..