Skip to content

Conversation

@rTreutlein
Copy link
Collaborator

It works but the code was generated by GPT-5 so there is likely a lot of cleanup we need to do before merging it.

All current tests pass but we should also try for a bit to breaks this / add new tests.

@rTreutlein rTreutlein force-pushed the compileoncall branch 4 times, most recently from 31ca8cc to 565eddd Compare November 13, 2025 11:19
@patham9 patham9 changed the title WIP: compile higher order predicates to specialized versions on call Compile higher order predicates to specialized versions on call Nov 20, 2025
@patham9
Copy link
Owner

patham9 commented Nov 20, 2025

@rTreutlein Can you please check https://github.com/patham9/PeTTa/pull/58/files#diff-cb5af532baee729d90cb1bf5860e10140973172aecb1e23cb8661a88c61400c1 can we allow that somehow without getting into infinite specialization recursions? It currently avoids it via stack.
UPDATE: SOLVED

@rTreutlein
Copy link
Collaborator Author

Alright i think this is ready to merge now.

@patham9 patham9 added this to the v0.8 milestone Nov 30, 2025
@patham9 patham9 added the enhancement New feature or request label Nov 30, 2025
Copy link
Owner

@patham9 patham9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to find a solution to allow function removal by tracking specializations. If a function is removed, all its specialization should vanish too. I don't think we need to re-compile functions a function is used in though, that complexity is usually not needed, also since users can still remove and add a function again if desired without introducing the unnecessary complexity. https://github.com/patham9/PeTTa/blob/main/examples/selfprog.metta

@patham9 patham9 modified the milestones: v0.8, v0.9 Dec 7, 2025
@rTreutlein
Copy link
Collaborator Author

Well we already have ho_specialization(HV, SpecName) linking the original name to the specializations. When removing HV we just need to check for that and remove all SpecNames.

@patham9
Copy link
Owner

patham9 commented Dec 11, 2025

Will continue working on this PR soon.

@patham9 patham9 modified the milestones: v0.9, v1.0 Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants