updated
authorChristian Urban <christian.urban@kcl.ac.uk>
Thu, 04 Aug 2022 16:53:38 +0200
changeset 426 b51467741af2
parent 425 957808dcb367
child 427 6e93040e3378
updated
README
cws/core_cw01.pdf
cws/core_cw01.tex
cws/core_cw02.pdf
cws/core_cw02.tex
cws/core_cw03.pdf
cws/core_cw03.tex
cws/disclaimer.sty
cws/main_cw01.pdf
cws/main_cw01.tex
cws/main_cw02.pdf
cws/main_cw02.tex
cws/main_cw03.pdf
cws/main_cw03.tex
cws/main_cw04.pdf
cws/main_cw04.tex
cws/main_cw05.pdf
cws/main_cw05.tex
handouts/pep-ho.pdf
handouts/pep-ho.tex
main_marking3/re_test.sh
main_marking3/re_test0.scala
main_testing3/re_test.sh
main_testing3/re_test0.scala
main_testing5/bf_test.sh
main_testing5/bfc_test.sh
--- a/README	Sun May 01 12:41:56 2022 +0100
+++ b/README	Thu Aug 04 16:53:38 2022 +0200
@@ -7,13 +7,6 @@
 =============
 
 
-TA meeting
-
-https://web.microsoftstream.com/video/cec0d34d-77f5-4940-9bad-628416d4c521
-
-=============
-
-
 Wartremover
 
 ./wartremover -traverser org.wartremover.warts.Return -traverser org.wartremover.warts.Var -traverser org.wartremover.warts.MutableDataStructures $i
@@ -66,19 +59,6 @@
 
 --------------------------
 
-chowchingjimkcl
-
-Assignment 6     3 (basic) 7 (main)
-Assignment 7     4 (basic) 6 (main)
-Assignment 8     4 (basic) 6 (main)
-Assignment 9     4 (basic) 6 (main)
-Assignment 10    10 (main)
-
-48
-
-
-
-
 -----------------------------
 node
 Welcome to Node.js v12.11.1.
Binary file cws/core_cw01.pdf has changed
--- a/cws/core_cw01.tex	Sun May 01 12:41:56 2022 +0100
+++ b/cws/core_cw01.tex	Thu Aug 04 16:53:38 2022 +0200
@@ -1,8 +1,8 @@
 % !TEX program = xelatex
 \documentclass{article}
-\usepackage{../style}
+\usepackage{../styles/style}
 \usepackage{disclaimer}
-\usepackage{../langs}
+\usepackage{../styles/langs}
 
 
 
Binary file cws/core_cw02.pdf has changed
--- a/cws/core_cw02.tex	Sun May 01 12:41:56 2022 +0100
+++ b/cws/core_cw02.tex	Thu Aug 04 16:53:38 2022 +0200
@@ -1,8 +1,8 @@
 % !TEX program = xelatex
 \documentclass{article}
-\usepackage{../style}
+\usepackage{../styles/style}
 \usepackage{disclaimer}
-\usepackage{../langs}
+\usepackage{../styles/langs}
 
 \begin{document}
 
Binary file cws/core_cw03.pdf has changed
--- a/cws/core_cw03.tex	Sun May 01 12:41:56 2022 +0100
+++ b/cws/core_cw03.tex	Thu Aug 04 16:53:38 2022 +0200
@@ -1,7 +1,7 @@
 % !TEX program = xelatex
 \documentclass{article}
-\usepackage{../style}
-\usepackage{../langs}
+\usepackage{../styles/style}
+\usepackage{../styles/langs}
 \usepackage{disclaimer}
 \usepackage{tikz}
 \usepackage{pgf}
--- a/cws/disclaimer.sty	Sun May 01 12:41:56 2022 +0100
+++ b/cws/disclaimer.sty	Thu Aug 04 16:53:38 2022 +0200
@@ -95,7 +95,8 @@
 \subsubsection*{Disclaimer\alert}
 
 It should be understood that the work you submit represents
-your \textbf{own} effort! You have not copied from anyone else. An
+your \textbf{own} effort! You have implemented the code entirely
+on your own. You have not copied from anyone else. An
 exception is the Scala code I showed during the lectures or
 uploaded to KEATS, which you can freely use.\bigskip
 }
