Phylanx Seminar
Friday the Phylanx team at LSU held a seminar on the current theory, techniques, and methodology used by the Phylanx project. During the lecture Hartmut laid out the scope of the challenge we are trying to solve and the three components of the project as we have them today. Additionally, he explained the grammar we are using to describe expression trees and the current and future role Python is playing in the project.
You can watch the seminar, as well as, follow along with the overheads and examples provided below.
Seminar Video
Link: https://youtu.be/o11VyxgbQII
Overhead Notes
Link: (.pdf)
Code Snippet 1
import phylanx
# A + B
A = phylanx.ast.identifier('A')
B = phylanx.ast.identifier('B')
expr = phylanx.ast.expression(A)
expr.append(phylanx.ast.operation(phylanx.ast.optoken.op_plus, B))
print(expr)
ast = phylanx.ast.generate_ast('A + B')
print(ast)
def visitor(ast):
print(ast)
return True
phylanx.ast.traverse(ast, visitor)
Link: (.py)
Code Snippet 2
import phylanx
# A + B
variables = {
'A' : phylanx.execution_tree.var(1.0),
'B' : phylanx.execution_tree.var(41.0)
}
p = phylanx.execution_tree.generate_tree('A + B', variables)
print(p.eval())
variables['B'].assign(66.0)
print(p.eval())
Link: (.py)