FASILL documentation Source fasill_term

Term

This library provides basic predicates for terms manipulation.

Here, we use a ground representation to store and manipulate FASILL terms with Prolog, where:

  • variables are tagged as var/1 terms, whose only argument is an atom representing its identifier (e.g. a variable with identifier X is represented as var('X'));

  • numbers are tagged as num/1 terms, whose only argument is a number representing its value (e.g. a number with value 1 is represented as num(1));

  • and atoms and compound terms are tagged as term/2 terms, whose first argument is a term representing its functor and the second one is a list containing its tagged arguments (e.g. an atom p(a,X) is represented as term(p, [term(a,[]), var('X')])).

to_prolog/2

to_prolog( +FASILL, ?Prolog )

This predicate takes the ground object FASILL and returns the object Prolog in Prolog representation.

from_prolog/2

from_prolog( +Prolog, ?FASILL )

This predicate takes the Prolog object Prolog and returns the object FASILL in ground representation.

to_prolog_list/2

to_prolog_list( +FASILL, ?Prolog )

This predicate takes a FASILL list FASILL and returns the list Prolog in Prolog representation.

from_prolog_list/2

from_prolog_list( +Prolog, ?FASILL )

This predicate takes a Prolog list Prolog and returns the list FASILL in FASILL ground representation.

fasill_number/1

fasill_number( +Term )

This predicate succeeds when Term is a FASILL number.

fasill_integer/1

fasill_integer( +Term )

This predicate succeeds when Term is a FASILL integer.

fasill_float/1

fasill_float( +Term )

This predicate succeeds when Term is a FASILL float.

fasill_atom/1

fasill_atom( +Term )

This predicate succeeds when Term is a FASILL atom.

fasill_term/1

fasill_term( +Term )

This predicate succeeds when Term is a FASILL term.

fasill_var/1

fasill_var( +Term )

This predicate succeeds when Term is a FASILL variable.

fasill_ground/1

fasill_ground( +Term )

This predicate succeeds when Term is a FASILL ground term.

fasill_callable/1

fasill_callable( +Term )

This predicate succeeds when Term is a callable term.

fasill_list/1

fasill_list( +Term )

This predicate succeeds when Term is a list or variable.

fasill_connective/1

fasill_connective( +Term )

This predicate succeeds when Term is a connective.

fasill_term_variables/2

fasill_term_variables( +Term, ?Variables )

This predicate succeeds when Variables is a list made up by the variables of Term, in order of appearance and with repetition.

fasill_count_variables/2

fasill_count_variables( +Term, ?Variables )

This predicate succeeds when Variables is a list of pairs Var-N where Var is a variable and N is the number of occurrences of Var in the term Term.

max_variable/3

max_variable( +Expression, +Variable, ?Max )

This predicate succeeds when Max is the maximum natural number for wich Variable{Max} occurs in the expression Expression.

fasill_print_term/1

fasill_print_term( +Term )

This predicate writes a FASILL term for the standard output.