Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask about the part of the code to mutilabel data #7

Open
Hinataee opened this issue Jul 30, 2024 · 1 comment
Open

Ask about the part of the code to mutilabel data #7

Hinataee opened this issue Jul 30, 2024 · 1 comment

Comments

@Hinataee
Copy link

Hinataee commented Jul 30, 2024

In thr Function Gia_EdgelistMultiLabel, I find something confusing:

            // MTL label (shared)
            if ( Vec_IntFind(vXors_vAdds_share, Gia_ObjId(p,pObj)) != -1 )
	            fprintf(f_class, "\"%d\": [0,0,1,0,0,0,", Gia_ObjId(p,pObj)-1); //xor and maj 
            else if ( Vec_IntFind(vAdds_copy, Gia_ObjId(p,pObj)) != -1 )
	            fprintf(f_class, "\"%d\": [0,0,0,1,0,0,", Gia_ObjId(p,pObj)-1); // maj
            else if ( Vec_IntFind(vXors_copy, Gia_ObjId(p,pObj)) != -1 )
	            fprintf(f_class, "\"%d\": [0,0,0,0,1,0,", Gia_ObjId(p,pObj)-1); // xor
            else
	            fprintf(f_class, "\"%d\": [0,1,0,0,0,0,", Gia_ObjId(p,pObj)-1); // and
            // root label
	    if (isAdds(Gia_ObjId(p,pObj), vAdds) == 0)
                fprintf(f_class, "0,1], ", Gia_ObjId(p,pObj)-1);  //xor
            else if(isAdds(Gia_ObjId(p,pObj), vAdds) == 1)
                fprintf(f_class, "1,0], ", Gia_ObjId(p,pObj)-1); // maj
            else
                fprintf(f_class, "0,0], ", Gia_ObjId(p,pObj)-1); // and
   	    }

Confusion1. Vec_IntFind(vAdds_copy, Gia_ObjId(p,pObj)) != -1
The variable vAdds_copy should be a vector of adders, in which every six elements consist a adder, including 3 input ids, 2 output ids(xor and maj) and one element that I haven't figured out what it means. So why does it mean the node in the vector is maj?
Confusion2.Vec_IntFind(vXors_copy, Gia_ObjId(p,pObj)) != -1
The variable vXors_copy should be a vector of xors, in which every four elements consist a xor, including 1 output ids and 3 input ids. So in my opinion, only the element with the index that can be divided by 4 is xor. Therefore it seems that we can use vXors_copy directly.
Confusion3.isAdds(Gia_ObjId(p,pObj), vAdds)
In the specific implementation of this function(isAdds), the return value 1 is labeled with "xor" and the return value 2 is labled with "maj", which is contradictory to the code comments here.
I don't know whether I get the newest version of the code. I need help to remove these confusion. Thanks.

@Sichao-Yang
Copy link

Sichao-Yang commented Aug 25, 2024

I agree with your saying and the comments in the code seems not correctly matchecd with the code and code in these three places should be modified.
dear authors, please comment on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants