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 ...
Morgan's user avatar
  • 13
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 ...
Zayd Mohammed's user avatar
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 ...
Marko K's user avatar
  • 11
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 ...
Anirudh's user avatar
  • 361
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 ...
arl's user avatar
  • 118
2 votes
2 answers
94 views

The problem involves proving, using mathematical induction, the correctness of the recursive function presenza_strg (comments are in italian sorry for that) /*Controlla in maniera ricorsiva se s1 è ...
Nicola Pirozzi's user avatar
0 votes
0 answers
53 views

I'm currently studying concepts related to linearizability and I struggle with going from the linearization points of an implementation to the actual proof of linearizability. As far as I have ...
Malaski's user avatar
1 vote
1 answer
173 views

I am trying to use Lean 4 to reduce the halting problem to hyperbolic geometry to prove the undecidability of hyperbolic geometry, having problems with the diagonalization of the Turing machines, also ...
João Teixeira's user avatar
0 votes
2 answers
83 views

I've implemented a proof system from a paper in Coq, as shown below. Term proof System Require Import Ensembles. Definition Var := nat. Definition Name := nat. Inductive Term: Type := | VarTerm (v: ...
satiscugcat's user avatar
1 vote
0 answers
106 views

Trigger I am writing an exercise in Functional Programming in Lean. The example shows a way to generate an instance for GetElem' (NonEmptyList α) Nat α .. with a bound. I explain it as to implement ...
Chuannan Zhang's user avatar
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 ...
planarian's user avatar
  • 2,183
0 votes
0 answers
106 views

Doing the leetcode problem https://leetcode.com/problems/longest-substring-without-repeating-characters/ I found this solution: def lengthOfLongestSubstring(self, s: str) -> int: left = 0 ...
Javier Lázaro's user avatar
1 vote
0 answers
53 views

Given a Voronoi diagram in three dimensions, what is the expected number of full neighbors E(C) of a Voronoi cell? Two adjacent cells are considered full (or Gabriel) neighbours in R^3 if the line ...
student.a's user avatar
0 votes
3 answers
190 views

I got a bit confused about analzsis of data structure basic operation like inserting or deleting. when I am asked about creating an data structure that support deleting operation, or inserting in O(1),...
miiky123's user avatar
  • 119
0 votes
1 answer
95 views

I want to prove that the following code returns a given amount (money) in 5 and 3 bills/coins: function sum(ns: seq<nat>): nat { if |ns| == 0 then 0 else ns[0] + sum(ns[1..]) } ...
Pablo Fernandez's user avatar

15 30 50 per page
1
2 3 4 5
58