All Projects → jariazavalverde → fasill

jariazavalverde / fasill

Licence: BSD-3-Clause license
Fuzzy Aggregators and Similarity Into a Logic Language

Programming Languages

prolog
421 projects
PHP
23972 projects - #3 most used programming language
TeX
3793 projects
javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
SMT
39 projects

Projects that are alternatives of or similar to fasill

PyNets
A Reproducible Workflow for Structural and Functional Connectome Ensemble Learning
Stars: ✭ 114 (+470%)
Mutual labels:  fuzzy-logic
ruspea
A Lisp to be used as a Ruby Library (written in Ruby)
Stars: ✭ 20 (+0%)
Mutual labels:  language-design
nearley-playground
⛹ Write Grammars for the Nearley Parser!
Stars: ✭ 76 (+280%)
Mutual labels:  language-design
Proposals
Tracking ECMAScript Proposals
Stars: ✭ 14,444 (+72120%)
Mutual labels:  language-design
Csharplang
The official repo for the design of the C# programming language
Stars: ✭ 8,132 (+40560%)
Mutual labels:  language-design
lplzoo
Fine-grain implementations of common lambda calculi in Haskell, tested with QuickCheck
Stars: ✭ 32 (+60%)
Mutual labels:  language-design
metameta
Metameta is meta core and meta-class programming framework.
Stars: ✭ 39 (+95%)
Mutual labels:  language-design
lip
An embeddable LISP in C99
Stars: ✭ 16 (-20%)
Mutual labels:  language-design
compiler-course-unipi
Lab of the course Languages, Compilers and Interpreters (Cod. 653AA) @ UNIPI
Stars: ✭ 18 (-10%)
Mutual labels:  language-design
pyfuzzylite
pyfuzzylite: a fuzzy logic control library in Python
Stars: ✭ 42 (+110%)
Mutual labels:  fuzzy-logic
PyIT2FLS
Type 1 and Interval Type 2 Fuzzy Logic Systems in Python
Stars: ✭ 34 (+70%)
Mutual labels:  fuzzy-logic
ProbQA
Probabilistic question-asking system: the program asks, the users answer. The minimal goal of the program is to identify what the user needs (a target), even if the user is not aware of the existence of such a thing/product/service.
Stars: ✭ 43 (+115%)
Mutual labels:  fuzzy-logic
numberwords
Convert a number to an approximated text expression: from '0.23' to 'less than a quarter'.
Stars: ✭ 191 (+855%)
Mutual labels:  fuzzy-logic
fuzzylogic
Fuzzy Logic and Fuzzy Inference for Python 3
Stars: ✭ 74 (+270%)
Mutual labels:  fuzzy-logic
notebooks
Code examples for pyFTS
Stars: ✭ 40 (+100%)
Mutual labels:  fuzzy-logic
Fuzzy.jl
Fuzzy Inference System in julia
Stars: ✭ 19 (-5%)
Mutual labels:  fuzzy-logic

FASILL

FASILL

Fuzzy Aggregators and Similarities Into a Logic Language

FASILL is a Prolog-like first order language containing variables, function symbols, predicate symbols, constants and several (arbitrary) connectives to increase language expressiveness. FASILL uses connectives to combine/propagate truth values through the rules: conjunctive operators, disjunctive operators, and aggregation operators. Additionally, FASILL contains the truth values of a complete lattice equipped with a collection of connectives.

Programs

A FASILL program is a tuple <Π, R, L> where Π is a set of rules, R is a similarity relation between the elements of the signature Σ of Π, and L is a complete lattice.

Rules

A rule has the form A ← B, where A is an atomic formula called head and B, called body, is a well-formed formula (ultimately built from atomic formulas B1, ..., Bn, truth values of the lattice and connectives).

vanguardist(hydropolis) <- 0.9.
elegant(ritz)           <- 0.8.
close(hydropolis, taxi) <- 0.7.
good_hotel(X) <- @aver(elegant(X), @very(close(X, metro))).

Complete lattices

