Goose  Diff

Differences From Artifact [f2825a91fc]:

  • File bs/sema/unify.h — part of check-in [edbc0edea1] at 2018-12-25 21:04:40 on branch trunk — Unification: implement "half-unification" sub algorithm which enumerates all possible solutions contained in an expression, counts their respective scores, and add dependency for any contained hole. (user: achavasse size: 2736)

To Artifact [89c8980d6a]:

  • File bs/sema/unify.h — part of check-in [d126da38f7] at 2018-12-26 00:48:18 on branch trunk — Implement hole half-unification. (user: achavasse size: 2282)

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
            }

        private:
            uint32_t m_complexity = 0;
            uint32_t m_uniqueHoles = 0;
    };

    class Unification
    {
        public:
            template< typename T >
            Unification( T&& expr, const UnificationScore& score ) :
                m_expr( forward< T >( expr ) ),
                m_score( score )
            {}

            const auto& expr() const { return m_expr; }
            const auto& score() const { return m_score; }
            auto& score() { return m_score; }

        private:
            Term m_expr;
            UnificationScore m_score;
    };

    using UniGen = Generator< Unification >;
    UniGen Unify( const Term& lhs, const Term& rhs, UnificationContext& context );

    UniGen HalfUnify( const Term& lhs, UnificationContext& context );
}

#endif







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|






63
64
65
66
67
68
69


















70
71
72
73
74
75
76
            }

        private:
            uint32_t m_complexity = 0;
            uint32_t m_uniqueHoles = 0;
    };



















    using UniGen = Generator< tuple< Term, UnificationScore, UnificationContext > >;
    UniGen Unify( const Term& lhs, const Term& rhs, UnificationContext& context );

    UniGen HalfUnify( const Term& lhs, UnificationContext& context );
}

#endif