Questions tagged [deterministic]

The system or program exhibits the same behavior in different runs.

The system or program exhibits the same behavior on different runs. This is opposed to .

353 questions
13
votes
3 answers

STL within embedded system with very limited memory

I'm currently in the process of building an embedded system, using an ARM Cortex M3 processor, with 64 KB of SRAM. At the moment, I'm looking for a way to ensure deterministic performance with STL containers, which includes ensuring that I cannot…
12
votes
3 answers

Deterministic RSA encryption in Java

This is my first question on this site, and I only have a basic mathematical understanding of RSA, so please bear with me! :) I'm writing a Java web application for my final year project at university. It's a web-based implementation of…
Chris B
  • 709
  • 2
  • 14
  • 32
12
votes
2 answers

Determinism of Java 8 streams

Motivation I've just rewritten some 30 mostly trivial parsers and I need that the new versions behave exactly like the old ones. Therefore, I stored their example input files and some signature of the outputs produced by the old parsers for…
maaartinus
  • 44,714
  • 32
  • 161
  • 320
12
votes
12 answers

Sources of non-determinism

My supposedly deterministic program produces one of a few slightly different outputs on different runs. The input, compiler and computer are unchanging. I'm not sure which output is right because it always looks reasonable. Besides a stray call to…
zoo
  • 1,901
  • 1
  • 17
  • 25
11
votes
3 answers

Deterministic floating point and .NET

How can I guarantee that floating point calculations in a .NET application (say in C#) always produce the same bit-exact result? Especially when using different versions of .NET and running on different platforms (x86 vs x86_64). Inaccuracies of…
11
votes
7 answers

What is a Deterministic Quicksort?

I have been reading about Quicksort and found that sometimes it' s referred to as "Deterministic Quicksort". Is this an alternate version of the normal Quicksort ? What is the difference between a normal Quicksort and a Deterministic Quicksort ?
Andreas Grech
  • 105,982
  • 98
  • 297
  • 360
10
votes
4 answers

Is there a PL/SQL pragma similar to DETERMINISTIC, but for the scope of one single SQL SELECT?

In a SQL SELECT statement, I'd like to execute a function that is deterministic for the scope of that SELECT statement (or transaction would be ok, too): select t.x, t.y, my_function(t.x) from t Many values of t.x are the same so Oracle could omit…
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
10
votes
2 answers

Why does a query execute so much faster when I (manually) cache the results of a table-valued function in a temporary table?

Why is Query Version 2 so much faster? I suspect the DB Engine is calling the Table-Valued-Function "GetUsageStatistic" multiple times, so is there a way to tell the engine that "GetUsageStatistic" is deterministic and should be called only…
Triynko
  • 18,766
  • 21
  • 107
  • 173
10
votes
1 answer

Are .NET Decimal type computations deterministic?

I have two questions regarding .NET's decimal data type determinism: Are decimal type computations cross-platform deterministic? Or in other words, will math operations on decimal type produce exactly the same results on all platforms? Is casting…
zigzag
  • 579
  • 5
  • 17
10
votes
3 answers

Prolog: How to tell if a predicate is deterministic or not

So from what I understand about deterministic predicates: Deterministic predicate = 1 solution Non-deterministic predicate = multiple solutions Are there any type of rules as to how you can detect if the predicate is one or the other? Like looking…
John Smith
  • 181
  • 1
  • 7
10
votes
3 answers

Can I make a Deterministic Shuffle in clojure?

I'd like to make some shuffles of sets which will be the same every time my program is run: This is one way to do it: (def colours ["red" "blue" "green" "yellow" "cyan" "magenta" "black" "white"]) (defn colour-shuffle [n] (let [cs (nth…
John Lawrence Aspden
  • 17,124
  • 11
  • 67
  • 110
9
votes
7 answers

Java's Representation of Serialized Objects

I'm looking for the format that Java uses to serialize objects. The default serialization serializes the object in a binary format. In particular, I'm curious to know if two runs of a program can serialize the same object differently. What condition…
reprogrammer
  • 14,298
  • 16
  • 57
  • 93
8
votes
1 answer

What are some examples of non-determinism in the C++ compiler?

I'm looking for examples of code that triggers non-determinism in GCC or Clang's compilation process. One prominent example is the usage of the __DATE__ macro. GCC and Clang have a plethora of compiler flags to control the outcome of…
Gaetano
  • 1,090
  • 1
  • 9
  • 25
8
votes
2 answers

Prolog : avoid redundant choice points (non-determinism) with and without cut operator

Firstly, I have read all other posts on SO regarding the usage of cuts in Prolog and definitely see the issues related to using them. However, there's still some unclarity for me and I'd like to settle this once and for all. In the trivial example…
SND
  • 1,552
  • 2
  • 16
  • 29
8
votes
2 answers

How to make conversions from varchar to datetime deterministic?

In the tradition of this question and in light of the documentation, how does one make this function deterministic: ALTER FUNCTION [udf_DateTimeFromDataDtID] ( @DATA_DT_ID int -- In form YYYYMMDD ) RETURNS datetime WITH SCHEMABINDING AS BEGIN …
Cade Roux
  • 88,164
  • 40
  • 182
  • 265
1
2
3
23 24