Abstract Syntax Tree (AST)
An Abstract Syntax Tree for a code snippet C is a tuple ⟨N ,T , X , f, d, l⟩ where
Every node except the root appears exactly once in all the lists of children.
Example of representation of Java function which finds object in array as AST
FastAI
FastAI is a deep learning library which provides practitioners with high-level components that can quickly and easily provide state-of-the-art results in standard deep learning domains, and provides researchers with low-level components that can be mixed and matched to build new approaches. It aims to do both things without substantial compromises in ease of use, flexibility, or performance.
Representation of Code snippet as set of triplets
Given a code snippet C and its AST ⟨N,T,X,s, δ, ϕ⟩, we denote by T Pairs the set of all pairs of AST terminal nodes (excluding pairs that contain a node and itself):
That is, C is represented as the set of triplets ⟨xs , p, xt⟩ such that xs and xt are values of AST terminals, and p is the AST path that connects them.
FastAI basics
FastAI text