MultiField#

class loop_detection.MultiField(rules, name=None, max_card=inf, field=None)[source]#

Class for multifield rule representation (n-tuples)

Parameters:

rules (list) – list of rules for each field, can be Range or WildcardExpr instances

rules#
Type:

list

card#

cardinality of the rule

Type:

int

empty_flag#

1 if the rule is empty, 0 otherwise

Type:

int

Examples

>>> r1 = MultiField([Range(10, 20), Range(1, 3)])
>>> r2 = MultiField([Range(5, 15), WildcardExpr("0**1")])
__and__(other)[source]#

Returns the result of set intersection

Parameters:

other (MultiField) –

Return type:

MultiField

Examples

>>> r1 = MultiField([Range(10, 20), Range(1, 3)])
>>> r2 = MultiField([Range(5, 15), Range(1, 1)])
>>> r1 & r2
[10, 15], [1, 1]
__lt__(other)[source]#

Check if self is included in other (equality is accepted)

Parameters:

other (MultiField) –

Return type:

bool

Examples

>>> r1 = MultiField([Range(10, 20), Range(1, 3)])
>>> r2 = MultiField([Range(13, 15), Range(1, 1)])
>>> r2 < r1
True
pretty_print()[source]#

Print the rules with a field per line, with the name of the field