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

fix yoneda_cache support for DynamicACSets #27

Open
aaguinal opened this issue Sep 13, 2023 · 0 comments
Open

fix yoneda_cache support for DynamicACSets #27

aaguinal opened this issue Sep 13, 2023 · 0 comments

Comments

@aaguinal
Copy link
Contributor

I created a DynamicAcset using the following code:

@present SchAi2Thor(FreeSchema) begin
  ## Objects
  RoboGripper::Ob
  Thing::Ob  # all Null ∪ objects

  ## Attributes for Thing
  Label::AttrType
  IsOpen::AttrType
  IsBroken::AttrType
  IsCooked::AttrType
  IsSliced::AttrType
  IsToggled::AttrType
  IsDirty::AttrType
  IsFilledWithLiquid::AttrType
  IsUsedUp::AttrType

  thing_has_label::Attr(Thing, Label)
  thing_is_open::Attr(Thing, IsOpen)
  thing_is_broken::Attr(Thing, IsBroken)
  thing_is_cooked::Attr(Thing, IsCooked)
  thing_is_sliced::Attr(Thing, IsSliced)
  thing_is_toggled::Attr(Thing, IsToggled)
  thing_is_dirty::Attr(Thing, IsDirty)
  thing_is_filled_with_liquid::Attr(Thing, IsFilledWithLiquid)
  thing_is_used_up::Attr(Thing, IsUsedUp)

  PositionX::AttrType
  PositionY::AttrType
  PositionZ::AttrType
  thing_has_positionX::Attr(Thing, PositionX)
  thing_has_positionY::Attr(Thing, PositionY)
  thing_has_positionZ::Attr(Thing, PositionZ)

  ## Relations
  PartOfRel::Ob
  InRel::Ob  # Q: How do I enforce that things of a particular type can only be inside other things of certain types?

  is_holding::Hom(RoboGripper, Thing)
  is_part_of_l::Hom(PartOfRel, Thing)
  is_part_of_r::Hom(PartOfRel, Thing)
  is_in_l::Hom(InRel, Thing)
  is_in_r::Hom(InRel, Thing)
end

# specify types for attributes
const type_assignment = Dict(
  :Label => String,
  :IsOpen => Bool,
  :IsBroken => Bool,
  :IsCooked => Bool,
  :IsSliced => Bool,
  :IsToggled => Bool,
  :IsDirty => Bool,
  :IsFilledWithLiquid => Bool,
  :IsUsedUp => Bool,
  :PositionX => Float64,
  :PositionY => Float64,
  :PositionZ => Float64
)

# create dynamic acset object
const Ai2Thor = DynamicACSet("Ai2Thor", SchAi2Thor;
  type_assignment=type_assignment)

When I attempt to compute the representables for that ACSet, I get the following error:

ERROR: MethodError: no method matching yoneda_cache(::DynamicACSet)

Closest candidates are:
  yoneda_cache(::Type)
   @ AlgebraicRewriting ~/.julia/packages/AlgebraicRewriting/W29UX/src/rewrite/Representable.jl:41
  yoneda_cache(::Type, ::Any; clear, cache)
   @ AlgebraicRewriting ~/.julia/packages/AlgebraicRewriting/W29UX/src/rewrite/Representable.jl:41

Stacktrace:
 [1] top-level scope
   @ ~/Documents/Git/ai2thor-cset-experiments/julia/Ai2thorCsetProject/Ai2ThorWorld-Rules-CR.jl:114
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