Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding field names to DecaExpr types #131

Closed
jpfairbanks opened this issue Jul 26, 2023 · 0 comments
Closed

Adding field names to DecaExpr types #131

jpfairbanks opened this issue Jul 26, 2023 · 0 comments

Comments

@jpfairbanks
Copy link
Member

The current defn of the ADTs for decapodes language uses anonymous fields, which is fine when only Tyler had to write the structural recursion and it was an implementation detail. Now that we will be exporting the DecaExpr types as a core part of the interface, we should add field names

@data Model begin
  ACSetSpec
  Decapodes.DecaExpr
end

@data Term begin
  Var(name::Symbol)
  Lit(name::Symbol)
  Judge(v::Var, dim::Symbol, space::Symbol) # Symbol 1: Form0 Symbol 2: X
  AppCirc1(fs::Vector{Symbol}, arg::Term)
  App1(f::Symbol, x::Term)
  App2(f::Symbol, x::Term, y::Term)
  Plus(args::Vector{Term})
  Mult(args::Vector{Term})
  Tan(x::Term)
end

@data Equation begin
  Eq(x::Term, y::Term)
end

# A struct to store a complete Decapode
@as_record struct DecaExpr
  judgements::Vector{Judge}
  equations::Vector{Equation}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant