F#/Clojure implementation of Cathoristic Logic
Ported from the original Haskell implementation to F# with a ClojureCLR wrapper. Much thanks to @vivid-synth for the Haskell guidance.
Still rough, don't use for anything important. 25/26 of the original tests are passing.
The F# compiler will issue warnings that you should ignore. It should produce
FSharp.Core.dll in the same directory.
$ fsharpc -a Cathoristic.fs Microsoft (R) F# Compiler version 4.1 Copyright (c) Microsoft Corporation. All Rights Reserved. /Users/nasser/Projects/cathoristic/Cathoristic.fs(83,21): warning FS0025: Incomplete pattern matches on this expression. For example, the value '(_,None)' may indicate a case not covered by the pattern(s). /Users/nasser/Projects/cathoristic/Cathoristic.fs(106,34): warning FS0025: Incomplete pattern matches on this expression. For example, the value '(_,None)' may indicate a case not covered by the pattern(s).
cl namespace has the following definitions and functions, taken from the original API.
(entails? p q)
(trans sym prop)
(conj prop prop)
A 'symbol' here is anything that can be turned into a string. As a convenience if
trans is called with one argument the second default to
top. Additionally, some sugar is provided:
(∧ p q)→
(conj p q)
(! & ss)→
(?= p q)→
(entails? p q)
The Clojure implementation is tested using nostrand, but should work anywhere ClojureCLR does.
$ nos repl user> (use 'cl) WARNING: conj already refers to: #'clojure.core/conj in namespace: user, being replaced by: #'cl/conj nil user> (?= top top) true user> (?= top bot) false user> (?= (trans :a (! :b)) (trans :a)) true user> (?= (trans :a (! :b)) (trans :a (! :c))) false