Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 21 23:12

    pmoura on master

    Update `packs` tool to document… Update SVG diagrams (compare)

  • Oct 21 21:20

    pmoura on master

    Update the `packs` tool to writ… (compare)

  • Oct 21 21:12

    pmoura on master

    Fix `packs` tool instantiation … (compare)

  • Oct 21 17:36

    pmoura on master

    Fix dependency pack version com… (compare)

  • Oct 21 16:16

    pmoura on master

    Add "known issues" section to t… (compare)

  • Oct 21 14:14

    pmoura on master

    Prevent uninstalling a pack wit… (compare)

  • Oct 21 13:59

    pmoura on master

    Add `packs::update/3` predicate… (compare)

  • Oct 21 11:21

    pmoura on master

    Pack dependencies change to use… (compare)

  • Oct 21 10:07

    pmoura on master

    Print an error message when a r… (compare)

  • Oct 21 09:29

    pmoura on master

    Update `packs` tool to perform … (compare)

  • Oct 20 18:56

    pmoura on master

    Update `registries::update/0` r… (compare)

  • Oct 20 18:43

    pmoura on master

    Add `packs` tool `registries::d… (compare)

  • Oct 20 18:26

    pmoura on master

    Improve `packs` tool `registrie… (compare)

  • Oct 20 18:03

    pmoura on master

    Fix detection of up-to-date reg… (compare)

  • Oct 20 17:31

    pmoura on master

    Fix detection of up-to-date reg… (compare)

  • Oct 20 13:17

    pmoura on master

    Detect when a registry defined … (compare)

  • Oct 20 11:15

    pmoura on master

    Fix `packs` tool `registries::u… (compare)

  • Oct 19 22:27

    pmoura on master

    Fix `lgtdoc` tool bug when comp… (compare)

  • Oct 19 20:38

    pmoura on master

    Update `packs` tool to test sil… (compare)

  • Oct 19 18:44

    pmoura on master

    Print the path to the registry/… (compare)

A Man With A Clever Disguise
@ACleverDisguise
% depth: 1-node2_leaf
% depth: 1-node(leaf,10-value10,leaf)
% two3tree_insert_1: success (in 0.0004346110000001957 seconds)
% depth: 1-node3_leaf
% depth: 1-node(leaf,10-value10,leaf,20-value20,leaf)
% two3tree_insert_2: success (in 0.00041456800000005956 seconds)
Test output for a successful test.
Paulo Moura
@pmoura
And if you modify that clause to print the value of the debug flag?
A Man With A Clever Disguise
@ACleverDisguise

OK, so I'll give you two results. Here's the run with dbg/1 using information:

% depth: 1-node2_leaf
% on
% depth: 1-node(leaf,10-value10,leaf)
% two3tree_insert_1: success (in 0.00029869099999979554 seconds)
% depth: 1-node3_leaf
% depth: 1-node(leaf,10-value10,leaf,20-value20,leaf)
% two3tree_insert_2: success (in 0.0002536849999996704 seconds)

And here's the run with dbg/1 using debug on the same test results:

% on
% two3tree_insert_1: success (in 0.00033641100000014745 seconds)
% two3tree_insert_2: success (in 0.00021322999999995318 seconds)
The dbg/1 messages vanish if configured for debug but are visible if configured for information. In both cases the current_logtalk_flag (displayed using print_message/3 using information always) is on.
A Man With A Clever Disguise
@ACleverDisguise
Adding this to the tests object doesn't change anything:
    :- set_logtalk_flag(debug, on).
Paulo Moura
@pmoura
I think I have enough details from you to look into it. Possible tomorrow.
A Man With A Clever Disguise
@ACleverDisguise
It's not critical, just to be clear. I'm fine with using information class. I was just wondering if there was something I was missing.
Paulo Moura
@pmoura
Not clear at this time. Nothing obviously wrong. But I have meetings all day and can't look at it today.
A Man With A Clever Disguise
@ACleverDisguise
By the way, I'd just like to thank you for making lgtunit so civilized.
Most testing frameworks set my teeth on edge and make me avoid writing tests until I have to.
Paulo Moura
@pmoura
:-)
A Man With A Clever Disguise
@ACleverDisguise
lgtunit is a positive joy to work with by comparison.
Paulo Moura
@pmoura
Have you already played with lgtunit QuickCheck implementation?
A Man With A Clever Disguise
@ACleverDisguise
Played, yes. Not integrated into workflow.
Paulo Moura
@pmoura
And with generating Allure test reports?
A Man With A Clever Disguise
@ACleverDisguise
Once I get these 2-3 trees working, I will be using quickcheck tests formally.
And I have no idea what an Allure is, so ... no.
A Man With A Clever Disguise
@ACleverDisguise
Still not really helping since I don't know what an Allure is. To me Allure is a stat in an RPG. :D
Paulo Moura
@pmoura
Follow the bread crumps on that tweet for a demo...
A Man With A Clever Disguise
@ACleverDisguise
% 
% tests started at 2021-09-10, 23:37:45
% 
% running tests from object tests
% file: /home/michael/src/Playthings/Prolog/Logtalk/two3tree/tests.lgt
% 
% two3tree_new: success (in 0.0001542940000001103 seconds)
% two3tree_insert_1: success (in 0.00011241300000008891 seconds)
% two3tree_insert_2: success (in 0.0001055439999997354 seconds)
% two3tree_insert_3: success (in 0.0004157660000001506 seconds)
% two3tree_insert_4: success (in 0.0001568519999999296 seconds)
% two3tree_insert_5: success (in 0.00012946400000002356 seconds)
% two3tree_insert_6: success (in 0.00017247299999967325 seconds)
% two3tree_insert_7: success (in 0.00018493100000016582 seconds)
% 
% 8 tests: 0 skipped, 8 passed, 0 failed (0 flaky)
% completed tests from object tests
% 
% no code coverage information collected
% tests ended at 2021-09-10, 23:37:45
%
Just the kind of report I like to see. :D
Paulo Moura
@pmoura
👍
A Man With A Clever Disguise
@ACleverDisguise
I'm going to have to learn to power-use the debugger so that I can phase out dbg/1 messages.
Paulo Moura
@pmoura
You're missing cover(two3tree). clause in the testsobject.
(assuming that two3tree is the name of the object being tested)
A Man With A Clever Disguise
@ACleverDisguise
I had it commented out to declutter the display while there were errors showing.
Paulo Moura
@pmoura
Ah, ok.
A Man With A Clever Disguise
@ACleverDisguise
% 
% tests started at 2021-09-10, 23:42:04
% 
% running tests from object tests
% file: /home/michael/src/Playthings/Prolog/Logtalk/two3tree/tests.lgt
% 
% two3tree_new: success (in 0.0001543320000001458 seconds)
% two3tree_insert_1: success (in 0.00010364400000018037 seconds)
% two3tree_insert_2: success (in 0.00011810099999998158 seconds)
% two3tree_insert_3: success (in 0.0004362789999996508 seconds)
% two3tree_insert_4: success (in 0.00013675199999996224 seconds)
% two3tree_insert_5: success (in 0.00012492799999996862 seconds)
% two3tree_insert_6: success (in 0.00015842699999968346 seconds)
% two3tree_insert_7: success (in 0.0001948069999997415 seconds)
% 
% 8 tests: 0 skipped, 8 passed, 0 failed (0 flaky)
% completed tests from object tests
% 
% 
% clause coverage ratio and covered clauses per entity predicate
% 
% two3tree: empty/1 - 1/1 - (all)
% two3tree: insert/4 - 4/4 - (all)
% two3tree: new/1 - 1/1 - (all)
% two3tree: node4/1 - 0/1 - []
% two3tree: 6 out of 7 clauses covered, 85.714286% coverage
% 
% 1 entity declared as covered containing 7 clauses
% 1 out of 1 entity covered, 100.000000% entity coverage
% 6 out of 7 clauses covered, 85.714286% clause coverage
% 
% tests ended at 2021-09-10, 23:42:04
%
Better?
Paulo Moura
@pmoura
Good coverage. You can also easily generate a report for that. E.g. https://logtalk.org/diagrams/coverage_report.html
A Man With A Clever Disguise
@ACleverDisguise
Well, I'm very deliberately writing the tree code and the tests piecemeal, making sure that my tests are valid for each case before moving up the case ladder.
So the coverage is always going to be one or two clauses uncovered at most.
I wish I had more time to do Logtalk.
This is a whole lot more fun than C. About in the same league as Ada, but for entirely different reasons.
A Man With A Clever Disguise
@ACleverDisguise
I have one more case to contend with and then insertion is complete.
After that the low-hanging fruit of searches, iteration, etc. is in the cards. That should be trivial. (I've done most of the work needed in the tester helpers for validating the tree structure.)
Once that's done, the Big One: deletion.
That's a real pig of an operation in 2-3 trees.
A lot of libraries that do 2-3 trees don't do deletion, but I suspect it will be easier in a declarative language than an imperative.
Paulo Moura
@pmoura
It should be possible to evolve your implementation so that it would eventaully comply with the dictionaries library protocol.
A Man With A Clever Disguise
@ACleverDisguise
That is the plan.
:- object(two3tree, implements(dictionaryp),
                    extends(term)).
…
Paulo Moura
@pmoura
👍
Paulo Moura
@pmoura
Got a short break and tried to reproduce the bug with the dbg/1 calls. No luck so far. It works fine in my experiments.
With the debug flag turned off, I call tests::run. No debug messages. I turn of the flag, run the tests again and get debug messages. Tried with dbg/1 calls from cleanup/0, tests, and test auxiliary predicates.
Paulo Moura
@pmoura
No chance that you're typing set_prolog_flag instead of set_logtalk_flag?
A Man With A Clever Disguise
@ACleverDisguise
Nope. Definitely typing set_logtalk_flag. And using current_logtalk_flag to get the setting.
Paulo Moura
@pmoura
You will need to provide all the necessary code and steps to reproduce the issue then.