#include "weight.h"

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

Contents


Public Routines in File weight.c

Index

clause_weightset_variable_weightterm_weight
init_weight_schemeset_weights_by_arity

Details


int clause_weight(Clause c);

void init_weight_scheme(Plist p);

void set_variable_weight(int weight);
Set the weight of all variables to the specified value.
void set_weights_by_arity(int arity, int weight);
Set weights of all symbols of the given arity to the specified value.
int term_weight(Term t);

Public Definitions in File weight.h


Introduction

This is a simple weighting package. Each symbol has a weight (default 1). The weight of a term is the sum of the weights of the subterms plus the weight of the root symbol. (There are no multipliers.) In this scheme, the negation symbol on literals is treated like any other symbol. The weight of a clause is the sum of the weights of the literals. (The OR symbols in clauses don't count.) Variables always have weight 1.

You give init_weight_scheme a list of weight assignments, for example,

weight(a, -5).
weight(g(x), 0).
weight(~x, -3).   % This is how to assign a weight to the negation symbol.
For non-constants, you have to include arguments so that the arity is known; those arguments are ignored, and the convention is to use x.

These activities are projects of the Mathematics and Computer Science Division of Argonne National Laboratory.