Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7854919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:14:06+00:00 2026-06-02T20:14:06+00:00

The XSB documentation has a paragraph about a heap data structure library, in the

  • 0

The XSB documentation has a paragraph about a heap data structure library, in the manual volume 2 Section 1.16.5. But I can’t find any sign of the library, either in the source, or the version history, or via Google. Any ideas if this library actually exists still?

The only lead I have is a library in logtalk which is apparently sourced from the same original. But I’m working with Prolog, so would have to port the logtalk back to Prolog.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:14:07+00:00Added an answer on June 2, 2026 at 8:14 pm

    You can use Logtalk in XSB (or any other supported Prolog compiler) as just another library and call its resources from plain Prolog or from Prolog modules. Regarding Logtalk’s heaps library support, it’s indeed based (as stated in its documentation) on original Richard O’Keefe code but enhanced to provide both minimum heaps and maximum heaps. The heaps interface can be browsed e.g. here:

    http://logtalk.org/library/heapp_0.html

    http://logtalk.org/library/heap_1.html

    A simple usage example:

    ?- heap(<)::(new(Heap), insert_all([1-a,4-d,2-b,5-e,6-f,3-c,7-g], Heap, UpdatedHeap), top(UpdatedHeap, Key, Value)).
    Heap = t(0, [], t),
    UpdatedHeap = t(7, [], t(1, a, t(3, c, t(5, e, t, t), t(4, d, t, t)), t(2, b, t(6, f, t, t), t(7, g, t, t)))),
    Key = 1,
    Value = a.
    
    ?- heap(>)::(new(Heap), insert_all([1-a,4-d,2-b,5-e,6-f,3-c,7-g], Heap, UpdatedHeap), top(UpdatedHeap, Key, Value)).
    Heap = t(0, [], t),
    UpdatedHeap = t(7, [], t(7, g, t(4, d, t(1, a, t, t), t(3, c, t, t)), t(6, f, t(2, b, t, t), t(5, e, t, t)))),
    Key = 7,
    Value = g.
    

    One caveat, however. The ::/2 calls offer performance compared with plain Prolog only when made from within Logtalk objects (or Logtalk categories). Queries at the top-level interpreter or from within a Prolog module are interpreted (meaning that the message is resolved at runtime) instead of compiled (where the message would be resolved at compile time). Whether the performance hit is meaningful for your application only you can tell (in Prolog compilers supporting term-expansion, is easy to reduce the performance hit for ::/2 calls from within modules).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

val xsa = List(1,2,3) val xsb = List(1,2,3) for (i <- 0 until xsa.size)
I have a question about the usage of map - Here is the piece
Hey guys, this should be quite simple to answer.... Im using XSB Prolog...trying to
I'm trying to iterate through an array of objects and recursively print out each
I'm having trouble with running a bare example. I'm using this to declare a
I'm creating an Updater program in C# for my PC game that basically sends

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.