Skip to content

question regarding comby's usage in direct-to-datalog #393

@0xalpharush

Description

@0xalpharush

Hi, I was trying to update the go call graph example to a more recent comby version. I came up with the following and omitted the meta DSL and omega engine:

comby 'func :[f](:[_]) {...:[[s]](...)...}' '`edges(:[f], :[s])`' -exclude-dir vendor -timeout 120 -d syncthing -stdout -newline-separated .go -lang .go -stats

This source code

func (c wireFormatConnection) Request(ctx context.Context, folder string, name string, blockNo int, offset int64, size int, hash []byte, weakHash uint32, fromTemporary bool) ([]byte, error) {
	name = norm.NFC.String(filepath.ToSlash(name))
	return c.Connection.Request(ctx, folder, name, blockNo, offset, size, hash, weakHash, fromTemporary)
}

rewrites to

`edges((c wireFormatConnection) Request(ctx context.Context, folder string, name string, blockNo int, offset int64, size int, hash []byte, weakHash uint32, fromTemporary bool) , String)`

How might one also capture that wireFormatConnection.Request invokes Connection.Request? More generally, I guess this is just asking how to grab all possible enumerations of matches and not just the first...

P.S. the paper is fascinating and the use of comby to extract datalog facts is ingenious!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions