DML docker image. DML is built by Seclab, Stony Brook.
862
DML is a programming language that has been custom designed for teaching discrete math. It offers several operators and constructs unavailable in typical languages, such as quantification and boolean formula satisfaction checking. While DML's syntax for these new constructs closely matches the notation used in discrete math texts, it aims for syntactic consistency with existing languages (specifically, Python) for the concepts that are already included in these languages. Here are some examples of DML formulas:
{x for x in 0..100 if x % 2 = 0}
valid (x->y) || (y->z) || (z->x)
{ x for x in 2..1000 if forall (y in 2..(x-1)) x % y != 0 }
The DML language is described in a separate document. This document is only about its installation and use.
Although students tend to work on several platforms, including MacOS, Windows and Linux, DML runs only on Ubuntu Linux. In order to allow it to be run across all these platforms, DML has been packaged into a Docker container. Docker packages the DML system together with the underlying Linux environment into a self-contained application that you can download and run.
Create a folder for DML code
Create a folder named dmlhome in your home directory. This is the only folder on your computer that will be shared with the DML container. It provides the sole means for moving files between your laptop and the DML container. Some of the features of DML will not work without this shared folder, so don't skip this step.
Install Docker Check if docker is installed:
docker --version
If not found:
sudo snap install docker
# or
sudo apt install docker.io
docker stats
Download DML image:
docker pull dorbmon2112/dml:latest
Create the container:
docker create -it -v ~/dmlhome:/home/ubuntu --ulimit stack=1610612736:1610612736 --name dml -- dorbmon2112/dml:latest
docker create -it -v %userprofile%/dmlhome:/home/ubuntu --ulimit stack=1610612736:1610612736 --name dml -- dorbmon2112/dml:latest
⚠️ Pay attention to spaces after -- in the command.
docker stop dml; docker rm dml; docker pull dorbmon2112/dml:latest
Then recreate with the same docker create command as above.
Start the container:
docker start -i dml
You will get a prompt like ubuntu@container:~$.
dmldmlsh (recommended, supports history, editing, completion).To exit:
quit or Ctrl+D exits DMLPress Tab for available commands. For full docs, see lang.pdf.
Example session:
dml> {x for x in 0..100 if x % 2 = 0}
{0, 2, 4, ..., 100}
dml> valid (x->y) || (y->z) || (z->x)
true
dml> { x for x in 2..1000 if forall (y in 2..(x-1)) x % y != 0 }
{2, 3, 5, 7, 11, ... 997}
DML uses ~/dmlhome on your system.
C:\Users\your-username-here\dmlhomedmlhomecp file ~/dmlhome/Inside container it appears as /home/ubuntu.
Syncing is two-way.
List files inside container:
ls
docker rm dml
start "C:\Program Files\Docker\Docker\Docker Desktop.exe"
open -a Docker
dockerd
(May require sudo.)
Content type
Image
Digest
sha256:46ac5069b…
Size
151.7 MB
Last updated
about 1 year ago
docker pull dorbmon2112/dml