A complete lattice is a partially ordered set in which all subsets have both a supremum and an infimum.

All relevant components of each lattice can be encapsulated inside a Prolog file which must contain the definitions of a minimal set of predicates defining the set of valid elements (including special mentions to the "top" and "bottom" ones), the full or partial ordering established among them, as well as the repertoire of fuzzy connectives which can be used for their subsequent manipulation.

  • member/1 which is satisfied when being called with a parameter representing a valid truth degree.
  • members/1 which returns in one go a list containing the whole set of truth degrees.
  • bot/1 and top/1 answer with the top and bottom element of the lattice, respectively.
  • leq/2 models the ordering relation among all the possible pairs of truth degrees, and it is only satisfied when it is invoked with two elements verifying that the first parameter is equal or smaller than the second one.
  • Finally, given some fuzzy connectives of the form &label1 (conjunction), |label2 (disjunction) or @label3 (aggregation) with arities n1, n2 and n3 respectively, we must provide clauses defining the connective predicates and_label1/(n1+1), or_label2/(n2+1) and agr_label3/(n3+1), where the extra argument of each predicate is intended to contain the result achieved after the evaluation of the proper connective.
% Elements
member(X) :- number(X), 0 =< X, X =< 1.
members([0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]).

% Distance
distance(X,Y,Z) :- Z is abs(Y-X).

% Ordering relation
leq(X,Y) :- X =< Y.

% Supremum and infimum
bot(0.0).
top(1.0).

% Binary operations
and_prod(X,Y,Z) :- Z is X*Y.
and_godel(X,Y,Z) :- Z is min(X,Y).
and_luka(X,Y,Z) :- Z is max(X+Y-1,0).
or_prod(X,Y,Z) :- U1 is X*Y, U2 is X+Y, Z is U2-U1.
or_godel(X,Y,Z) :- Z is max(X,Y).
or_luka(X,Y,Z) :- Z is min(X+Y,1).

% Aggregators
agr_aver(X,Y,Z) :- Z is (X+Y)/2.
agr_very(X,Y) :- Y is X*X.

% Default connectives
tnorm(godel).
tconorm(godel).

Similarity relations

Given a domain U and a lattice L with a fixed t-norm, a similarity relation R is a fuzzy binary relation on U fulfilling the reflexive, symmetric and transitive properties.

FASILL takes a set of similarity equations f/n ~ g/n = r, where f and g are propositional variables or constants and r is an element of L, and generates a valid similarity relation by applying the reflexive, symmetric and transitive closures over the initial scheme.

elegant/1 ~ vanguardist/1 = 0.6.
metro ~ bus = 0.5.
bus ~ taxi = 0.4.
~tnorm = godel.

Installation

FASILL runs over SWI-Prolog. You can download the latest version of SWI-Prolog here.

Install on Linux

  1. Download or clone the FASILL repository: git clone https://github.com/jariazavalverde/fasill.git
  2. Enter the fasill folder: cd fasill
  3. Execute the install.sh bash script: sudo ./install.sh
  4. That's all! Now you can run FASILL by typing fasill in your terminal: fasill

Documentation

Built-in Predicates

FASILL has a large set of built-in predicates for arithmetic comparison, arithmetic evaluation, atom processing, control constructs, term comparison, term unification, type testing, list manipulation, etc.

See FASILL Predicate Reference

Weak Unification and Operational Semantics

As a logic language, FASILL inherits the concepts of substitution, unifier and most general unifier. Some of them are extended to cope with similarities. Concretely, the most general unifier is replaced by the concept of weak most general unifier and a weak unification algorithm is introduced to compute it.

The procedural semantics of FASILL is defined in a stepwise manner. First, an operational stage is introduced which proceeds similarly to SLD resolution in pure logic programming, returning an expression still containing values and connectives. Then, an interpretive stage evaluates these connectives and produces a final answer.

More about Operational Semantics

Refereces

You can find all the related bibliography into the file bibliography.bib.

License

Source code is released under the terms of the BSD 3-Clause License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].