SciTech.blogSTEM articleshttps://scitech.blogReifying logicThis post describes formal logic embedded in formal logic. It sounds really weird but a simple example will illustrate why it might be useful.https://scitech.blog/article?id=151649d6dc672d41-6c8eb8a7-f5f1512f-934bd175-dd35ee0aSat, 24 Feb 2018 14:38:31 +0000Abduction as satisfiabilityEffectively propositional abductive problems can be cast in terms of satisfiability. This post shows when it's possible and how to do it.https://scitech.blog/article?id=151649b76996577f-88e2ac47-274842a7-c64e0e30-59a5dadbSat, 24 Feb 2018 14:36:16 +0000Planning as abductionAutomated 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.https://scitech.blog/article?id=151631a0ed56c432-c27023f5-7540c700-9d628446-49b443d9Sat, 24 Feb 2018 07:14:51 +0000Parsing by abductionParsing 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.https://scitech.blog/article?id=1516301b9beb9bcd-76a1b507-9849e02f-23da8049-a493b676Sat, 24 Feb 2018 06:46:59 +0000What is higher-order logic?Formal logics are axiomatic systems that formalise inference. Let’s look at what higher-order logic is and how it can be worked with.https://scitech.blog/article?id=15162b578491c3fa-5b7e66a3-4bc0db60-ebaeb00a-2fbfd150Sat, 24 Feb 2018 05:19:39 +0000The evaluation of non-floundering logic programsThis post is about an extension of Prolog which makes it a more useful and user-friendly logic programming language.https://scitech.blog/article?id=15162a4bcda3dea9-3d654134-c9b8aa5e-1933c24f-95ca8c10Sat, 24 Feb 2018 05:00:29 +0000Conditional conformance in SwiftSwift 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.https://scitech.blog/article?id=15162677051a3abc-5cfa35ba-f7ad8fbc-590b0673-855c4f47Sat, 24 Feb 2018 03:50:16 +0000Applicative functors in SwiftApplicative 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.https://scitech.blog/article?id=14ee375f48a689b9-36a023c9-0242c6b7-0a52c71c-232febd5Tue, 17 Oct 2017 01:30:07 +0000Monads in C++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.https://scitech.blog/article?id=14edcd144e0bf863-cd11f3cd-50947e51-6f1aae2b-966da19fSun, 15 Oct 2017 17:02:17 +0000Catamorphisms in C++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++.https://scitech.blog/article?id=14e9fda2333b5b78-abeb1646-8e06a110-22ff25b2-b45d3733Tue, 03 Oct 2017 07:07:03 +0000Fixpoints of functions in Python and C++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++.https://scitech.blog/article?id=14e82ffa5ce583c0-f61bc281-7e2f2389-0024cf07-4dba7bfeWed, 27 Sep 2017 10:07:07 +0000Recursive sum types in C++The recently released C++17 provides a new type, <code>std::variant</code>, for implementing sum types.
This post focusses on its basic use.https://scitech.blog/article?id=14e7ded666e7c4e6-59120990-75ec95db-5960885c-66e7460cTue, 26 Sep 2017 09:20:12 +0000Automatic memory management in CWhile 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.https://scitech.blog/article?id=14e7de1a6a537334-103d081c-1ba39939-b63af683-c25ebb30Tue, 26 Sep 2017 09:06:45 +0000A monad is......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.https://scitech.blog/article?id=14e7d734f959f9b3-9bb465d0-8f580c8c-085d8148-f645e774Tue, 26 Sep 2017 07:00:22 +0000Catamorphisms in PythonIn 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.https://scitech.blog/article?id=14e7515ac10fd9af-7a952573-f82d5302-6571cbba-fbcc79c8Sun, 24 Sep 2017 14:07:30 +0000What is entropy?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 \)?https://scitech.blog/article?id=14e6edd2f3e80cf5-d23f2040-02d42941-c3287477-bfe1448cSat, 23 Sep 2017 07:43:35 +0000Monads in PythonA 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.https://scitech.blog/article?id=14e6ba789679bfd0-a7497275-fdde4190-89bfa3e0-7e74d25aFri, 22 Sep 2017 16:02:32 +0000Developing a web app with Go (1)This post is the first part of a miniseries on developing web apps with Go, a C-like programming language designed at Google.https://scitech.blog/article?id=14e6ba093d9f88c1-214aa4d6-89c643b7-53a3f725-ca3f988fFri, 22 Sep 2017 15:54:34 +0000