Skip to content

interate sobre Set RoyalandLoyal

Contexto Customer

"invariant_Customer11" value="Set{1, 2, 3 }->iterate(i : Integer; sum : Integer = 0 | sum + i) = 6"

genera

invariant10 = context _Customer [invariant_Customer11]
invariant_Customer11 self = ((oclVal (Set [Val 1, Val 2, Val 3])  |->| iterate(\sum i -> (ocl sum) |+| (ocl i)) (Val 0))) |==| (oclInt 6)

la linea 580 es lo anterior

ACCELEO.hs:580:48: error:
    • Ambiguous type variable ‘b0’ arising from the literal ‘1’
      prevents the constraint ‘(GHC.Num.Num b0)’ from being solved.
      Probable fix: use a type annotation to specify what ‘b0’ should be.
      These potential instances exist:
        instance GHC.Num.Num Double -- Defined in ‘GHC.Float’
        instance GHC.Num.Num Int -- Defined in ‘GHC.Num’
        ...plus 8 instances involving out-of-scope types
        (use -fprint-potential-instances to see them all)
    • In the first argument of ‘Val’, namely ‘1’
      In the expression: Val 1
      In the first argument of ‘Set’, namely ‘[Val 1, Val 2, Val 3]’

ACCELEO.hs:580:90: error:
    • Ambiguous type variable ‘b0’ arising from a use of ‘|+|’
      prevents the constraint ‘(Super b0 Int)’ from being solved.
      Relevant bindings include i :: Val b0 (bound at ACCELEO.hs:580:85)
      Probable fix: use a type annotation to specify what ‘b0’ should be.
      These potential instance exist:
        instance [safe] Super Int Int -- Defined at OCLLibrary.hs:629:10
    • In the expression: (ocl sum) |+| (ocl i)
      In the first argument of ‘iterate’, namely
        ‘(\ sum i -> (ocl sum) |+| (ocl i))’
      In the second argument of ‘(|->|)’, namely
        ‘iterate (\ sum i -> (ocl sum) |+| (ocl i)) (Val 0)’