Skip to content

Commit 37c2b34

Browse files
committed
Latest notebook versions
1 parent c49d60d commit 37c2b34

File tree

1 file changed

+86
-36
lines changed

1 file changed

+86
-36
lines changed

JupyterKernelForLogtalkOverview.ipynb

Lines changed: 86 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,53 @@
236236
"forall(list::member(X, $Z), write(X)).\n"
237237
]
238238
},
239+
{
240+
"cell_type": "markdown",
241+
"id": "d47417af",
242+
"metadata": {},
243+
"source": [
244+
"We can also print the previous queries using the `%queries` line magic:"
245+
]
246+
},
247+
{
248+
"cell_type": "code",
249+
"execution_count": 7,
250+
"id": "0896d3f9",
251+
"metadata": {
252+
"vscode": {
253+
"languageId": "logtalk"
254+
}
255+
},
256+
"outputs": [
257+
{
258+
"data": {
259+
"text/plain": [
260+
"current_logtalk_flag(prolog_dialect,Backend),current_logtalk_flag(prolog_version,Version),\n",
261+
"current_logtalk_flag(version_data,VersionData),\n",
262+
"X=[1,2,3],list::append(X,[4,5,6],Z),\n",
263+
"current_logtalk_flag(unicode,Unicode),\n",
264+
"current_logtalk_flag(encoding_directive,EncodingDirective),\n",
265+
"jupyter::print_variable_bindings,\n",
266+
"forall(list::member(X,Z),write(X))."
267+
]
268+
},
269+
"metadata": {},
270+
"output_type": "display_data"
271+
},
272+
{
273+
"data": {
274+
"text/plain": [
275+
"\u001b[1mtrue"
276+
]
277+
},
278+
"metadata": {},
279+
"output_type": "display_data"
280+
}
281+
],
282+
"source": [
283+
"%queries"
284+
]
285+
},
239286
{
240287
"cell_type": "markdown",
241288
"id": "f5313ece",
@@ -248,7 +295,7 @@
248295
},
249296
{
250297
"cell_type": "code",
251-
"execution_count": 7,
298+
"execution_count": 9,
252299
"id": "566ce3e6",
253300
"metadata": {
254301
"tags": [],
@@ -285,7 +332,7 @@
285332
},
286333
{
287334
"cell_type": "code",
288-
"execution_count": 8,
335+
"execution_count": 10,
289336
"id": "a181ae15",
290337
"metadata": {
291338
"tags": [],
@@ -318,7 +365,7 @@
318365
},
319366
{
320367
"cell_type": "code",
321-
"execution_count": 9,
368+
"execution_count": 11,
322369
"id": "aca6b6dc",
323370
"metadata": {
324371
"tags": [],
@@ -354,7 +401,7 @@
354401
},
355402
{
356403
"cell_type": "code",
357-
"execution_count": 10,
404+
"execution_count": 12,
358405
"id": "be2a0e50",
359406
"metadata": {
360407
"vscode": {
@@ -381,7 +428,7 @@
381428
},
382429
{
383430
"cell_type": "code",
384-
"execution_count": 11,
431+
"execution_count": 13,
385432
"id": "6b6b19e4-3ed1-4190-b0b2-e00d739aa8f8",
386433
"metadata": {
387434
"vscode": {
@@ -413,7 +460,7 @@
413460
},
414461
{
415462
"cell_type": "code",
416-
"execution_count": 12,
463+
"execution_count": 14,
417464
"id": "16e1b545",
418465
"metadata": {
419466
"vscode": {
@@ -441,7 +488,7 @@
441488
},
442489
{
443490
"cell_type": "code",
444-
"execution_count": 13,
491+
"execution_count": 15,
445492
"id": "35670af2",
446493
"metadata": {
447494
"tags": [],
@@ -469,7 +516,7 @@
469516
},
470517
{
471518
"cell_type": "code",
472-
"execution_count": 14,
519+
"execution_count": 16,
473520
"id": "009dc51b",
474521
"metadata": {
475522
"vscode": {
@@ -516,7 +563,7 @@
516563
},
517564
{
518565
"cell_type": "code",
519-
"execution_count": 15,
566+
"execution_count": 17,
520567
"id": "5bd25431-1d38-4f4b-af30-cc4a23cef4e9",
521568
"metadata": {
522569
"vscode": {
@@ -556,7 +603,7 @@
556603
},
557604
{
558605
"cell_type": "code",
559-
"execution_count": 16,
606+
"execution_count": 18,
560607
"id": "50806251-0905-4bfa-aa4e-ad2754e7ddb7",
561608
"metadata": {
562609
"vscode": {
@@ -599,7 +646,7 @@
599646
},
600647
{
601648
"cell_type": "code",
602-
"execution_count": 17,
649+
"execution_count": 19,
603650
"id": "f4ebf82f",
604651
"metadata": {
605652
"vscode": {
@@ -623,7 +670,7 @@
623670
},
624671
{
625672
"cell_type": "code",
626-
"execution_count": 18,
673+
"execution_count": 20,
627674
"id": "182656ba",
628675
"metadata": {
629676
"vscode": {
@@ -655,7 +702,7 @@
655702
},
656703
{
657704
"cell_type": "code",
658-
"execution_count": 19,
705+
"execution_count": 21,
659706
"id": "3b90f60e-fd3a-49e8-afb1-14bcb7f83e60",
660707
"metadata": {
661708
"vscode": {
@@ -687,7 +734,7 @@
687734
},
688735
{
689736
"cell_type": "code",
690-
"execution_count": 20,
737+
"execution_count": 22,
691738
"id": "821d5f2d",
692739
"metadata": {
693740
"vscode": {
@@ -727,7 +774,7 @@
727774
},
728775
{
729776
"cell_type": "code",
730-
"execution_count": 21,
777+
"execution_count": 23,
731778
"id": "bb65b95d-cc52-4272-8902-2b03e3c1b0c6",
732779
"metadata": {
733780
"vscode": {
@@ -759,7 +806,7 @@
759806
},
760807
{
761808
"cell_type": "code",
762-
"execution_count": 22,
809+
"execution_count": 24,
763810
"id": "65c863bb-1799-4824-ad71-3f0f53a6536c",
764811
"metadata": {
765812
"vscode": {
@@ -791,7 +838,7 @@
791838
},
792839
{
793840
"cell_type": "code",
794-
"execution_count": 23,
841+
"execution_count": 25,
795842
"id": "11e55ba0",
796843
"metadata": {
797844
"vscode": {
@@ -802,8 +849,8 @@
802849
{
803850
"data": {
804851
"text/plain": [
805-
" Call: (1) fred::number_of_legs(_24440)\n",
806-
" Call: (2) number_of_legs(_24440)\n",
852+
" Call: (1) fred::number_of_legs(_24704)\n",
853+
" Call: (2) number_of_legs(_24704)\n",
807854
" Fact: (2) number_of_legs(4)\n",
808855
" Exit: (2) number_of_legs(4)\n",
809856
" Exit: (1) fred::number_of_legs(4)"
@@ -836,7 +883,7 @@
836883
},
837884
{
838885
"cell_type": "code",
839-
"execution_count": 24,
886+
"execution_count": 26,
840887
"id": "fc9f4f09",
841888
"metadata": {
842889
"vscode": {
@@ -870,7 +917,7 @@
870917
},
871918
{
872919
"cell_type": "code",
873-
"execution_count": 25,
920+
"execution_count": 27,
874921
"id": "83adb1d7-a886-4a51-aaa0-366a882c545c",
875922
"metadata": {
876923
"vscode": {
@@ -882,14 +929,14 @@
882929
"data": {
883930
"text/plain": [
884931
"% \n",
885-
"% tests started at 2023-09-25, 17:01:33\n",
932+
"% tests started at 2023-09-25, 19:58:11\n",
886933
"% \n",
887934
"% running tests from object tests\n",
888935
"% file: /Users/pmoura/logtalk/examples/ack/tests.lgt\n",
889936
"% \n",
890-
"% ack_1: success (in 0.001839000 seconds)\n",
891-
"% ack_2: success (in 0.064013000 seconds)\n",
892-
"% ack_3: success (in 0.268354000 seconds)\n",
937+
"% ack_1: success (in 0.001767000 seconds)\n",
938+
"% ack_2: success (in 0.064333000 seconds)\n",
939+
"% ack_3: success (in 0.270348000 seconds)\n",
893940
"% \n",
894941
"% 3 tests: 0 skipped, 3 passed, 0 failed (0 flaky)\n",
895942
"% completed tests from object tests\n",
@@ -904,7 +951,7 @@
904951
"% 1 out of 1 entity covered, 100.000000% entity coverage\n",
905952
"% 3 out of 3 clauses covered, 100.000000% clause coverage\n",
906953
"% \n",
907-
"% tests ended at 2023-09-25, 17:01:34\n",
954+
"% tests ended at 2023-09-25, 19:58:11\n",
908955
"% "
909956
]
910957
},
@@ -939,7 +986,7 @@
939986
},
940987
{
941988
"cell_type": "code",
942-
"execution_count": 26,
989+
"execution_count": 28,
943990
"id": "a4115b4e",
944991
"metadata": {
945992
"vscode": {
@@ -963,7 +1010,7 @@
9631010
},
9641011
{
9651012
"cell_type": "code",
966-
"execution_count": 27,
1013+
"execution_count": 29,
9671014
"id": "2af1675d",
9681015
"metadata": {
9691016
"vscode": {
@@ -1007,7 +1054,7 @@
10071054
},
10081055
{
10091056
"cell_type": "code",
1010-
"execution_count": 28,
1057+
"execution_count": 30,
10111058
"id": "d4c3e970",
10121059
"metadata": {
10131060
"tags": [],
@@ -1064,7 +1111,7 @@
10641111
},
10651112
{
10661113
"cell_type": "code",
1067-
"execution_count": 29,
1114+
"execution_count": 31,
10681115
"id": "f76cdf0e",
10691116
"metadata": {
10701117
"vscode": {
@@ -1121,7 +1168,7 @@
11211168
},
11221169
{
11231170
"cell_type": "code",
1124-
"execution_count": 30,
1171+
"execution_count": 32,
11251172
"id": "21bd5f19-ea65-4daa-9b6a-c4d7dbba9ec4",
11261173
"metadata": {
11271174
"vscode": {
@@ -1278,7 +1325,7 @@
12781325
},
12791326
{
12801327
"cell_type": "code",
1281-
"execution_count": 31,
1328+
"execution_count": 33,
12821329
"id": "40a56623",
12831330
"metadata": {
12841331
"vscode": {
@@ -1313,6 +1360,9 @@
13131360
"\n",
13141361
" %bindings\n",
13151362
" Prints variable bindings from previous queries\n",
1363+
" %queries\n",
1364+
" Prints previous queries\n",
1365+
"\n",
13161366
" %help\n",
13171367
" Prints documentation for all predicates from object jupyter\n",
13181368
"\n",
@@ -1356,7 +1406,7 @@
13561406
},
13571407
{
13581408
"cell_type": "code",
1359-
"execution_count": 32,
1409+
"execution_count": 34,
13601410
"id": "1b7fc919",
13611411
"metadata": {
13621412
"scrolled": true,
@@ -1630,7 +1680,7 @@
16301680
},
16311681
{
16321682
"cell_type": "code",
1633-
"execution_count": 33,
1683+
"execution_count": 35,
16341684
"id": "84fa034a",
16351685
"metadata": {
16361686
"vscode": {
@@ -1662,7 +1712,7 @@
16621712
},
16631713
{
16641714
"cell_type": "code",
1665-
"execution_count": 34,
1715+
"execution_count": 36,
16661716
"id": "15202e77-f240-424c-95e6-9d5609772d73",
16671717
"metadata": {
16681718
"vscode": {
@@ -1690,7 +1740,7 @@
16901740
},
16911741
{
16921742
"cell_type": "code",
1693-
"execution_count": 35,
1743+
"execution_count": 37,
16941744
"id": "6bf764e0",
16951745
"metadata": {
16961746
"vscode": {

0 commit comments

Comments
 (0)