When playing the Natural Number Game (in Lean), in Advanced Multiplication World Level 2/4, I used the following code. The last three lines seem to ca ...
When playing the Natural Number Game (in Lean), in Advanced Multiplication World Level 2/4, I used the following code. The last three lines seem to ca ...
I have the following peano number written with GADTs: type z = Z of z type 'a s = Z | S of 'a type _ t = Z : z t | S : 'n t -> 'n s t module T ...
I am writing a prolog program with can perform Peano arithmetics. I have standard definitions for natural numbers. Because I want to enumerate all ...
I tried to run this code, but it failed with Exception: stack overflow. I tried to increase stack size to its maximum limit, but it didn't help I onl ...
At Uni we were given a challenge of creating a tail recursive addition of Peano numbers using an accumulator. We aren't allowed to use any library fun ...
I am learning coq and am trying to prove equalities in peano arithmetic. I got stuck on a simple fraction law. We know that (n + m) / 2 = n / 2 + m ...
Can someone please explain how to do make this work without a loop? let x = prompt("Enter a first number to add:"); let y = prompt("Enter a second nu ...
I am a little confused whether the injectivity of the successor function defined on natural numbers in Coq is an axiom? According to Wikipedia/Peano a ...
I'm trying to create a stream/sequence of natural numbers from the number 0 and a successor function S, through the generateSequence function. Here's ...
I was going through the book Software foundations to learn Coq and I got stuck on Numbers. In this Type definition How does O becomes 0 when we us ...
I'm going through the course Functional Programming Principles in Scala on Coursera. There is an example of implementation of the Peano numbers which ...
I wanted to write a simple implementation of Peano numbers in Rust and it seems that I managed to get the basics working: However, when I decided t ...
I encountered this doubt in an online intro-logic open course offered by Stanford Uni. Under the section 9.4 of this textbook here: http://logic.sta ...
This is the definition of Nat in package shapeless: What are the type declarations for ? Once removed it seems to me that the definition works equa ...
I'm trying to get a better understanding of ZFC set theory, in particular how a computer program might model the axiom of infinity to "construct" natu ...
The mono-traversable package uses type level Peano numbers for MinLen. I can construct them using chained Succs: but this quickly gets out of hand: ...
I started learning Haskell recently and in my class right now, we have constructed a Peano number class and instanced it in the Num typeclass. During ...
This is a follow-up of a question I asked almost two years ago. I am still experimenting with the type system to write a small linear algebra library ...
I'm trying to write a function that turns an Integer into its Peano Number. I have the data: For example, and so on. I have no idea how t ...
I was listening to the steve yegge podcast (#29, around 21:29), and in part of it, they were talking about "how to tell if the person you're talking t ...