Skip to content

Composition of progams #108

@uncomputable

Description

@uncomputable

We should implement the composition of two finalized programs (1 → 1). How should this be done?

Approach 1: Unfinalize, combine, refinalize

Trivially correct. The type of witness nodes may change if there were any free variables (that were mapped to unit) in either program. This could confuse users.

Approach 2: Unify finalized programs

Potentially more efficient. Should work if the type pointers of both programs don't overlap (they come from different Contexts)? What are the conditions that this works? Do we refuse to unify if these conditions are not satisfied?

What happens if unification fails? AFAIU, the current algorithm tries to greedily unify until it gets stuck. Any bindings that are created in the process stay. Unification for composition should be atomic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions