Questions tagged [equivalence]

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

References

168 questions
2
votes
2 answers

Check numeric constraint expressions for equivalence/subset of allowed values

I have an AST representing expressions like these: (<=10 && >=3) || ==0 ==1 || ==2 || ==3 ==1 && !=1 There are numerics as well as boolean (||, &&) and numeric (<, <=, ==, !=, >=, >) operators. A boolean not operator can be added to the AST if…
snøreven
  • 1,904
  • 2
  • 19
  • 39
2
votes
2 answers

Translating fortran to python: equivalence command used to generate a matrix from text file

I am trying to replicate an old fortran code so I can use it in python. The hardest part is importing the data which is stored in a rather convoluted shape. I have a text file with 14500 data points stored in 5 columns separated by commas: …
Delosari
  • 677
  • 2
  • 17
  • 29
2
votes
1 answer

Database Theory: Transaction serializability

Hy, I'm learning for my exams and came over the following question: Take the History (or Schedule) H = w1[x] w2[x] w2[y] c2 w1[y] w3[x] w3[y] c3 w1[z] c1 where w1[x] means: Transaction 1 writes to Data-Object X (r1[x] means read) and c1 means:…
theomega
  • 31,591
  • 21
  • 89
  • 127
2
votes
3 answers

Making an equivalence in Java

As you will probably see from my code I'm quite new with this. I am trying to write a simple program to retrieve the friends of one person. Here is my code: public class Person { private String name; private String friends; public…
Alex Simion
  • 93
  • 1
  • 14
2
votes
1 answer

How to show that 2 formula sare semantically equivalent in Isabelle

I want to (miss-)use Isabelle to show that two given formulas are syntactically equivalent. For example A ∧ B = B ∧ A. I don't want to go into any detail with regards towards the logic behind the formulas. I don't want to care that A ∧ B is true…
TKler
  • 135
  • 7
2
votes
1 answer

Proving equivalence between non-tail-recursive and tail-recursive functions

I have a recursive function* that is similar to an "optional map", with the following signature: omap (f : option Z -> list nat) (l : list Z) : option (list nat) I defined an equivalent (modulo list reversal) tail-recursive function (omap_tr…
anol
  • 8,264
  • 3
  • 34
  • 78
2
votes
1 answer

Scheme equivalence relation

I need help defining a Scheme function that takes a partition (list of lists) and returns a list of pairs that represents an equivalence relation. I've started writing some code but I'm realizing I'm going in the wrong direction. I've been looking…
Bill
  • 47
  • 3
2
votes
2 answers

Is there an equivalent in MS SQL Server to the <=> operator in MySQL?

I was just reading this question, about <=> in MySQL: What is this operator <=> in MySQL? Is there an equivalent to this for SQL Server?
ingredient_15939
  • 3,022
  • 7
  • 35
  • 55
2
votes
5 answers

Java: Equalator? (removing duplicates from a collection of objects)

I have a bunch of objects of a class Puzzle. I have overridden equals() and hashCode(). When it comes time to present the solutions to the user, I'd like to filter out all the Puzzles that are "similar" (by the standard I have defined), so the user…
Nick Heiner
  • 119,074
  • 188
  • 476
  • 699
2
votes
1 answer

Transfer from Fortran 77 code(combination of common block and equivalence) to Fortran 90

In the Fortran 77 code , there is a combination use of common block and equivalence statement. For example, common /X/ a,b,c,d dimension arr(4) equivalent(arr(1),a) Can anybody provide a feasible solution that convert this kind of…
witrus
  • 297
  • 1
  • 3
  • 13
2
votes
1 answer

Fortran: combine allocatable vectors in an array without copying and reshaping

How can one combine bunch of large allocatable vectors in an array in Fortran? I'd like to avoid copying and reshaping using reshape as the arrays are large. The effect I want to achieve is just like Fortran's equivalence, to illustrate: program…
beetleboom
  • 23
  • 1
  • 3
1
vote
2 answers

MySQL equivalence vs. updates

When updating a row by UPDATE, is it always guaranteed the the row is 'affected' then, and only then, if some of the fields set in the UPDATE statement would hold NOT field='value' ? Would that also mean that for any two directly sequential…
dronus
  • 10,774
  • 8
  • 54
  • 80
1
vote
1 answer

comparing two tensors in pytorch

I've already tried the solutions described in this question: How to check if two Torch tensors or matrices are equal? and I'm not having any luck for some reason. I'm just trying to test reproducibility of my random number seed as an example: import…
slashdottir
  • 7,835
  • 7
  • 55
  • 71
1
vote
1 answer

Does SKS equal SKK?

Context I started teaching myself lambda calculus last night and I am trying to determine if what I understand so far is correct. Understanding SKK is equivalent to the Identity combinator, I. Where L stands for lambda: S = LxLyLz((xz)(yz)) K =…
1
vote
0 answers

Computing classes of maximal path-equivalent nodes in a rooted DAG

I have a rooted directed acyclic graph with a single root node r. I'm interested in computing the following equivalence: "Nodes v and w are maximal path-equivalent iff every maximal path from r contains either both of v and w or none of them" In…