@@ -104,7 +105,9 @@
 \subsubsection*{Disclaimer}
 
 It should be understood that the work you submit represents
-your \textbf{own} effort! You have not copied from anyone else. An
+your \textbf{own} effort! You have implemented the code entirely
+on your own. You have not copied from anyone else or any other
+source. An
 exception is the Scala code I showed during the lectures or
 uploaded to KEATS, which you can freely use.\medskip
 
Binary file cws/main_cw01.pdf has changed
--- a/cws/main_cw01.tex	Sun May 01 12:41:56 2022 +0100
+++ b/cws/main_cw01.tex	Thu Aug 04 16:53:38 2022 +0200
@@ -1,8 +1,8 @@
 % !TEX program = xelatex
 \documentclass{article}
-\usepackage{../style}
+\usepackage{../styles/style}
 \usepackage{disclaimer}
-\usepackage{../langs}
+\usepackage{../styles/langs}
 
 
 
Binary file cws/main_cw02.pdf has changed
--- a/cws/main_cw02.tex	Sun May 01 12:41:56 2022 +0100
+++ b/cws/main_cw02.tex	Thu Aug 04 16:53:38 2022 +0200
@@ -1,9 +1,9 @@
 
 % !TEX program = xelatex
 \documentclass{article}
-\usepackage{../style}
+\usepackage{../styles/style}
 \usepackage{disclaimer}
-\usepackage{../langs}
+\usepackage{../styles/langs}
 
 \begin{document}
 
Binary file cws/main_cw03.pdf has changed
--- a/cws/main_cw03.tex	Sun May 01 12:41:56 2022 +0100
+++ b/cws/main_cw03.tex	Thu Aug 04 16:53:38 2022 +0200
@@ -1,7 +1,7 @@
 % !TEX program = xelatex
 \documentclass{article}
-\usepackage{../style}
-\usepackage{../langs}
+\usepackage{../styles/style}
+\usepackage{../styles/langs}
 \usepackage{disclaimer}
 \usepackage{tikz}
 \usepackage{pgf}
Binary file cws/main_cw04.pdf has changed
--- a/cws/main_cw04.tex	Sun May 01 12:41:56 2022 +0100
+++ b/cws/main_cw04.tex	Thu Aug 04 16:53:38 2022 +0200
@@ -3,8 +3,8 @@
 \usepackage{chessboard}
 \usepackage[LSBC4,T1]{fontenc}
 \let\clipbox\relax
-\usepackage{../style}
-\usepackage{../langs}
+\usepackage{../styles/style}
+\usepackage{../styles/langs}
 \usepackage{disclaimer}
 \usepackage{ulem}
 
Binary file cws/main_cw05.pdf has changed
--- a/cws/main_cw05.tex	Sun May 01 12:41:56 2022 +0100
+++ b/cws/main_cw05.tex	Thu Aug 04 16:53:38 2022 +0200
@@ -1,7 +1,7 @@
 % !TEX program = xelatex
 \documentclass{article}
-\usepackage{../style}
-\usepackage{../langs}
+\usepackage{../styles/style}
+\usepackage{../styles/langs}
 \usepackage{disclaimer}
 \usepackage{tikz}
 \usepackage{pgf}
Binary file handouts/pep-ho.pdf has changed
--- a/handouts/pep-ho.tex	Sun May 01 12:41:56 2022 +0100
+++ b/handouts/pep-ho.tex	Thu Aug 04 16:53:38 2022 +0200
@@ -1,7 +1,7 @@
 % !TEX program = xelatex
 \documentclass{article}
-\usepackage{../style}
-\usepackage{../langs}
+\usepackage{../styles/style}
+\usepackage{../styles/langs}
 \usepackage{tikz}
 \usepackage{pgf}
 \usepackage{marvosym}
@@ -96,6 +96,23 @@
 % Easy installation
 %https://alexarchambault.github.io/posts/2020-09-21-cs-setup.html
 
