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…
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:
…
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:…
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…
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…
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…
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…
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…
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…
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…
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…
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…
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 =…
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…