Chess is a board game, with 8×8 tiles and some figures on them. It’s a turn-based game, usually played by two players (or one, for practicing), and the players move these figures accordi… | Continue reading
Recently I finished Logical Foundations, and I have to admit it was an excellent read. This post is directly inspired by the Simple Imperative Programs section of the same book. What is an imperati… | Continue reading
DST changes in North Macedonia on the last Sunday of October. It happens to be the 25th of October this year. What can we do with the previous statement, other than generalize it and try to prove a… | Continue reading
Constraint programming is a programming paradigm where problems are stated declaratively. In this post, I will implement a very simple constraint solver. | Continue reading
I used to play a lot of video games, and nowadays not that many. But I have never written a game overview. I believe this game deserved one. | Continue reading
As with my previous post, this post is another excerpt that will be included in my final Master’s thesis, but I decided it is interesting enough to post it on its own. We start with a definition of… | Continue reading
This post is an excerpt that will be included in my final Master’s thesis, but I decided it is interesting enough to post it on its own. We will define a few of Peano’s axioms together … | Continue reading
This blog post will serve as a quick tutorial to basic probability and random variables, and encoding them in Racket. It assumes basic knowledge with sets and programming. | Continue reading
As with most of my mornings, they start with a coffee and reading the news on time.mk – news portals' aggregator. At the time of writing this post, there are about 115 sources on the sou… | Continue reading
According to Wikipedia, a line editor is a text editor in which each editing command applies to one or more complete lines of text designated by the user. We will implement our own line editor in C… | Continue reading
Exactly a year ago, in one of my previous posts, we proved Monoid laws with Idris. We’ll do the same with Groupoids. | Continue reading
I like puzzles. If it’s a non-trivial one, in order to come up with a solution I usually spend a few days (on and off) thinking about it. But it also has to be interesting to get my attention… | Continue reading
In my previous post, I had a different approach to Tuply singleton. This is the third and last post in the Tuply singleton series. We will provide mathematical proof for correctness, and also show … | Continue reading
In my previous post I showed how we can encode a pair into a single number. I found out that encoding is wrong for some numbers. For example, consider the pairs $latex \{ (0.4, 3), (2.8, 2) \}$. If… | Continue reading
I noticed this while at a company team meetup. Whenever we were discussing which place we should eat food at, most of my coworkers were paying attention to two numbers: rating and number of votes. … | Continue reading
Suppose one of your programmer friends comes to you and says: “Hey, convince me that 1 + 1 = 2!”. What a request. You start by “Okay, I have one apple in my hand. I grab another o… | Continue reading
These are the values I get on my 3rd day of running, after a long break: 4’48” or 12.5 km/h (= 60/4’48”) for distance 2.06km 4’53” or ~12.29 km/h for distance 1.… | Continue reading
Per Wikipedia, an algebraic data type is a kind of composite type, i.e., a type formed by combining other types. Haskell’s algebraic data types are named such since they correspond to an init… | Continue reading
In Mathematics, there are many curves. From a constant curve $latex f(x) = b$, to a linear one $latex f(x) = ax + b$, to a quadratic one $latex f(x) = ax^2 + bx = c$ to …, you name it. Now, i… | Continue reading
We’re in the process of renovating our house with my wife. We have a bunch of “engineers” working on it: electricians, plumbers, wall painters. These guys have direct contact with… | Continue reading
Lately I’ve been thinking about this: What do we get if we change lambda calculus’s abstraction from (λx.M) to (λN.M), where M and N are lambda terms, and x is a variable? That is (foll… | Continue reading
This tutorial serves as a very short and quick summary of the first few chapters of TAPL. My previous post was a general overview of how we can design an evaluator and a type checker. This post is … | Continue reading
I found this awesome paper “A tutorial implementation of a dependently typed lambda calculus”, by Löh, A., C. McBride, W. Swierstra and I decided to give it a go. I read the paper a few… | Continue reading
I was watching an interesting video, Opening Keynote by Edward Kmett at Lambda World 2018. Note in the beginning of that video how in Haskell you’d put code comments in place of proofs. Enter… | Continue reading
A binary relation $latex R$ is a partial order if the following properties are satisfied: Reflexivity, i.e. $latex \forall a, a R a$ Transitivity, i.e. $latex \forall a, b, c, a R b \land b R c \to… | Continue reading
According to Wikipedia, the bisection method in mathematics is a root-finding method that repeatedly bisects an interval and then selects a subinterval in which a root must lie for further processi… | Continue reading
Lambda calculus is a formal system for representing computation. As with most formal systems and mathematics, it relies heavily on substitution. We will start by implementing a subst procedure that… | Continue reading
One well known fact is the sum $latex 1 + 2 + \ldots + n = \frac {n(n + 1)} {2}$. Let’s try to prove this fact in Idris. We start intuitively by defining our recursive sum function: Testing i… | Continue reading
First, let’s start by implementing map’ and filter’ for lists: Trying a few cases: Looks neat. A valid question would be: What do we know about the length of a mapped and length o… | Continue reading
In an earlier post, we’ve defined what formal systems are. In this example, we’ll put formal systems into action by building a proof tree generator in the Racket programming language. W… | Continue reading
Recently I was working on a project that involved the usage of PayPal REST API SDK. To give a little bit of background, starting in PHP 7.x (I believe 7.2), the language will throw a warning if you… | Continue reading
One thing that was always interesting to me about Lisps in general is their minimality, which means that with a couple of starting points you can implement almost anything in the language, even par… | Continue reading
Today I refactored a small piece of code. Before: After: This was intuitive to me, but I wanted to prove that it really does the same thing. For that, we need to use the property $latex min(a ̵… | Continue reading