# #include "termorder.h"

This page has information from files termorder.h and termorder.c.

## Contents

- Public Routines
- Public Definitions
- Introduction

## Public Routines in File termorder.c

#### Index

assign_order_method | flatterm_compare_vr | kbo_weight | term_compare_vcp
flat_greater | greater_multiset_current_ordering | lrpo | term_compare_vr
flat_kbo_weight | init_kbo_weights | lrpo_multiset | term_greater
flat_lrpo | kbo | term_compare_ncv | term_order

#### Details

    void assign_order_method(Order_method method);

    BOOL flat_greater(Flatterm alpha, Flatterm beta, BOOL lex_order_vars);

    int flat_kbo_weight(Flatterm f);

    BOOL flat_lrpo(Flatterm s, Flatterm t, BOOL lex_order_vars);

    Ordertype flatterm_compare_vr(Flatterm a, Flatterm b);

This routine compares two flatterms. variable < nonvariable; within type, the order is by VARNUM and lexigocgaphic by symbol precedence. The range of return values is
{SAME_AS, GREATER_THAN, LESS_THAN, NOT_COMPARABLE}.

    BOOL greater_multiset_current_ordering(Term t1, Term t2);

    void init_kbo_weights(Plist weights);

Plist should be a list of terms, e.g., a=3, g=0. Symbols are written as constants; arity is deduced from the symbol table.

    BOOL kbo(Term alpha, Term beta, BOOL lex_order_vars);

Is alpha kbo-greater-than beta?

    int kbo_weight(Term t);

    BOOL lrpo(Term s, Term t, BOOL lex_order_vars);

This routine checks if Term s > Term t in the Lexicographic Recursive Path Ordering (LRPO), also known as Recursive Path Ordering with Status (RPOS).

Function symbols can have either multiset or left-to-right status (see symbols.c). If all symbols are multiset, this reduces to the Recursive Path Ordering (RPO). If all symbols are left-to-right, this reduces to Lexicographic Path Ordering (LPO).

    BOOL lrpo_multiset(Term t1, Term t2, BOOL lex_order_vars);

This routine

    Ordertype term_compare_ncv(Term t1, Term t2);

This routine compares two terms. The ordering is total: CONSTANT < COMPLEX < VARIABLE; within type, the order is by VARNUM and lexigocgaphic by SYMNUM. The range of return values is
{SAME_AS, GREATER_THAN, LESS_THAN}.

    Ordertype term_compare_vcp(Term t1, Term t2);

This routine compares two terms. The ordering is total: VARIABLE < CONSTANT < COMPLEX; within type, the order is by VARNUM and lexigocgaphic by SYMNUM. The range of return values is
{SAME_AS, GREATER_THAN, LESS_THAN}.

    Ordertype term_compare_vr(Term t1, Term t2);

This routine compares two terms. variable < nonvariable; within type, the order is by VARNUM and lexigocgaphic by symbol precedence. The range of return values is
{SAME_AS, GREATER_THAN, LESS_THAN, NOT_COMPARABLE}.

    BOOL term_greater(Term alpha, Term beta, BOOL lex_order_vars);

Is alpha > beta in the current term ordering? (LPR, RPO, KBO)

    Ordertype term_order(Term alpha, Term beta);

Compare two terms with the current term ordering (LPR, RPO, KBO) Return GREATER_THAN, LESS_THAN, or NOT_COMPARABLE.

## Public Definitions in File termorder.h

    /* Term ordering method */

    typedef enum { LRPO_METHOD,
    	       LPO_METHOD,
    	       RPO_METHOD,
    	       KBO_METHOD
                 } Order_method;

## Introduction