Questions tagged [equivalence]

Equivalence is a relationship in which two or more identifiers are abstractions for the same data structure.

References

168 questions
1
vote
1 answer

Trouble with EQUIVALENCE statements in Fortran 77 Code

I am working on getting a raytracing code working and I think I may have isolated the problem. I am new to working with Fortran 77, but would like to gain more experience using this language (even if it is dated). I have some EQUIVALENCE…
AD0AE
  • 91
  • 5
1
vote
2 answers

Equivalence of java.util.ResourceBundle in C++

I have a Java class that uses more lines similar to the following ones private static final int PARAM_1 = Integer.valueOf(ResourceBundle.getBundle("solution.filtres").getString("filtre.param1.solution")); private static final int PARAM_2 =…
thedarkside ofthemoon
  • 2,251
  • 6
  • 31
  • 48
1
vote
2 answers

Testing equivalence of maps in Go with the same contents, but the test failed

Here is a word-count function in Go package wc import ( "regexp" "strings" ) type Histogram map[string]int func WordCount(input string) Histogram { histogram := make(map[string]int) re := regexp.MustCompile("[^a-zA-Z0-9 ]*") …
ChangHun Lee
  • 127
  • 1
  • 12
1
vote
1 answer

Testing - Equivalence partitioning / Boundary Value analysis on data which has variable boundaries

I have an input value I wish to test where the acceptable range is 1..n (n is variable but always positive). To give it some context, n is the quantity of a product in stock at any one time (which changes day to day). A user may request to use 1 or…
1
vote
3 answers

Logical equivalence of a sequence of if else if else clauses

I am seriously under-slept and I need help in rewriting this small Python piece of logic for _ in range(100): if a: continue elif b: continue elif c and d: continue else: e() I want to have something…
baibo
  • 448
  • 4
  • 20
1
vote
1 answer

Why can't I check for string equivalence against stderr of Popen() in Python?

I'm running an ldaplist command from a Python script (not doing enough to warrant the ldap module): storage = Popen(["ldaplist", "-l", "passwd", "bob"], stdout=PIPE, stderr=PIPE) stdout, stderr = storage.communicate() After this, I'd like to take…
CptSupermrkt
  • 6,844
  • 12
  • 56
  • 87
1
vote
1 answer

Comparing structure equality of lists

How can I check the structural equality of two lists in Scheme? For example, (a (b) (c d)) is equal to (a b (c d) (e f g)), and (a b) is equal to (a b c). The data content of the lists does not matter, only the structural hierarchy of the nested…
user2827214
  • 1,191
  • 1
  • 13
  • 32
1
vote
1 answer

Does Visual Basic use stucture or name type equivalence, or both?

Just having a hard time understanding if Visual Basic uses structure or name type equivalence (or both).
1
vote
1 answer

Why is Matlab is not reading an empty cell while running an if statement?

I am using the loop below to isolate instances where data was recorded versus those with no data. The data set is very large (varying from 1000-6000 depending on the column) and of mixed data types, so the only practical solution I can think of is…
1
vote
1 answer

WPF equivalent to Flex states

Flex has a very elegant concept of states which let you define what components should be displayed and what should they look like based on the parent component "state". For example, you could define some Login window states as…
MonoThreaded
  • 11,429
  • 12
  • 71
  • 102
1
vote
3 answers

How to implement equivalence class in Java?

What would be the simple way to implement equivalence class in Java? Is there any library for that purpose? The bothering part is how to write an efficient and non-naive "equal" operator. Let S = {x,y,z,w,h}. If we use a mapping x->1, y->1, z->1,…
zell
  • 9,830
  • 10
  • 62
  • 115
1
vote
4 answers

C++ Stl Set Behavior

I was trying to run the below code. What I am finding is that there is difference in the output. I understand that there is an issue with ordering mechanism used in the Comparator functionality. What I am basically looking for is: 1) How does Set…
PhiberOptixz
  • 512
  • 6
  • 13
1
vote
0 answers

Morphism - Setoid on non-convertible terms in Coq

I have the following function in Coq. Now I want to define an instance as below. In my case, equivalence [==] on type [nat] is defined but not on [StringMap.t String.t]. Please if you solve the Instace SC_Proper. Thanks. Definition SC (u: nat)…
Khan
  • 303
  • 2
  • 14
1
vote
3 answers

Compilation error with == operator

I've isolated the error to this line: string.getClass() == jojo.getClass() Shouldn't this line create two Class objects and then check if they (as in the two references) point to the same object? Rather than returning a value of false, the code…
user1953794
  • 27
  • 1
  • 7
1
vote
2 answers

automata: using only Equivalence class to proove regularity

I have tried to go about this problem in several ways, and looked in several places with no answer. the question is as follow: [Question] Given two regular languages (may be referred to as finitely described languages ,idk) L1 and L2, we define a…