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')])
).
This predicate takes the ground object FASILL and returns the object Prolog in Prolog representation.
This predicate takes the Prolog object Prolog and returns the object FASILL in ground representation.
This predicate takes a FASILL list FASILL and returns the list Prolog in Prolog representation.
This predicate takes a Prolog list Prolog and returns the list FASILL in FASILL ground representation.
This predicate succeeds when Variables is a list made up by the variables of Term, in order of appearance and with repetition.
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.
This predicate succeeds when Max is the maximum natural number for wich Variable{Max} occurs in the expression Expression.
This predicate writes a FASILL term for the standard output.