+% scala libraries
+%https://index.scala-lang.org
+
+
+% Learning functional programming is an opportunity to discover a new
+% way to represent programs, to approach problems, and to think about
+% languages. While programming with a functional language is still
+% fundamentally similar to programming with any other type of language
+% (examples of others being imperative or logic), it represents
+% programs and algorithms through distinct forms of abstraction and
+% gives you a new toolset with which to solve programming
+% problems. Additionally, many of the techniques of functional
+% programming are beginning to permeate new mainstream languages, so
+% taking the time now to develop a thorough understanding of them is
+% an investment which will pay great dividends.
+
+
 
 % Exact colors from NB
 \usepackage[breakable]{tcolorbox}
--- a/main_marking3/re_test.sh	Sun May 01 12:41:56 2022 +0100
+++ b/main_marking3/re_test.sh	Thu Aug 04 16:53:38 2022 +0200
@@ -80,6 +80,23 @@
     tsts=$(( 1 ))  
 fi
 
+### make sure datatypes are not tampered with
+
+if [ $tsts -eq 0 ]
+then
+    echo -e "re.scala has case classes for ALTs and SEQs?" >> $out
+
+    if (scala_assert "re.scala" "re_test0.scala")
+    then
+	echo -e "  --> passed" >> $out
+	tsts=$(( 0 ))
+    else	
+	echo -e "  --> FAIL (make sure the case clases are as given in the template)" >> $out 
+	tsts=$(( 1 ))
+    fi
+else
+    tsts=$(( 1 ))   
+fi
 
 
 ### re1 test
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main_marking3/re_test0.scala	Thu Aug 04 16:53:38 2022 +0200
@@ -0,0 +1,6 @@
+import M3._
+
+assert(ALTs.getClass == ALTs.getClass)
+assert(SEQs.getClass == SEQs.getClass)
+
+
--- a/main_testing3/re_test.sh	Sun May 01 12:41:56 2022 +0100
+++ b/main_testing3/re_test.sh	Thu Aug 04 16:53:38 2022 +0200
@@ -25,7 +25,8 @@
 # purity test
 
 function scala_vars {
-   (egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' c$out 2> /dev/null 1> /dev/null)
+    (sed 's/immutable/ok/g' c$out > cb$out;
+     egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' cb$out 2> /dev/null 1> /dev/null)
 }
 
 
@@ -60,7 +61,21 @@
     fi
 fi
 
+### make sure datatypes are not tampered with
 
+if [ $tsts -eq 0 ]
+then
+    echo -e "re.scala has case classes for ALTs and SEQs?" >> $out
+
+    if (scala_assert "re.scala" "re_test0.scala")
+    then
+	echo -e "  --> passed" >> $out
+	tsts=$(( 0 ))
+    else	
+	echo -e "  --> FAIL (make sure the case clases are as given in the template)" >> $out 
+	tsts=$(( 1 ))
+    fi
+fi
 
 ### re tests
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main_testing3/re_test0.scala	Thu Aug 04 16:53:38 2022 +0200
@@ -0,0 +1,6 @@
+import M3._
+
+assert(ALTs.getClass == ALTs.getClass)
+assert(SEQs.getClass == SEQs.getClass)
+
+
--- a/main_testing5/bf_test.sh	Sun May 01 12:41:56 2022 +0100
+++ b/main_testing5/bf_test.sh	Thu Aug 04 16:53:38 2022 +0200
@@ -26,7 +26,8 @@
 # purity test
 
 function scala_vars {
-   (egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' c$out 2> /dev/null 1> /dev/null)
+    (sed 's/immutable/ok/g' c$out > cb$out;
+     egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' cb$out 2> /dev/null 1> /dev/null)
 }
 
 
--- a/main_testing5/bfc_test.sh	Sun May 01 12:41:56 2022 +0100
+++ b/main_testing5/bfc_test.sh	Thu Aug 04 16:53:38 2022 +0200
@@ -25,7 +25,8 @@
 # purity test
 
 function scala_vars {
-   (egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' c$out 2> /dev/null 1> /dev/null)
+    (sed 's/immutable/ok/g' c$out > cb$out;
+     egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' cb$out 2> /dev/null 1> /dev/null)
 }