FASILL documentation Source fasill_environment

Environment

This library provides predicates for environment manipulation (consulting programs, lattices and similarity relations).

A FASILL program is a tuple $\langle\Pi, \mathcal{R}, L\rangle$ where $\Pi$ is a set of rules, $\mathcal{R}$ is a similarity relation between the elements of the signature $\Sigma$ of $\Pi$, and $L$ is a complete lattice. A rule has the form $A \leftarrow \mathcal{B}$, where $A$ is an atomic formula called head and $\mathcal{B}$, called body, is a well-formed formula (built from atomic formulas $B_1, \dots, B_n$, truth values of the lattice and connectives).

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, the full or partial ordering established among them, as well as the repertoire of fuzzy connectives which can be used for their subsequent manipulation.

Given a domain $\mathcal{U}$ and a lattice $L$ with a fixed t-norm, a similarity relation $\mathcal{R}$ is a fuzzy binary relation on $\mathcal{U}$ fulfilling the reflexive, symmetric and transitive properties. FASILL takes a set of similarity equations $f/n \sim 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.

fasill_flag/3

fasill_flag( ?Flag, ?PossibleValues, ?CurrentValue )

This predicate succeeds when Flag is a FASILL flag, that can take the serie of values PossibleValues and with CurrentValue as the current value in the environment.

current_fasill_flag/2

current_fasill_flag( ?Flag, ?Value )

This predicate succeeds when Flag is a FASILL flag, and Value is the current value of the flag in the environment.

is_fasill_flag_value/2

is_fasill_flag_value( +Flag, +Value )

This predicate succeeds when Flag is a FASILL flag and Value is a possible value for the flag.

set_fasill_flag/2

set_fasill_flag( +Flag, +Value )

This predicate succeeds when Flag is a FASILL flag and Value is a possible value for the flag. This predicate has the side effect of changing the current value for the flag.

program_clause/2

program_clause( ?Indicator, ?Rule )

This predicate succeeds when Rule is a rule loaded into the environment whose indicator is Indicator.

program_rule_id/2

program_rule_id( +Rule, ?Id )

This predicate succeeds when Id is the identifier of the rule Rule.

program_consult/1

program_consult( +Path )

This predicate loads the FASILL program from the file +Path into the environment. This predicate cleans the previous rules.

program_import_prolog/1

program_import_prolog( +Path )

This predicate loads the Prolog program from the file Path into the environment. This predicate doesn't cleans the previous rules.

query_consult/2

query_consult( +Path, ?State )

This predicate loads the FASILL goal from the file Path into the environment and runs it.

program_has_predicate/1

program_has_predicate( ?Indicator )

This predicate succeeds when Indicator is the indicator of a predicate asserted in the program loaded in the current environment.

sort_rules_by_id/0

sort_rules_by_id

This predicate retracts all the rules from the current environment and asserts them ordered by the identifier.

fasill_print_rule/1

fasill_print_rule( +Rule )

This predicate writes a FASILL rule for the standard output.

compare_rule_id/3

compare_rule_id( ?Delta, +Rule1, +Rule2 )

This predicate succeeds when Delta is the ordering relation (<, > or =) for rules Rule1 and Rule2, compared by their identifiers.

lattice_tnorm/1

lattice_tnorm( ?Tnorm )

This predicate succeeds when Tnorm is the current t-norm asserted in the environment.

lattice_tconorm/1

lattice_tconorm( ?Tconorm )

This predicate succeeds when Tconorm is the current t-conorm asserted in the environment.

lattice_call_bot/1

lattice_call_bot( -Bot )

This predicate succeeds when Bot is the bottom member of the lattice loaded into the environment.

lattice_call_top/1

lattice_call_top( -Top )

This predicate succeeds when Top is the top member of the lattice loaded into the environment.

lattice_call_member/1

lattice_call_member( +Member )

This predicate succeeds when Member is a member of the lattice loaded into the environment.

lattice_call_members/1

lattice_call_members( -Members )

This predicate succeeds when -Members is a list of members of the lattice loaded into the environment.

lattice_call_members/2

lattice_call_members( +Constant, -Members )

This predicate succeeds when -Members is a list of members for a symbolic constant Constant in the lattice loaded into the environment.

lattice_call_exclude/1

lattice_call_exclude( +Exclude )

This predicate succeeds when -Exclude is a predicate indicator excluded (for tuning) in the lattice loaded into the environment.

lattice_call_leq/2

lattice_call_leq( +Member1, +Member2 )

This predicate succeeds when Member1 is less of equal than Member2 with the lattice loaded into the environment.

lattice_call_supremum/3

lattice_call_supremum( +Member1, +Member2, -Supremum )

This predicate succeeds when Member1 and Member2 are members of the lattice loaded into the environment, and Supremum is the supremum of both.

lattice_call_distance/3

lattice_call_distance( +Member1, +Member2, -Distance )

This predicate succeeds when Member1 and Member2 are members of the lattice loaded into the environment, and Distance is the distace between them.

lattice_call_connective/3

lattice_call_connective( +Name, +Arguments, ?Result )

This predicate succeeds when Result is the result of evaluate the connective Name with the arguments Arguments of the lattice loaded into the environment.

lattice_reduce_connective/3

lattice_reduce_connective( +Name, +TDs, ?Result )

This predicate succeeds when Result is the resulting value of reducing a list of truth degrees TDs applying the connective Name loaded in the lattice in the current environment.

lattice_consult/1

lattice_consult( +Path )

This predicate loads the lattice of the file Path into the environment. This predicate cleans the previous lattice.

similarity_tnorm/1

similarity_tnorm( ?Tnorm )

This predicate succeeds when Tnorm is the current t-norm asserted in the environment.

similarity_tconorm/1

similarity_tconorm( ?Tconorm )

This predicate succeeds when Tconorm is the current t-conorm asserted in the environment.

similarity_between/5

similarity_between( ?AtomA, ?AtomB, ?Arity, ?TD, ?Sym )

This predicate succeeds when AtomA/Arity is similar to AtomB/Arity with truth degree TD, using the current similarity relation in the environment.

similarity_retract/0

similarity_retract

This predicate succeeds and retracts all the clauses of similarity from the current environment.

similarity_consult/1

similarity_consult( +Path )

This predicate loads the similarities equations of the file Path into the environment. This predicate cleans the previous similarity relations.

similarity_closure/0

similarity_closure

This predicate computes the reflexive, symmetric and transitive closure of the similarity scheme asserted into the current environment.

testcases_consult/1

testcases_consult( +Path )

This predicate loads the set of FASILL test cases from the file Path into the environment. This predicate cleans the previous test cases.

current_fresh_variable_id/1

current_fresh_variable_id( ?Identifier )

This predicate stores the current identifier Identifier to be used in a fresh variable.

fresh_variable/1

fresh_variable( -Variable )

This predicate updates the current variable identifier and returns a fresh variable Variable.