Skip to content

luciangreen/Logic-Formula-Finder

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

Logic-Formula-Finder

Finds formulas with and, or and not from data.

  • logic_ff1.pl

Getting Started

Please read the following instructions on how to install the project on your computer for finding logical formulas.

Prerequisites

  • Please download and install SWI-Prolog for your machine at https://www.swi-prolog.org/build/.

1. Install manually

Download this repository.

2. Or Install from List Prolog Package Manager (LPPM)

git clone https://github.com/luciangreen/List-Prolog-Package-Manager.git
cd List-Prolog-Package-Manager
swipl
['lppm'].
lppm_install("luciangreen","Logic-Formula-Finder").
halt

Running

  • In Shell: cd Logic-Formula-Finder swipl ['logic_ff1.pl'].
  • Run with:
?- logic_ff0([
[[[a, true], [b,  false],[c,true],[d,false]], [true]],
[[[a, true], [b,  false],[c,false],[d,false]], [true]],
[[[a, false], [b,  false],[c,true],[d,false]], [true]],
[[[a, true], [b,  true],[c,true],[d,false]], [true]],
[[[a, false], [b,  false],[c,false],[d,false]], [true]]
],F).

to find formulae with this set of specs (concluding with the result at the end of each line) and some results:

F=[[not,d],[not,[a,and,[d,and,[b,and,c]]]],[not,[a,and,[d,and,[b,or,c]]]],[not,[a,and,[d,and,[c,and,b]]]],[not,[a,and,[d,and,[c,or,b]]]],[not,[a,and,[d,and,[not,[b,and,c]]]]],[not,[a,and,[d,and,[not,[b,or,c]]]]],[not,[a,and,[d,and,[not,[c,and,b]]]]],[not,[a,and,[d,and,[not,[c,or,b]]]]],[not,[a,and,[[d,and,b],and,c]]],[not,[a,and,[[d,and,c],and,b]]],[not,[a,and,[[not,[d,or,c]],and,b]]],[not,[b,and,[d,and,[a,and,c]]]],[not,[b,and,[d,and,[a,or,c]]]],[not,[b,and,[d,and,[c,and,a]]]],[not,[b,and,[d,and,[c,or,a]]]],
.
.
.

Authors

Lucian Green - Initial programmer - Lucian Academy

License

I licensed this project under the BSD3 License - see the LICENSE.md file for details

About

Finds formulas with and, or and not from data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages