C# Class Prolog.Term

Inheritance: IComparable
Exibir arquivo Open project: ianhorswill/UnityProlog Class Usage Examples

Private Properties

Property Type Description
AddBinding void
AlphaConvertArglist object[]
CanonicalizeWithExplicitBindingList object
CompareKeys int
CopyInstantiation object
IsQuoteNeeded bool
MakeFailEnumerator IEnumerable
MakeSucceedEnumerator IEnumerable
PredicateIndicatorExpression Structure
PredicateIndicatorExpression Structure
Structurify Structure
ToEnumerator IEnumerable
TypeNumber int
Unifiable bool
Unifiable bool
Unify IEnumerable
Unify bool
UnifyAndReturnCutState IEnumerable
UnifyArrays IEnumerable
UnifyArrays bool
UnifyArrays0 IEnumerable
UnifyArrays1 IEnumerable
UnifyArrays10 IEnumerable
UnifyArrays2 IEnumerable
UnifyArrays3 IEnumerable
UnifyArrays4 IEnumerable
UnifyArrays5 IEnumerable
UnifyArrays6 IEnumerable
UnifyArrays7 IEnumerable
UnifyArrays8 IEnumerable
UnifyArrays9 IEnumerable
UnifyArraysFast IEnumerable
UnifyWithAtomicConstant IEnumerable
UnifyWithAtomicConstant bool
UnifyWithStructure IEnumerable
UnifyWithStructure bool
UnifyWithTerm IEnumerable
UnifyWithTerm bool
Write void
WriteAndPossiblyParenthesize void

Public Methods

Method Description
Compare ( object term1, object term2 ) : int

Compares to prolog terms for purposes of sorting

CopyInstantiation ( object term ) : object

Recopy the term to replace bound variables with their values and alpha convert any unbound variables. This has the effect of removing interference between this term and the copy should one or the other have its bindings changed (either through unification or backtracking).

Deref ( object value ) : object

Returns value, unless it is a LogicVariable, in which case it returns the variable's value.

FindUninstantiatedVariable ( object term ) : LogicVariable

Returns first uninstantiated variable found in term.

Identical ( object a, object b ) : bool

True if the two objects are syntactically identical.

IsGround ( object term ) : bool

True if term contains no unbound variables

KeySort ( List terms, bool deleteDuplicates ) : void

Sorts arbitrary list of Prolog terms

KeySortPrologList ( object list, bool deleteDuplicates ) : object
Sort ( List terms, bool deleteDuplicates ) : void

Sorts arbitrary list of Prolog terms

SortPrologList ( object list, bool deleteDuplicates ) : object
ToStringInPrologFormat ( object value ) : string

Converts an arbitrary object to a string in Prolog format.

Private Methods

Method Description
AddBinding ( LogicVariable lv, object value, List &vars, List &values ) : void
AlphaConvertArglist ( object argList, List oldVars, LogicVariable newVars, PrologContext context, bool evalIndexicals ) : object[]

Substitutes occurances of newVars for all occurances of oldVars in argList. Returns new array, if substitutions were made, the original array if not. Original array is not modified

CanonicalizeWithExplicitBindingList ( object value, List vars, List values ) : object

Perform substitutions from var/values, and dereference any variables

CompareKeys ( object o1, object o2 ) : int
CopyInstantiation ( object term, LogicVariable>.Dictionary subs ) : object
IsQuoteNeeded ( Symbol s ) : bool
MakeFailEnumerator ( ) : IEnumerable

An iterator that always fails.

MakeSucceedEnumerator ( ) : IEnumerable
PredicateIndicatorExpression ( Structure term ) : Structure
PredicateIndicatorExpression ( Symbol functor, int arity ) : Structure
Structurify ( object term, string errorMessage ) : Structure
ToEnumerator ( bool succeed ) : IEnumerable
TypeNumber ( object term ) : int
Unifiable ( object v1, object v2 ) : bool
Unifiable ( object v1, object v2, List &vars, List &values ) : bool

