-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51c8738
commit efa003f
Showing
8 changed files
with
176 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#1/bin/bash | ||
javac -classpath "build/java/DafnyVMC.jar:docs/java/" docs/java/CustomUniformSample.java docs/java/CustomUniformSampleFaulty.java | ||
javac -classpath "build/java/DafnyVMC.jar:docs/java/" docs/java/CustomFisherYates.java docs/java/CustomFisherYatesFaulty.java | ||
java -classpath "build/java/DafnyVMC.jar:docs/java/" docs/java/BuildTest.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import Uniform.Interface.TraitMinus; | ||
import Uniform.Interface.Trait; | ||
import java.math.BigInteger; | ||
import java.security.SecureRandom; | ||
import java.util.Random; | ||
import dafny.TypeDescriptor; | ||
|
||
class CustomUniformSampleFaultyMinus implements Uniform.Interface.TraitMinus { | ||
public BigInteger UniformSample(BigInteger n) { | ||
return BigInteger.valueOf(0); | ||
} | ||
} | ||
|
||
class CustomUniformFaulty extends CustomUniformSampleFaultyMinus implements Uniform.Interface.Trait { | ||
public java.math.BigInteger UniformIntervalSample(java.math.BigInteger a, java.math.BigInteger b) { | ||
return Uniform.Interface._Companion_Trait.UniformIntervalSample(this, a, b); | ||
} | ||
} | ||
|
||
class CustomFisherYatesMinusFaulty extends CustomUniformFaulty implements FisherYates.Implementation.Trait { | ||
public <__T> void Shuffle(dafny.TypeDescriptor<__T> _td___T, java.lang.Object a) { | ||
FisherYates.Implementation._Companion_Trait.Shuffle(_td___T, this, a); | ||
} | ||
|
||
public <__T> void Swap(dafny.TypeDescriptor<__T> _td___T, java.lang.Object a, java.math.BigInteger i, java.math.BigInteger j) { | ||
FisherYates.Implementation._Companion_Trait.Swap(_td___T, this, a, i, j); | ||
} | ||
} | ||
|
||
public class CustomFisherYatesFaulty extends CustomFisherYatesMinusFaulty { | ||
public void Shuffle(BigInteger[] arr) { | ||
this.Shuffle(TypeDescriptor.BIG_INTEGER, arr); | ||
} | ||
|
||
public void Shuffle(int[] arr) { | ||
this.Shuffle(TypeDescriptor.INT, arr); | ||
} | ||
|
||
public void Shuffle(String[] arr) { | ||
this.Shuffle(TypeDescriptor.CHAR_ARRAY, arr); | ||
} | ||
|
||
public void Shuffle(char[] arr) { | ||
this.Shuffle(TypeDescriptor.CHAR, arr); | ||
} | ||
|
||
public void Shuffle(boolean[] arr) { | ||
this.Shuffle(TypeDescriptor.BOOLEAN, arr); | ||
} | ||
|
||
public void Shuffle(long[] arr) { | ||
this.Shuffle(TypeDescriptor.LONG, arr); | ||
} | ||
|
||
public void Shuffle(short[] arr) { | ||
this.Shuffle(TypeDescriptor.SHORT, arr); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters