24 Feb 2018, 14:38 • logic, nlp • 219 views
This post describes formal logic embedded in formal logic. It sounds really weird but a simple example will illustrate why it might be useful.
24 Feb 2018, 14:36 • logic • 230 views
Effectively propositional abductive problems can be cast in terms of satisfiability. This post shows when it's possible and how to do it.
24 Feb 2018, 07:14 • logic • 229 views
Automated planning is the task of finding a plan to achieve a goal given some prerequisites. Planning problems can be cast in terms of abductive theories which allows us to use an abductive prover to find the best plan.
24 Feb 2018, 06:46 • logic, nlp • 217 views
Parsing reveals the syntactic structure of a sentence. Abduction is inference to the best explanation. We show in this post that context-free parsing is a special case of abductive reasoning.
24 Feb 2018, 05:19 • logic, semantics • 271 views
Formal logics are axiomatic systems that formalise inference. Let’s look at what higher-order logic is and how it can be worked with.
24 Feb 2018, 05:00 • prolog, logic • 256 views
This post is about an extension of Prolog which makes it a more useful and user-friendly logic programming language.
24 Feb 2018, 03:50 • swift • 236 views
Swift 4.1 brought an improvement to the language's type system called conditional conformance, which allows you to specify that a generic class conforms to a protocol based on the generic arguments' conformance to protocols. A simple example is presented.
17 Oct 2017, 01:30 • swift, monads • 293 views
Applicative functors are less general than functors but more general than monads, which makes them useful in some scenarios. Swift is sufficiently functional to admit a straightforward implementation.
15 Oct 2017, 17:02 • monads, c++ • 401 views • 1 comment
Implementing monads in C++ is a little tricky, since there are no higher-kinded types. We can however use template specialisation to achieve the same effect.
3 Oct 2017, 07:07 • c++, catamorphism • 2457 views
In functional programming, fixpoints of data types are used to define recursive types. Let’s see an example of how one can use this technique in C++.
27 Sep 2017, 10:07 • c++, python • 2328 views
The fixpoint operator (\(\mu\)) on functions provides a way of converting nonrecursive functions into recursive ones. Let's learn how to implement it in Python and C++.
26 Sep 2017, 09:20 • c++, algebraic types • 300 views
The recently released C++17 provides a new type,
std::variant, for implementing sum types. This post focusses on its basic use.
26 Sep 2017, 09:06 • c, memory management • 281 views
While not part of the language, it's perfectly possible to automatically manage memory in C. Let's look at how to implement a simple object system with garbage collection.
26 Sep 2017, 07:00 • monads, theory • 444 views
...a monoid in the category of endofunctors. This enigmatic sentence keeps perplexing beginner programmers. In this post we dissect it so you don't have to read a whole book on category theory in order to understand what it means.
24 Sep 2017, 14:07 • python, catamorphism • 967 views
In functional programming, fixpoints of data types are used to define recursive types. Let’s see an example of how one can use this technique in Python.
23 Sep 2017, 07:43 • theory, entropy • 267 views
Intuitively, entropy is the measure of in how many states a system can be. But how can we arrive from this intuition at \( H(X)= -\sum_i p_i \log p_i \)?
22 Sep 2017, 16:02 • python, monads • 326 views
A monad is an abstract concept used in functional programming to sequence computation, but it can also be useful in OOP. Let's take a look at how to implement monads in Python.
22 Sep 2017, 15:54 • go, web • 214 views
This post is the first part of a miniseries on developing web apps with Go, a C-like programming language designed at Google.