Skip to main content
1 vote
1 answer
78 views

Regarding the array reversal problem, I guess loop invariants are logically correct, based on the symmetry of the elements in the array and their relationship after reversal. However, I don’t ...
0 votes
2 answers
249 views

I'm trying to prove the following lemma: lemma myLemma6: "(∀x. A(x) ∧ B(x))= ((∀x. A(x)) ∧ (∀x. B(x)))" I'm trying to start by eliminating the forall quantifiers, so here's what I tried: ...
3 votes
1 answer
94 views

I am currently writing common theorems of intuitionistic logic in Haskell using the Curry-Howard isomorphism: import Data.Void type a :> b = a -> b -- implies type a :+ b = Either a b -- or data ...
1 vote
2 answers
65 views

I'm having trouble proving this within a while loop in Dafny: assert multiset(seqa) == multiset(seqa[..i] + seqa[i..]); Note: An invariant exists ensuring that 0 <= i <= |seqa|. There are no ...
0 votes
1 answer
261 views

I recently learned to study the security of zero-knowledge proofs. It seems from the Wikipedia, that the most popular example is the Ali Baba cave. I have a question about the security of the zero-...
1 vote
3 answers
8k views

I'm trying to construct a formal proof for 'P → Q ≡ ¬P ∨ Q' in Fitch. I know this is true, but how do I prove it?
18 votes
4 answers
69k views

In a previous problem, I showed (hopefully correctly) that f(n) = O(g(n)) implies lg(f(n)) = O(lg(g(n))) with sufficient conditions (e.g., lg(g(n)) >= 1, f(n) >= 1, and sufficiently large n). ...
6 votes
2 answers
148 views

The following problem and partial solution are from Richard Bird's Thinking Functionally with Haskell (pp 132-133, 139) given foldl f e (x:xs) = foldl f (f e x) xs foldl f e [] = e Prove foldl (@) e ...
21 votes
5 answers
4k views

I failed at reading RWH; and not one to quit, I ordered Haskell: The Craft of Functional Programming. Now I'm curious about these functional proofs on page 146. Specifically I'm trying to prove 8.5.1 ...
0 votes
0 answers
179 views

An exercise I've been working on is "Prove that there is no efficient 5/4-approximation toChromaticNumber unless P=NP. My question is what would P=NP tell us? Let's say we "Suppose P=NP" in our proof....
0 votes
1 answer
124 views

I am having trouble with a piece of Rocq code that I think has to do with providing a proof argument to a function, but I am not sure. Here's the relevant code. The code below typechecks: Require ...
1 vote
3 answers
2k views

How to prove that all maximal independent sets of a matroid have the same cardinality. Provided a matroid is a 2-tuple (M,J ) where M is a finite set and J is a family of some of the subsets of M ...
0 votes
0 answers
38 views

I have been trying to understand the Raft protocol for quite some time now. One thing that has always stumped me is the proof of the Log Matching property. One of my concerns is that the proof in the ...
3 votes
3 answers
938 views

I've seen several proofs for Floyd's algorithm in several posts inside and outside stack overflow. All of them proves the second part of the algorithm that is, why the method to find the start of the ...
15 votes
4 answers
5k views

Martin Fowler has a Money class that has a money allocation routine. This routine allocates money according to a given list of ratios without losing any value through rounding. It spreads any ...

15 30 50 per page
1
2 3 4 5
58