Skip to content

Commit

Permalink
Final touches for artifact submission
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzleutgeb committed Apr 27, 2021
1 parent 6f29fdd commit f509bcd
Show file tree
Hide file tree
Showing 17 changed files with 212 additions and 543 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ gradle.properties
*.jar
*.so
*.dll
atlas

# Nix
result
Expand Down
494 changes: 117 additions & 377 deletions ARTIFACT.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion atlas.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ org.slf4j.simpleLogger.showThreadName=true
# Timeout 15M
#com.microsoft.z3.timeout=900000
# Timeout 2H
#com.microsoft.z3.timeout=7200000
com.microsoft.z3.timeout=7200000
com.microsoft.z3.memory_max_size=25769803776
com.microsoft.z3.unsat_core=true
com.microsoft.z3.trace=false
Expand Down
41 changes: 0 additions & 41 deletions bench-day.sh

This file was deleted.

20 changes: 0 additions & 20 deletions bench-missing.sh

This file was deleted.

33 changes: 0 additions & 33 deletions bench-single.sh

This file was deleted.

41 changes: 0 additions & 41 deletions bench.sh

This file was deleted.

6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 30 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,17 @@
virtualbox = {
vmName = "atlas";
vmFileName = "atlas.ova";
#params = { usb = "off"; };
params = {
usb = "on";
usbehci = "off";
vram = 48;
};
};
environment.systemPackages = utils
++ [ self.packages.${system}.atlas pkgs.evince ];
++ [ self.packages.${system}.atlas pkgs.evince pkgs.vim ];
networking.hostName = "atlas";
users.users = {
atlas = {
evaluator = {
isNormalUser = true;
extraGroups = [ "wheel" ];
uid = 1000;
Expand All @@ -259,31 +263,44 @@
};
root.initialHashedPassword = "";
};
home-manager.users.atlas.home = {
home-manager.users.evaluator.home = {
file = let
referText = ''
Please refer to
To prepare evaluation, please open a terminal and execute
/home/evaluator/prepare-evaluation.sh
This will mount an overlay filesystem at
/home/atlas/atlas/ARTIFACT.md
(artifact information)
/home/evaluator/atlas
/home/atlas/${submission}
(associated paper)
Then, please refer to
/home/evaluator/atlas/ARTIFACT.md
Note that `atlas` (command) is in `$PATH`, it can be executed in a terminal.
Note that the associated paper is available at
/home/evaluator/${submission}
'';
pdf = (self.packages.${system}.atlas-cav + "/" + submission);
in {
"atlas".source = self.packages.${system}.atlas-src;

${submission}.source = pdf;
"README.md".text = referText;

"Desktop/README.md".text = referText;
"Desktop/${submission}".source = pdf;

"prepare-evaluation.sh".source = pkgs.writeScript "prepare-evaluation" ''
#! ${pkgs.bash}/bin/bash
set -xeuo pipefail
mkdir --verbose --parents $HOME/.overlay/{upper,work} $HOME/atlas
sudo mount --verbose --types overlay overlay --options upperdir=$HOME/.overlay/upper,workdir=$HOME/.overlay/work,lowerdir=${self.packages.${system}.atlas-src} $HOME/atlas
'';
};
stateVersion = "20.09";
sessionVariables.LAC_HOME = "${examples}";
sessionVariables.ATLAS_HOME = "${examples}";
};
security.sudo.wheelNeedsPassword = false;
services = {
Expand All @@ -298,7 +315,7 @@
displayManager = {
autoLogin = {
enable = true;
user = "atlas";
user = "evaluator";
};
defaultSession = "xfce";
};
Expand Down
25 changes: 25 additions & 0 deletions reproduce.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#! /usr/bin/env bash

set -euo pipefail

function atlas_run () {
(set -x ;atlas --home src/test/resources/examples \
run --tactics src/test/resources/tactics \
$@ )
}


echo -e '\nSplayTree (inference)\n'
atlas_run --infer "SplayTree\\.(splay(_max)?|insert|delete)"

echo -e '\nSplayHeap (inference)\n'
atlas_run --infer "SplayHeap\\.(insert|del_min)"

echo -e '\nPairingHeap EXCEPT merge (inference)\n'
atlas_run --infer "PairingHeap\\.(insert|merge_pairs|del_min_via_merge_pairs)_isolated"

echo -e '\nPairingHeap.merge (checking)\n'
atlas_run "PairingHeap\\.merge_isolated"

echo -e '\nPairingHeap WITH merge (inference)\n'
atlas_run --infer "PairingHeap\\.(insert|merge_pairs|del_min_via_merge_pairs|merge)_isolated"
3 changes: 3 additions & 0 deletions src/main/java/xyz/leutgeb/lorenz/atlas/commands/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ public void run() {

final var result = program.solve(new HashMap<>(), tacticsMap, infer, Collections.emptySet());
if (!result.isSatisfiable()) {
System.out.println("UNSAT");
System.exit(1);
} else {
System.out.println("SAT");
}

System.out.println("Signatures:");
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/xyz/leutgeb/lorenz/atlas/module/Loader.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package xyz.leutgeb.lorenz.atlas.module;

import static java.nio.file.FileVisitOption.FOLLOW_LINKS;
import static java.util.Collections.synchronizedMap;
import static java.util.Optional.ofNullable;
import static java.util.function.Predicate.not;
Expand Down Expand Up @@ -145,7 +146,8 @@ public void autoload() throws IOException {
home,
8,
((path, basicFileAttributes) ->
path.getFileName().toString().endsWith(DOT_EXTENSION) && Util.goodForReading(path)))
path.getFileName().toString().endsWith(DOT_EXTENSION) && Util.goodForReading(path)),
FOLLOW_LINKS)
.flatMap(
path -> {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,14 +484,21 @@ public String toLongString(List<String> parameters) {
e -> {
final var index = e.getKey();
final var coefficient = e.getValue();
var result = "";
if (!coefficient.equals(new KnownCoefficient(Fraction.ONE))) {
result = coefficient.toString();

final boolean cancelIndex = isUnitIndex(index);
final boolean cancelCoefficient =
coefficient.equals(new KnownCoefficient(Fraction.ONE));

if (cancelCoefficient && cancelIndex) {
return "1";
}
if (isUnitIndex(index)) {
return result;
if (cancelIndex) {
return coefficient.toString();
}
if (cancelCoefficient) {
return toPotential(parameters, index);
}
return result + " · " + toPotential(parameters, index);
return coefficient + " · " + toPotential(parameters, index);
})
.collect(Collectors.joining(" + "));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ public String getBounds(List<String> arguments) {
return "?";
}

if (withCost.from.size() != withCost.to.size()) {
return toString();
}

final var withCost = this.withCost.getBound(arguments);
final var withoutCost =
this.withoutCost.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ public boolean isZero() {
}

public String getBound(List<String> arguments) {
return Annotation.subtract(from, to).toLongString(arguments);
if (from.size() == to.size()) {
return Annotation.subtract(from, to).toLongString(arguments);
}

final var right = to.toLongString();
if ("0".equals(right)) {
return from.toLongString(arguments);
}
return from.toLongString(arguments) + " - [" + to.toLongString() + "]";
}
}
2 changes: 1 addition & 1 deletion src/test/resources/examples
Submodule examples updated 2 files
+2 −2 PairingHeap.ml
+3 −3 SplayHeap.ml
7 changes: 6 additions & 1 deletion version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@
# This script is called whenever we need to know
# the current version of the project.

git describe --tags --always --dirty=-dirty
if [ -x "$(command -v git)" ]
then
git describe --tags --always --dirty=-dirty
else
echo "v0"
fi

0 comments on commit f509bcd

Please sign in to comment.