FASILL documentation Source fasill_parser

Parser

This library provides predicates for parsing FASILL programs and goals.

The parser phase of FASILL rules and similarity schemes has been implemented using definite clause grammars (DCGs), whereas lattices are loaded as Prolog files. The FASILL parser is a completely new parser implemented in Prolog using DCGs, i.e., it is not just an appropriate parameterization of the Prolog parser since, although FASILL and Prolog syntax are very close, there are some significant differences, such as FASILL operators can be tagged (&godel, @aver, ...). Also, by controlling the parser process, it is possible a specific syntax error treatment or to cope with the symbolic syntax used for tuning purposes.

stream_to_list/2

stream_to_list( +Stream, ?List )

This predicate succeeds when List is the lists of characters reads from the stream Stream.

escape_atom/2

escape_atom( +Atom, ?Escape )

This predicate succeeds when Escape is the escape sequence of the atom Atom.

file_program/2

file_program( +Path, ?Program )

This predicate succeeds when file Path exists andit can be parsed as a FASILL program Program.

file_query/2

file_query( +Path, ?Goal )

This predicate succeeds when file Path exists and it can be parsed as a FASILL goal Goal.

file_similarity/2

file_similarity( +Path, ?Similarity )

This predicate succeeds when file +Path exists and it can be parsed as a FASILL similarity scheme Similarity.

file_testcases/2

file_testcases( +Path, ?Testcases )

This predicate succeeds when file Path exists and it can be parsed as a FASILL set of testcases Testcases.

parse_program/2

parse_program( +Chars, ?Program )

This predicate parses a FASILL program Program from a list of characters Chars.

parse_query/2

parse_query( +Chars, ?Goal )

This predicate parses a FASILL goal Goal from a list of characters Chars.

parse_similarity/2

parse_similarity( +Chars, ?Program )

This predicate parses a FASILL similarity scheeme Scheme from a list of characters Chars.

parse_testcases/2

parse_testcases( +Chars, ?Testcases )

This predicate parses a set of testcases Testcases from a list of characters Chars.

current_op/4

current_op( -Priority, -Associativity, -Operator, -Labelled )

Initial operator table.

next_priority/2

next_priority( +Priority, -NextPriority )

Gives the next priority to derivate an expression.

max_priority/1

max_priority( -MaxPriority )

Gives the higher priority to derivate an expression.