LFLA LANGU AGE FOR LINEAR ALGEBRA TEAM OF GEEKS Zhiyuan Guo - - PowerPoint PPT Presentation

lfla
SMART_READER_LITE
LIVE PREVIEW

LFLA LANGU AGE FOR LINEAR ALGEBRA TEAM OF GEEKS Zhiyuan Guo - - PowerPoint PPT Presentation

LFLA LANGU AGE FOR LINEAR ALGEBRA TEAM OF GEEKS Zhiyuan Guo (Architect) Compiler, Code generation, Semantics Guitang Lan (Language Guru) Compiler, Semantic validation, Test case creation Jin Liang (Tester) Test


slide-1
SLIDE 1

LFLA

LANGU AGE FOR LINEAR ALGEBRA

slide-2
SLIDE 2

TEAM OF GEEKS

  • Zhiyuan Guo (Architect)
  • Compiler, Code generation, Semantics
  • Guitang Lan (Language Guru)
  • Compiler, Semantic validation, Test case creation
  • Jin Liang (Tester)
  • Test case creation, Testing automation, Documentation
  • Chenzhe Qian (Manager)
  • Python libraries, Code generation, Documentation
slide-3
SLIDE 3

INTRODUCTION

Why not MATLAB?

  • Is Vector same as Matrix?
  • What is Vector Space?
  • Why on earth need Matrix?

How about Python and others?

  • Set vector EQUALS matrix
  • Mixed math concepts with data

structures

slide-4
SLIDE 4

GOAL

Solve X with real math language in computer!

Math education Linear algebra programming

slide-5
SLIDE 5

TYPES

Featured Primitive Types

  • vector
  • matrix
  • vecspace
  • inspace
  • affspace

Common Primitive Type

  • var
slide-6
SLIDE 6

DECLARATIONS

var a = 1.2 vector b = [1,2] matrix c = [ 1,2;2,8;] vecspace d = L( [1,2],[3,4]) inspace e = inspace( {[1,0],[0,1]}, c) affspace f = affspace( b, d)

slide-7
SLIDE 7

FEATURED OPERATORS

  • Belongs @:
  • vector@ vecspace (affspace)
  • LieBracket [[ , ]]
  • [[matrix, matrix]]
  • Innerproduct << , >>
  • id<<vector,vector>>
  • Matrix action &
  • matrix & vector
slide-8
SLIDE 8

FEATURED BUILT-IN FUNCTION

  • dim(argument)
  • argument is vector, vecspace, inspace or affspace
  • basis(vecspace)
  • return a basis of the vecspace
  • solve(matrix, vector)
  • return an affspace
  • the solution set of linear equation m * x = v
slide-9
SLIDE 9

ARCHITECTURE

Source Code Scanner Parser AST Type Check Python AST Code Gen

Executable Python File

slide-10
SLIDE 10

AST

Expr

Literal

Id

Binop

Assign

Call

Expr Value

Stmts

Block

Expr

Declaration

If

For

While

Continue Break Return

slide-11
SLIDE 11

TRANSLATION ENVIRONMENT

  • Scope: symbol_table
  • Functions: func StringMap.t
  • Global_Variables: var StringMap.t
  • In_While: bool
  • In_For: bool

symbol_table:

  • Parent : symbol_table
  • Vars : var StringMap.t
slide-12
SLIDE 12

SCOPE RULE

  • Global Variable
  • from defined to end
  • Function Parameters
  • inside function
  • Local variables
  • valid inside the nearest block
slide-13
SLIDE 13

TYPE CHECK

  • Data Type
  • Variable declaration and assign
  • Array declaration and element assign
  • Function parameters pass
  • Function return type
  • Our function definition doesn’t declare function return type

explicitly, so compiler check return type.

  • Control flow
  • Conditional expression type check
slide-14
SLIDE 14

CODE GEN

slide-15
SLIDE 15

TESTING

  • Test Suites
  • Testing Cases
  • Automation Testing
  • Test Roles
slide-16
SLIDE 16

AUTOMATION TESTING

  • Fast feedback to the team
  • Free up time
  • A sense of confidence
  • An automated script
slide-17
SLIDE 17
slide-18
SLIDE 18

EXAMPLES

slide-19
SLIDE 19

HOW WE WORKED

slide-20
SLIDE 20

LESSONS LEARNED

  • Start EARLY
  • Meet regularly
  • Plan ahead
  • Communication
  • Collaboration is key! (Github, Google Drive, WeChat)
slide-21
SLIDE 21

DEMO

slide-22
SLIDE 22

THANK YOU