Determine if V1 and V2 can be unified, without actually unifying them. If they are unifiable, determine the substitions that would be necessary to unify them.

Unify ( object v1, object v2 ) : IEnumerable
Unify ( object v1, object v2, PrologContext context ) : bool
UnifyAndReturnCutState ( object v1, object v2 ) : IEnumerable
UnifyArrays ( object a1, object a2 ) : IEnumerable

Unifies two arrays of variable length

UnifyArrays ( object a1, object a2, PrologContext context ) : bool

Unifies arrays using trailing

UnifyArrays0 ( object a1, object a2 ) : IEnumerable
UnifyArrays1 ( object a1, object a2 ) : IEnumerable
UnifyArrays10 ( object a1, object a2 ) : IEnumerable
UnifyArrays2 ( object a1, object a2 ) : IEnumerable
UnifyArrays3 ( object a1, object a2 ) : IEnumerable
UnifyArrays4 ( object a1, object a2 ) : IEnumerable
UnifyArrays5 ( object a1, object a2 ) : IEnumerable
UnifyArrays6 ( object a1, object a2 ) : IEnumerable
UnifyArrays7 ( object a1, object a2 ) : IEnumerable
UnifyArrays8 ( object a1, object a2 ) : IEnumerable
UnifyArrays9 ( object a1, object a2 ) : IEnumerable
UnifyArraysFast ( object a1, object a2, PrologContext context ) : IEnumerable
UnifyWithAtomicConstant ( object value ) : IEnumerable
UnifyWithAtomicConstant ( object value, PrologContext context ) : bool
UnifyWithStructure ( Structure value ) : IEnumerable
UnifyWithStructure ( Structure value, PrologContext context ) : bool
UnifyWithTerm ( Term term ) : IEnumerable
UnifyWithTerm ( Term term, PrologContext context ) : bool
Write ( StringBuilder s, object term ) : void
WriteAndPossiblyParenthesize ( StringBuilder s, object o ) : void

Method Details

Compare() public static method

Compares to prolog terms for purposes of sorting
public static Compare ( object term1, object term2 ) : int
term1 object
term2 object
return int

CopyInstantiation() public static method

Recopy the term to replace bound variables with their values and alpha convert any unbound variables. This has the effect of removing interference between this term and the copy should one or the other have its bindings changed (either through unification or backtracking).
public static CopyInstantiation ( object term ) : object
term object
return object

Deref() public static method

Returns value, unless it is a LogicVariable, in which case it returns the variable's value.
public static Deref ( object value ) : object
value object
return object

FindUninstantiatedVariable() public static method

Returns first uninstantiated variable found in term.
public static FindUninstantiatedVariable ( object term ) : LogicVariable
term object
return LogicVariable

Identical() public static method

True if the two objects are syntactically identical.
public static Identical ( object a, object b ) : bool
a object
b object
return bool

IsGround() public static method

True if term contains no unbound variables
public static IsGround ( object term ) : bool
term object
return bool

KeySort() public static method

Sorts arbitrary list of Prolog terms
public static KeySort ( List terms, bool deleteDuplicates ) : void
terms List
deleteDuplicates bool
return void

KeySortPrologList() public static method

public static KeySortPrologList ( object list, bool deleteDuplicates ) : object
list object
deleteDuplicates bool
return object

Sort() public static method

Sorts arbitrary list of Prolog terms
public static Sort ( List terms, bool deleteDuplicates ) : void
terms List
deleteDuplicates bool
return void

SortPrologList() public static method

public static SortPrologList ( object list, bool deleteDuplicates ) : object
list object
deleteDuplicates bool
return object

ToStringInPrologFormat() public static method

Converts an arbitrary object to a string in Prolog format.
public static ToStringInPrologFormat ( object value ) : string
value object
return string