DiffMu / DiffPrivacyInferenceHs

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

resolve `sup(a,a)` #265

Closed ooovi closed 2 years ago

ooovi commented 2 years ago
julia> typecheck_hs_from_string("module L
       f(x::Matrix) = x+x
       f(x::Integer) = 2*x
       g(x) = f(x)
       end")
======================== Errors =====================

======================== End Errors =====================

---------------------------------------------------------------------------
Type:
{
|   (τ₁₃ @ s₈) -> τ₁₄
}

---------------------------------------------------------------------------
Constraints:
constr₄₁ : Type τ₅₂ is the supremum of types τ₅₁ and τ₅₁,
constr₉ : Function types 
  {
  |   (τ₁₃ @ s₈) -> τ₁₄
  }
 are required to exist among the following choices:
  - julia signature [Matrix{<:Any}]: 
    {
    |   - Matrix<n: τ₈, c: τ₉>[s₅ × s₄]{τ₅₁}
    |       @ 2.0
    |   --------------------------
    |    -> Matrix<n: τ₈, c: U>[s₅ × s₄]{τ₅₂}
    }

  - julia signature [Integer]: 
    {
    |   (Integer @ 2.0) -> Integer
    }
MxmUrw commented 2 years ago

We now get

---------------------------------------------------------------------------
Type:
{
|   (τ₁₃ @ s₈) -> τ₁₄
}

---------------------------------------------------------------------------
Constraints:
constr₉ : Function types 
  {
  |   (τ₁₃ @ s₈) -> τ₁₄
  }
 are required to exist among the following choices:
  - julia signature [Matrix{<:Any}]: 
    {
    |   - Matrix<n: τ₈, c: τ₉>[s₅ × s₄]{τ₄₇}
    |       @ 2.0
    |   --------------------------
    |    -> Matrix<n: τ₈, c: U>[s₅ × s₄]{τ₄₇}
    }

  - julia signature [Integer]: 
    {
    |   (Integer @ 2.0) -> Integer
    }
[]