FASILL documentation Source fasill_substitution

Substitutions

This library provides basic predicates for substitutions manipulation. A substitution is a mapping from variables to FASILL terms.

The implementation of this library uses association lists (library(assoc)) to represent substitutions.

empty_substitution/1

empty_substitution( ?Substitution )

This predicate succeeds when Substitution is an empty substitution.

substitution_to_list/2

substitution_to_list( +Substitution, ?List )

This predicate translates Substitution to a list List of Variable-Value pairs.

list_to_substitution/2

list_to_substitution( +List, ?Substitution )

This predicate translates List of Variable-Value pairs into a substitution Substitution.

put_substitution/4

put_substitution( +SubstitutionIn, +Var, +Term, ?SubtitutionOut )

This predicate adds a new binding Var/Term to the substitution SubstitutionIn, producing the new substitution SubtitutionOut.

get_substitution/3

get_substitution( +Substitution, +Var, ?Term )

This predicate succeeds if Var-Term is a binding in Substitution.

init_substitution/2

init_substitution( +Goal, ?Substitution )

This predicate succeeds when Substitution is the initial substitution for the goal Goal, where each variable X in goal Goal is binded to itself (X/X).

compose/3

compose( +Substitution1, +Substitution2, ?SubstitutionOut )

This predicate composes both substitutions, Substitution1 and Substitution2 in SubstitutionOut.

apply/3

apply( +Substitution, +ExpressionIn, ?ExpressionOut )

This predicate applies the substitution Substitution to the expression ExpressionIn. ExpressionOut is the resulting expression.

fasill_print_substitution/1

fasill_print_substitution( +Substitution )

This predicate writes a FASILL substitution Substitution for the standard output.