Skip to content

Spurious choice-points in frame.pl ? #50

Closed
@pmoura

Description

@pmoura

Are the implicit choice-points created by the following member/2 and select/3 calls required?

https://github.com/terminusdb/terminus-server/blob/df1ba67477fd0d32f9f4062eb18e62e2982b2117/library/frame.pl#L818-L819

The call to the realise_triples/4 predicate from the object_edges/3 predicate suggests that those calls could be replaced with memberchk/2 and selectchk/3. As the realise_triples/4 predicate is recursive, these choice-points accumulate.

P.S. Given sort/2 semantics, the object_edges/3 predicate can also be rewritten as:

object_edges(URI,Database,Edges) :-
    (   most_specific_type(URI,Class,Database),
        class_frame(Class,Database,Frame),
        realise_triples(URI,Frame,Database,Unsorted)
    ->  sort(Unsorted,Edges)
    % There is no type in the database, so it doesn't exist...
    ;   Edges=[]).

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