commit 2e8a1dec2f6bcdaa2e4b645598410d94100d8c2e Author: Spencer Killen Date: Sun Mar 26 20:58:27 2023 +0000 init diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..6ce6d84 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,15 @@ +{ + "name": "CMPUT 325 W2023 ASP/CLPFD lab", + "build": { + "context": "..", + "dockerfile": "../Dockerfile" + }, + "customizations": { + "vscode": { + "extensions": [ + "rebornix.prolog", + "abelcour.asp-syntax-highlight", + ] + } + } +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f93a00b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "*.pl": "prolog" + } +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8cdc6b3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:jammy +# rlwrap segfaulted on :kinetic, so using jammy instead +LABEL maintainer="sjkillen@ualberta.ca" + +RUN apt-get -qq update +RUN apt-get -qq install sudo gringo clasp time swi-prolog git +RUN apt-get -qq install rlfe +RUN echo "alias sbcl='rlfe sbcl'" >> /home/$USERNAME/.bashrc + +ARG USERNAME=user +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +# Copied from https://code.visualstudio.com/docs/remote/containers-advanced#_adding-a-nonroot-user-to-your-dev-container +# Create the user +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME --shell /bin/bash \ + # [Optional] Add sudo support. Omit if you don't need to install software after connecting. + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME + +USER $USERNAME diff --git a/asp/1.lp b/asp/1.lp new file mode 100644 index 0000000..0611108 --- /dev/null +++ b/asp/1.lp @@ -0,0 +1,6 @@ +% Graph colouring + +%#show color/2. + +%{ color(X,1..n) } = 1 :- vertex(X). +%:- arc(X,Y), color(X,C), color(Y,C). \ No newline at end of file