Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions fumola/examples/delayedPut.fumola
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// test code for delayed puts.
//
// The assert statements ensure the expected behavior:
// The while loop runs exactly one iteration,
// then it exits the loop, as the delayed
// put takes effect when the block for time `t ends.
//
module {
public func go() {
let start = (prim "adaptonNow") ();
let cell = 0 := null;
while ((@ cell) == null) {
do within time `t {
assert ((prim "adaptonNow" ()) == (prim "adaptonTime" `t));
assert ((@ cell) == null);
(cell, start) := ?1;
assert ((@ cell) == null)
};
assert ((@ cell) == ?1);
assert ((prim "adaptonNow" ()) == start);
};
assert ((@ cell) == ?1)
}
}
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions fumola/examples/mergeSort/SeqTree.fumola
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,20 @@ module {
`adapton(`settings)(`forceBeginAlwaysMisses) := true
};
assert (enableCache == (not (@ (`adapton(`settings)(`forceBeginAlwaysMisses)))));
//
// Build input sequence, as a tree.
//
let inputArray = generateRandomInput(seed, size);
let inputSeq = Seq.fromArray(inputArray);
let inputBuildCounts = @(`adapton(`counts));
//
// Record the input tree as TikZ for a LaTeX report, if applicable.
//
Seq.writeTikzText(`mergeSort-`inputSeq-`seed-seed-`size-size, inputSeq);
let inputWriteCounts = @(`adapton(`counts));
//
// Demand-driven (lazy) MergeSort on the input tree.
//
let sorted = Seq.lazyMergeSort(@(inputSeq!));
let preDemandCounts = @(`adapton(`counts));
let result = switch (demandPattern) {
Expand All @@ -35,7 +44,12 @@ module {
};
let postDemandCounts = @(`adapton(`counts));
let comparisonCount = (prim "adaptonPeek" (prim "adaptonPointer" (`merge)))!;
let counts = { comparisonCount; inputBuildCounts; inputWriteCounts; preDemandCounts; postDemandCounts };
let counts = { comparisonCount;
inputBuildCounts;
inputWriteCounts;
preDemandCounts;
postDemandCounts
};
let output = { seed; size; counts };
output
};
Expand Down
22 changes: 0 additions & 22 deletions repl-imports/delayedPut.fumola

This file was deleted.

6 changes: 0 additions & 6 deletions repl-imports/test2

This file was deleted.

3 changes: 0 additions & 3 deletions repl-imports/test3

This file was deleted.

Loading