polytracker.datalog

datalog classes

DatalogClause

class polytracker.datalog.DatalogClause(head: DatalogRule, body: DatalogRuleList)

Bases: object

__init__(head: DatalogRule, body: DatalogRuleList)
property val: str

DatalogFact

class polytracker.datalog.DatalogFact(name: str, start_pos: int, end_pos: int)

Bases: object

These are the facts that are created via the indexing of the input file GEN_ByteVal(0, 1) for the byte at location 0 in the file

__init__(name: str, start_pos: int, end_pos: int)
property val: str

DatalogFactDecl

class polytracker.datalog.DatalogFactDecl(byte: str)

Bases: object

These are the fact declarations from reading over file input bytes x –> start location y –> end location

__init__(byte: str)
property val: str

DatalogGrammar

class polytracker.datalog.DatalogGrammar(trace: ProgramTrace)

Bases: object

RULE_START = 'a'
__init__(trace: ProgramTrace)
extract_datalog_grammar()
property val: str

DatalogOutputDecl

class polytracker.datalog.DatalogOutputDecl(name: str)

Bases: object

Tells the datalog parser to output information about this production rule into csv. We always output <START>

__init__(name: str)
property val: str

DatalogRule

class polytracker.datalog.DatalogRule(name: str, start_char: str = 'a', end_char: str = 'a')

Bases: object

This is a datalog rule, an instance of some Name(a, b)

__init__(name: str, start_char: str = 'a', end_char: str = 'a')
property val: str

DatalogRuleDecl

class polytracker.datalog.DatalogRuleDecl(name: str)

Bases: object

This just forward declares a production rule by defining its arguemnts Name(a: number, b: number)

__init__(name: str)
property val: str

DatalogRuleList

class polytracker.datalog.DatalogRuleList(rule_sequence, start_term: int)

Bases: object

This is a list of datalog rules, which makes up the body of a datalog clause ex: Head(a, d) :- A(a, b), B(b, c) C(c, d).

__init__(rule_sequence, start_term: int)
property val: str

DatalogTrueFact

class polytracker.datalog.DatalogTrueFact(index)

Bases: object

__init__(index)
property end_char: str
property val: str

DatalogTrueFactDecl

class polytracker.datalog.DatalogTrueFactDecl

Bases: object

This is a fact that will always be true. This is our datalog equivalent of epislon productions

__init__()
property val: str

datalog functions

datalog_repl_match

polytracker.datalog.datalog_repl_match(matched_str) str

get_valid_datalog_name

polytracker.datalog.get_valid_datalog_name(name)