Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 403
    • Issues 403
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1688
Closed
Open
Created Feb 17, 2007 by Robert Bernecky@rbeDeveloper

Shape-guarded expression isn't

Bugzilla Link 346
Created on Feb 17, 2007 21:14
Resolution FIXED
Resolved on Feb 19, 2007 17:48
Version 1.00beta
OS Linux
Architecture PC
Attachments lazy-dispatch-error.patch

Extended Description

I'm not sure if this is a SAC design bug or a SAC documentation bug, but I don't
see an obvious way around this problem. The following code complains about eqIIB
types,yet the offending function is guarded by dim() and shape() comparisons
that should ensure that eqIIB never gets called, except with arguments of
the same rank.
----------------------------cut here-------------------
use StdIO: all;
use Array: all;
inline bool sameIIB(int[*] x, int[*] y)
{ /* Non-scalar match non-scalar */
  z = dim(x) == dim(y);
 if (z)
  z = z & all(shape(x) == shape(y));
 if (z)
  z = z & with(0*shape(y) <= iv < shape(y))
  fold(&, true,
                 eqIIB(x[iv], y[iv]));
 return(z);
}
inline bool eqIIB(int x, int y)
{ return(x == y);
}
int main()
{
 x = genarray([2,3,4], 5);
 y = genarray([2,5], 6);
 print(sameIIB(x,y));
 return(0);
}
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking