More on Logic Programming and Prolog Examples
In a prior post I talked about logic programming. Here is more including two working examples that I created in Prolog with the help of someone on the SWI-Prolog list.
First, here are the two Prolog examples:
- Accounting Equation: Assets = Liabilities + Equity. (SWISH Output)
- FASB SFAC 6, Elements of Financial Statements: Represents the 10 elements of financial statements and relations defined by the FASB in SFAC 6. (SWISH Output)
Both of these will run using this online SWI-Prolog application (click on "Program"). For more information including documentation, tutorials, examples, etc.; go to the SWI Prolog web site.
What is particularly interesting is the SWISH "wrapper" that you have on top of SWI-Prolog.
Something else that I ran across that is similar to SWISH is LogicBlox. They also have an online application, LogiQL Playground, that provides similar functionality using a similar strategy and underlying syntax which is Datalog. Here is more information on LogicBlox.
There seems to be an entire community interested in Prolog creating extensions. For example, SimGen.
As I understand it, this is a Prolog based accounting system. What would be REALLY interesting would be to adjust that Prolog system to handle XBRL and so it will output an XBRL-based financial statement.
###################################
Post to SWI-Prolog Forum related to Creating the Two Prototypes Above
Google's Yedalog which is an extension of Datalog
Visual JavaScript (visjs.org)
Reader Comments