From f12349993b8e76c804b8d5fb939d15a7080865b4 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 25 Aug 2016 01:26:11 -0500 Subject: [PATCH] python --- packages/python/examples/plot.yap | 2 + packages/python/yap_kernel/Untitled.ipynb | 26 - packages/python/yap_kernel/Untitled1.ipynb | 2344 -------------------- packages/python/yap_kernel/Untitled2.ipynb | 86 - packages/python/yap_kernel/__init__.py | 5 +- packages/python/yap_kernel/__main__.py | 15 +- packages/python/yap_kernel/images.py | 48 - packages/python/yap_kernel/install.py | 44 - packages/python/yap_kernel/jupyter.yap | 12 +- packages/python/yap_kernel/setup.py.cmake | 127 +- packages/python/yap_kernel/yap_kernel.py | 168 +- 11 files changed, 131 insertions(+), 2746 deletions(-) delete mode 100644 packages/python/yap_kernel/Untitled.ipynb delete mode 100644 packages/python/yap_kernel/Untitled1.ipynb delete mode 100644 packages/python/yap_kernel/Untitled2.ipynb delete mode 100644 packages/python/yap_kernel/images.py delete mode 100644 packages/python/yap_kernel/install.py diff --git a/packages/python/examples/plot.yap b/packages/python/examples/plot.yap index 7abc709e0..ec88a88b5 100644 --- a/packages/python/examples/plot.yap +++ b/packages/python/examples/plot.yap @@ -5,7 +5,9 @@ main :- Plt = matplotlib.pyplot, := import( Plt ), := ( + Plt.figure(figsize=(10,2.5)) Plt.plot([1,2,3,4]), Plt.ylabel(`some numbers`), Plt.show() ). + diff --git a/packages/python/yap_kernel/Untitled.ipynb b/packages/python/yap_kernel/Untitled.ipynb deleted file mode 100644 index b3ddc8cc6..000000000 --- a/packages/python/yap_kernel/Untitled.ipynb +++ /dev/null @@ -1,26 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "MetaKernel YAP 3", - "language": "prolog", - "name": "yap_kernel" - }, - "widgets": { - "state": {}, - "version": "1.1.2" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/packages/python/yap_kernel/Untitled1.ipynb b/packages/python/yap_kernel/Untitled1.ipynb deleted file mode 100644 index 27786b5ff..000000000 --- a/packages/python/yap_kernel/Untitled1.ipynb +++ /dev/null @@ -1,2344 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "A = OutArg2\n", - "yes\n", - "A = code_type_prolog_atom_start\n", - "yes\n", - "A = OutArg3\n", - "yes\n", - "A = module_has_attributes\n", - "yes\n", - "A = OutArg4\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/boot.yap\n", - "yes\n", - "A = RESOURCE ERROR- not enough code space\n", - "yes\n", - "A = generate_for_each_arg_in_block\n", - "yes\n", - "A = bind_attvar\n", - "yes\n", - "A = attributes_module\n", - "yes\n", - "A = time_file64\n", - "yes\n", - "A = cvt_to_swi_atts\n", - "yes\n", - "A = char_type_end_of_line\n", - "yes\n", - "A = instantiated_term_hash\n", - "yes\n", - "A = stream_position\n", - "yes\n", - "A = EName\n", - "yes\n", - "A = /usr/local/share/Yap/maplist.yap\n", - "yes\n", - "A = NameD\n", - "yes\n", - "A = get_module\n", - "yes\n", - "A = runtime\n", - "yes\n", - "A = skip_while_var\n", - "yes\n", - "A = single\n", - "yes\n", - "A = online\n", - "yes\n", - "A = file_type\n", - "yes\n", - "A = variable_names\n", - "yes\n", - "A = ~a: ~q ~q could not be found,\n", - "yes\n", - "A = ~a: syntax error ~s\n", - "yes\n", - "A = has_module_atts\n", - "yes\n", - "A = auto\n", - "yes\n", - "A = read_term_from_atom\n", - "yes\n", - "A = arrays.yap\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/hacks.yap\n", - "yes\n", - "A = EXISTENCE ERROR- ~w: ~w not an existing directory\n", - "yes\n", - "A = V0\n", - "yes\n", - "A = trace_command\n", - "yes\n", - "A = V1\n", - "yes\n", - "A = float_integer_part\n", - "yes\n", - "A = NDict\n", - "yes\n", - "A = V2\n", - "yes\n", - "A = with_stream\n", - "yes\n", - "A = ~w next\n", - "yes\n", - "A = nb_set_bit\n", - "yes\n", - "A = abort\n", - "yes\n", - "A = exit\n", - "yes\n", - "A = ./libpython\n", - "yes\n", - "A = signals.yap\n", - "yes\n", - "A = ~t~q~30+~33|~w~42|~q~n\n", - "yes\n", - "A = stack_dump_on_error\n", - "yes\n", - "A = call_count_data\n", - "yes\n", - "A = load_context\n", - "yes\n", - "A = /usr/local/share/Yap/shlib.yap\n", - "yes\n", - "A = table_entries\n", - "yes\n", - "A = VA\n", - "yes\n", - "A = erfc\n", - "yes\n", - "A = end\n", - "yes\n", - "A = FuncBase\n", - "yes\n", - "A = directive\n", - "yes\n", - "A = rename\n", - "yes\n", - "A = remove_when_declarations\n", - "yes\n", - "A = VF\n", - "yes\n", - "A = nth\n", - "yes\n", - "A = dynamic_predicate\n", - "yes\n", - "A = VH\n", - "yes\n", - "A = /Users/vsc/share/Yap/arg.prolog\n", - "yes\n", - "A = PERMISSION ERROR- ~w: cannot resize array ~w\n", - "yes\n", - "A = local\n", - "yes\n", - "A = Elem\n", - "yes\n", - "A = sort.yap\n", - "yes\n", - "A = mapnodes_list\n", - "yes\n", - "A = module_export_predicates\n", - "yes\n", - "A = at_same_line\n", - "yes\n", - "A = PERMISSION ERROR- cannot table procedure ~w\n", - "yes\n", - "A = W0\n", - "yes\n", - "A = IsClass\n", - "yes\n", - "A = ExtraArgs\n", - "yes\n", - "A = LArgs\n", - "yes\n", - "A = OutArgs\n", - "yes\n", - "A = W1\n", - "yes\n", - "A = Indices\n", - "yes\n", - "A = subsumes\n", - "yes\n", - "A = W2\n", - "yes\n", - "A = foldl2\n", - "yes\n", - "A = txt\n", - "yes\n", - "A = W3\n", - "yes\n", - "A = VT\n", - "yes\n", - "A = foldl3\n", - "yes\n", - "A = foldl4\n", - "yes\n", - "A = thread_statistics\n", - "yes\n", - "A = ~a:~d:0 ~a in ~a:~q/~d:\n", - "yes\n", - "A = nospy\n", - "yes\n", - "A = true_file_name\n", - "yes\n", - "A = mapargs_args\n", - "yes\n", - "A = exec_answers\n", - "yes\n", - "A = ypp_reconsult\n", - "yes\n", - "A = expect module declaration options, found ~w\n", - "yes\n", - "A = large\n", - "yes\n", - "A = semantics_indicator\n", - "yes\n", - "A = mutable\n", - "yes\n", - "A = attribute_goals\n", - "yes\n", - "A = update_semantics\n", - "yes\n", - "A = $qq_open\n", - "yes\n", - "A = qly.yap\n", - "yes\n", - "A = try_eq\n", - "yes\n", - "A = X0\n", - "yes\n", - "A = compile_expressions\n", - "yes\n", - "A = Exp1\n", - "yes\n", - "A = X1\n", - "yes\n", - "A = get_attrs\n", - "yes\n", - "A = prompt1\n", - "yes\n", - "A = Exp2\n", - "yes\n", - "A = X2\n", - "yes\n", - "A = X3\n", - "yes\n", - "A = PERMISSION ERROR- ~w: modifying dynamic procedure ~w\n", - "yes\n", - "A = show_env\n", - "yes\n", - "A = functionality\n", - "yes\n", - "A = mapargs.yap\n", - "yes\n", - "A = checker.yap\n", - "yes\n", - "A = match_named_args\n", - "yes\n", - "A = disable_interrupts\n", - "yes\n", - "A = foldl_\n", - "yes\n", - "A = mega\n", - "yes\n", - "A = Head\n", - "yes\n", - "A = set_value\n", - "yes\n", - "A = encoding\n", - "yes\n", - "A = occurrences_of_var\n", - "yes\n", - "A = predicate_property\n", - "yes\n", - "A = not_a_rational\n", - "yes\n", - "A = Stack Expansion\n", - "yes\n", - "A = mysql\n", - "yes\n", - "A = sign\n", - "yes\n", - "A = extra_info\n", - "yes\n", - "A = system_variable\n", - "yes\n", - "A = Y0\n", - "yes\n", - "A = Y1\n", - "yes\n", - "A = sumnodes\n", - "yes\n", - "A = atoms\n", - "yes\n", - "A = typein_module\n", - "yes\n", - "A = Y2\n", - "yes\n", - "A = Rest\n", - "yes\n", - "A = Last\n", - "yes\n", - "A = lcall2\n", - "yes\n", - "A = Y3\n", - "yes\n", - "A = thread_defaults\n", - "yes\n", - "A = comment_hook\n", - "yes\n", - "A = toplevel_print_anon\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/arithpreds.yap\n", - "yes\n", - "A = mutex_option\n", - "yes\n", - "A = directory_files\n", - "yes\n", - "A = /Users/vsc/share/Yap/charsio\n", - "yes\n", - "A = cpp -P -E -w -o \n", - "yes\n", - "A = bof\n", - "yes\n", - "A = identical_member\n", - "yes\n", - "A = going\n", - "yes\n", - "A = PERMISSION ERROR- ~w: cannot write to ~w\n", - "yes\n", - "A = read_sig\n", - "yes\n", - "A = :- dynamic ~q/~d.~n\n", - "yes\n", - "A = selectchk\n", - "yes\n", - "A = ~a: unbound variable\n", - "yes\n", - "A = __NB_setval__\n", - "yes\n", - "A = bom\n", - "yes\n", - "A = foreign\n", - "yes\n", - "A = Map\n", - "yes\n", - "A = utils.yap\n", - "yes\n", - "A = /Users/vsc/share/Yap/charsio.pl\n", - "yes\n", - "A = strip_module\n", - "yes\n", - "A = nb_beam_size\n", - "yes\n", - "A = +|-|?(Flag)\n", - "yes\n", - "A = Set\n", - "yes\n", - "A = msort\n", - "yes\n", - "A = cut_at\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/signals.yap\n", - "yes\n", - "A = debugger_show_context\n", - "yes\n", - "A = Max\n", - "yes\n", - "A = parallel_findfirst\n", - "yes\n", - "A = portray\n", - "yes\n", - "A = file_exists\n", - "yes\n", - "A = max_workers\n", - "yes\n", - "A = system_library\n", - "yes\n", - "A = 0x~16r~t ~16+ ~d~16+ ~q:\n", - "yes\n", - "A = /Users/vsc/share/Yap/apply_macros.yap\n", - "yes\n", - "A = 46bf534a\n", - "yes\n", - "A = alpha\n", - "yes\n", - "A = phrase\n", - "yes\n", - "A = generate_blocking_code\n", - "yes\n", - "A = in_use\n", - "yes\n", - "A = nb_queue\n", - "yes\n", - "A = erf\n", - "yes\n", - "A = freshen_variables\n", - "yes\n", - "A = current_choice_point\n", - "yes\n", - "A = logical\n", - "yes\n", - "A = global_trie\n", - "yes\n", - "A = code_type_upper\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/ground.yap\n", - "yes\n", - "A = exo_files\n", - "yes\n", - "A = last_opt\n", - "yes\n", - "A = bb_get\n", - "yes\n", - "A = declaration\n", - "yes\n", - "A = |------- restarted search for ~a\n", - "yes\n", - "A = dialect.yap\n", - "yes\n", - "A = cut_by\n", - "yes\n", - "A = current_stream\n", - "yes\n", - "A = compile_aux\n", - "yes\n", - "A = context_error\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/os.yap\n", - "yes\n", - "A = -->\n", - "yes\n", - "A = file_directory_name\n", - "yes\n", - "A = current_output\n", - "yes\n", - "A = socket_accept\n", - "yes\n", - "A = ~w is not a stream position\n", - "yes\n", - "A = NewTuple\n", - "yes\n", - "A = force\n", - "yes\n", - "A = char_type_period\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/packages/python/yap_kernel\n", - "yes\n", - "A = beautify_hidden_goal\n", - "yes\n", - "A = redo_freeze\n", - "yes\n", - "A = sequential\n", - "yes\n", - "A = \\+\n", - "yes\n", - "A = Macro\n", - "yes\n", - "A = $pop_input_context\n", - "yes\n", - "A = string_to_atomic\n", - "yes\n", - "A = heap\n", - "yes\n", - "A = python_export\n", - "yes\n", - "A = \\/\n", - "yes\n", - "A = find_nth0\n", - "yes\n", - "A = never\n", - "yes\n", - "A = groundness\n", - "yes\n", - "A = del_attrs\n", - "yes\n", - "A = ~w: ~w not implemented- ~w\n", - "yes\n", - "A = last\n", - "yes\n", - "A = loop_stream\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/checker.yap\n", - "yes\n", - "A = at_end_of_stream\n", - "yes\n", - "A = NewListOut1\n", - "yes\n", - "A = binary_stream\n", - "yes\n", - "A = ~a: ~q error\n", - "yes\n", - "A = $push_input_context\n", - "yes\n", - "A = attvar_residuals\n", - "yes\n", - "A = []\n", - "yes\n", - "A = \\=\n", - "yes\n", - "A = ?:?\n", - "yes\n", - "A = ~w is not a source sink term\n", - "yes\n", - "A = hwnd\n", - "yes\n", - "A = memory (total)~t~d bytes~35+~n\n", - "yes\n", - "A = verbose\n", - "yes\n", - "A = ~w is not a thread_create option\n", - "yes\n", - "A = get_string_code\n", - "yes\n", - "A = is_predicate_indicator\n", - "yes\n", - "A = ~a ~a in module ~a, ~d msec ~d bytes\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/packages/python/yap_kernel/python.prolog\n", - "yes\n", - "A = ~t~3f~12+ sec. systime~n\n", - "yes\n", - "A = to_upper\n", - "yes\n", - "A = NCs\n", - "yes\n", - "A = freeze_goal\n", - "yes\n", - "A = $messages\n", - "yes\n", - "A = RESOURCE ERROR- could not find a free stream\n", - "yes\n", - "A = acos\n", - "yes\n", - "A = c_cflags\n", - "yes\n", - "A = codes\n", - "yes\n", - "A = stop_creeping\n", - "yes\n", - "A = % Break (level ~w)~n\n", - "yes\n", - "A = nb_beam_empty\n", - "yes\n", - "A = throw\n", - "yes\n", - "A = There are no spy-points set.\n", - "yes\n", - "A = ~a: singleton variable~*c ~s in ~q.\n", - "yes\n", - "A = *->\n", - "yes\n", - "A = /dev/ttys002\n", - "yes\n", - "A = nogc\n", - "yes\n", - "A = arena_size\n", - "yes\n", - "A = language\n", - "yes\n", - "A = elif\n", - "yes\n", - "A = OUT OF TRAIL SPACE ERROR- ~w\n", - "yes\n", - "A = Total\n", - "yes\n", - "A = ./shlib.pl\n", - "yes\n", - "A = lcall\n", - "yes\n", - "A = file_name_variables\n", - "yes\n", - "A = system\n", - "yes\n", - "A = invalid operator specifier ~w\n", - "yes\n", - "A = garbage_collect\n", - "yes\n", - "A = dbload_get_space\n", - "yes\n", - "A = FullFileName\n", - "yes\n", - "A = db_reference\n", - "yes\n", - "A = io_error\n", - "yes\n", - "A = string_length\n", - "yes\n", - "A = ~d ticks, ~d accounted for (~d overhead)~n\n", - "yes\n", - "A = version_git\n", - "yes\n", - "A = invalid encoding ~w\n", - "yes\n", - "A = number_chars\n", - "yes\n", - "A = o__bj__\n", - "yes\n", - "A = load_foreign.yap\n", - "yes\n", - "A = GoalName\n", - "yes\n", - "A = reverse\n", - "yes\n", - "A = file_size\n", - "yes\n", - "A = nb_create\n", - "yes\n", - "A = unique\n", - "yes\n", - "A = byte\n", - "yes\n", - "A = source_exports\n", - "yes\n", - "A = ~w is not a syntax error handler\n", - "yes\n", - "A = prolog_file_type\n", - "yes\n", - "A = thread_cputime\n", - "yes\n", - "A = reconsulted\n", - "yes\n", - "A = NEl\n", - "yes\n", - "A = _Goal\n", - "yes\n", - "A = profile_data\n", - "yes\n", - "A = Codes\n", - "yes\n", - "A = unsigned_byte\n", - "yes\n", - "A = $init_prolog\n", - "yes\n", - "A = nb_queue_show\n", - "yes\n", - "A = /Users/vsc/share/Yap/occurs.yap\n", - "yes\n", - "A = raise_exception\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/dialect.yap\n", - "yes\n", - "A = invalid list of codes ~w\n", - "yes\n", - "A = upcase_text_to_codes\n", - "yes\n", - "A = /usr/local/share/Yap/libpython\n", - "yes\n", - "A = string_number\n", - "yes\n", - "A = verbose_file_search\n", - "yes\n", - "A = out_of_domain_option\n", - "yes\n", - "A = xdigit_weight\n", - "yes\n", - "A = invalid close option ~w\n", - "yes\n", - "A = profoff\n", - "yes\n", - "A = _F\n", - "yes\n", - "A = sinh\n", - "yes\n", - "A = shared_object_extension\n", - "yes\n", - "A = ~w invalid operator priority\n", - "yes\n", - "A = sig_break\n", - "yes\n", - "A = current_predicate\n", - "yes\n", - "A = mutex_unlock_all\n", - "yes\n", - "A = answer_trie_hashes\n", - "yes\n", - "A = toggle_static_predicates_in_use\n", - "yes\n", - "A = load_exofacts\n", - "yes\n", - "A = current_thread\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/preds.yap\n", - "yes\n", - "A = sub_var\n", - "yes\n", - "A = put_attr\n", - "yes\n", - "A = ____ypp_state\n", - "yes\n", - "A = unprocessed ~a ~w ~n\n", - "yes\n", - "A = type_error\n", - "yes\n", - "A = _ArgNames\n", - "yes\n", - "A = status\n", - "yes\n", - "A = char_type_alnum\n", - "yes\n", - "A = partition2\n", - "yes\n", - "A = sort\n", - "yes\n", - "A = expand_file_name\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/eval.yap\n", - "yes\n", - "A = scratch_goal\n", - "yes\n", - "A = with_mutex\n", - "yes\n", - "A = /dev/tty\n", - "yes\n", - "A = ~*|user provided data is: ~q\n", - "yes\n", - "A = element_types\n", - "yes\n", - "A = __\n", - "yes\n", - "A = current_input\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/load_foreign.yap\n", - "yes\n", - "A = debugger_print_options\n", - "yes\n", - "A = loaded\n", - "yes\n", - "A = detached\n", - "yes\n", - "A = batched\n", - "yes\n", - "A = _Name\n", - "yes\n", - "A = nb_delete\n", - "yes\n", - "A = loose\n", - "yes\n", - "A = executable\n", - "yes\n", - "A = InspRef\n", - "yes\n", - "A = stream_or_alias\n", - "yes\n", - "A = python_assign\n", - "yes\n", - "A = positive_integer\n", - "yes\n", - "A = foldl\n", - "yes\n", - "A = /Users/vsc/share/Yap/shlib\n", - "yes\n", - "A = nb_getval\n", - "yes\n", - "A = ~*|goal ~q \n", - "yes\n", - "A = exo\n", - "yes\n", - "A = exp\n", - "yes\n", - "A = context_variables\n", - "yes\n", - "A = style_check\n", - "yes\n", - "A = mapargs\n", - "yes\n", - "A = split_path_file\n", - "yes\n", - "A = reconsulting\n", - "yes\n", - "A = c_ldflags\n", - "yes\n", - "A = system_options\n", - "yes\n", - "A = mutex\n", - "yes\n", - "A = ~*|exception raised from ~a:~q:~d, ~a:~d:0: \n", - "yes\n", - "A = compiled_at\n", - "yes\n", - "A = loading_module\n", - "yes\n", - "A = append_\n", - "yes\n", - "A = ???\n", - "yes\n", - "A = downcase_text_to_atom\n", - "yes\n", - "A = answer_format\n", - "yes\n", - "A = ~n~t~3f~12+ sec. for ~w code, ~w stack, and ~w trail space overflows~n\n", - "yes\n", - "A = ~n~*c\n", - "yes\n", - "A = ***************\n", - "yes\n", - "A = portrayed\n", - "yes\n", - "A = quoted\n", - "yes\n", - "A = show_table\n", - "yes\n", - "A = callable\n", - "yes\n", - "A = including\n", - "yes\n", - "A = PERMISSION ERROR- ~w: modifying static procedure ~w\n", - "yes\n", - "A = variable_names_may_end_with_quotes\n", - "yes\n", - "A = meta_call\n", - "yes\n", - "A = Min\n", - "yes\n", - "A = flags.yap\n", - "yes\n", - "A = nb_heap_size\n", - "yes\n", - "A = open_expands_filename\n", - "yes\n", - "A = AOut1\n", - "yes\n", - "A = db_files\n", - "yes\n", - "A = dbprocess\n", - "yes\n", - "A = AOut2\n", - "yes\n", - "A = user_ouput\n", - "yes\n", - "A = start\n", - "yes\n", - "A = unhide_atom\n", - "yes\n", - "A = AOut3\n", - "yes\n", - "A = AOut4\n", - "yes\n", - "A = extract_head_for_block\n", - "yes\n", - "A = error: uninstantiated message ~w~n.\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/init.yap\n", - "yes\n", - "A = contains_term\n", - "yes\n", - "A = dbload_add_facts\n", - "yes\n", - "A = syntax_error\n", - "yes\n", - "A = delayed_goals\n", - "yes\n", - "A = Meta\n", - "yes\n", - "A = A choices g [N] ancestors~n\n", - "yes\n", - "A = [~p] \n", - "yes\n", - "A = user_c\n", - "yes\n", - "A = exodb_add_fact\n", - "yes\n", - "A = unlocked\n", - "yes\n", - "A = type\n", - "yes\n", - "A = get_byte\n", - "yes\n", - "A = ignore\n", - "yes\n", - "A = nonneg\n", - "yes\n", - "A = sub_string\n", - "yes\n", - "A = db_open\n", - "yes\n", - "A = at_end_of_line\n", - "yes\n", - "A = ~t~3f~12+ sec. runtime~n\n", - "yes\n", - "A = socket_close\n", - "yes\n", - "A = char\n", - "yes\n", - "A = $hacks\n", - "yes\n", - "A = as\n", - "yes\n", - "A = sumlist\n", - "yes\n", - "A = at\n", - "yes\n", - "A = win_menu\n", - "yes\n", - "A = get_depth_limit\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/grammar.yap\n", - "yes\n", - "A = ~s~w\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/sort.yap\n", - "yes\n", - "A = suffix\n", - "yes\n", - "A = put_module_atts\n", - "yes\n", - "A = startup.yss\n", - "yes\n", - "A = key_erased_statistics\n", - "yes\n", - "A = unsigned_char\n", - "yes\n", - "A = ~N% \n", - "yes\n", - "A = Acc\n", - "yes\n", - "A = start with ~w\n", - "yes\n", - "A = state\n", - "yes\n", - "A = csymf\n", - "yes\n", - "A = udi\n", - "yes\n", - "A = prolog_to_os_filename\n", - "yes\n", - "A = dynamic_update_array\n", - "yes\n", - "A = not_less_than_zero\n", - "yes\n", - "A = table_subgoal_solution_frames\n", - "yes\n", - "A = bp\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/arith.yap\n", - "yes\n", - "A = InArgs\n", - "yes\n", - "A = imports\n", - "yes\n", - "A = sig_usr1\n", - "yes\n", - "A = sig_usr2\n", - "yes\n", - "A = relative_to\n", - "yes\n", - "A = xfx\n", - "yes\n", - "A = xfy\n", - "yes\n", - "A = no_spy\n", - "yes\n", - "A = char_type_punct\n", - "yes\n", - "A = invalid static index ~w for array\n", - "yes\n", - "A = timeout_error\n", - "yes\n", - "A = `~s`\n", - "yes\n", - "A = extend\n", - "yes\n", - "A = cd\n", - "yes\n", - "A = none\n", - "yes\n", - "A = instance_property\n", - "yes\n", - "A = __NB_getval__\n", - "yes\n", - "A = assertz_static\n", - "yes\n", - "A = current_char_conversion\n", - "yes\n", - "A = gc_margin\n", - "yes\n", - "A = hacks.yap\n", - "yes\n", - "A = assert_static\n", - "yes\n", - "A = env_choice_point\n", - "yes\n", - "A = [ YAP (Darwin-15.5.0-x86_64): 2016-06-26T02:15:58@VITORs-MBP-2.lan ]\n", - "\n", - "yes\n", - "A = __PYVENV_LAUNCHER__\n", - "yes\n", - "A = bb_put\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/yio.yap\n", - "yes\n", - "A = python_build_tuple\n", - "yes\n", - "A = generate_body_for_block\n", - "yes\n", - "A = do_continuation\n", - "yes\n", - "A = was a multifile predicate \n", - "yes\n", - "A = string_codes\n", - "yes\n", - "A = atomic_concat\n", - "yes\n", - "A = meta\n", - "yes\n", - "A = in \n", - "yes\n", - "A = db\n", - "yes\n", - "A = kernel_compile_mode\n", - "yes\n", - "A = modified\n", - "yes\n", - "A = State\n", - "yes\n", - "A = SpecD\n", - "yes\n", - "A = simple\n", - "yes\n", - "A = /Users/vsc/share/Yap/maputils.pl\n", - "yes\n", - "A = memberchk\n", - "yes\n", - "A = list_of_qmarks\n", - "yes\n", - "A = ~q.~n\n", - "yes\n", - "A = boolean\n", - "yes\n", - "A = program_continuation\n", - "yes\n", - "A = attvar\n", - "yes\n", - "A = ArgNames\n", - "yes\n", - "A = Pos\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/corout.yap\n", - "yes\n", - "A = free_att\n", - "yes\n", - "A = generate_for_cond_in_block\n", - "yes\n", - "A = index\n", - "yes\n", - "A = char_type_lower\n", - "yes\n", - "A = code_type_csym\n", - "yes\n", - "A = saved_program\n", - "yes\n", - "A = try YAP path database ~a\n", - "yes\n", - "A = CallUndefined\n", - "yes\n", - "A = free_on_close\n", - "yes\n", - "A = exported\n", - "yes\n", - "A = ypp_define\n", - "yes\n", - "A = predmerge\n", - "yes\n", - "A = debugging\n", - "yes\n", - "A = Path\n", - "yes\n", - "A = UNEXPECTED SIGNAL: ~a\n", - "yes\n", - "A = extensionh\n", - "yes\n", - "A = mutex_lock\n", - "yes\n", - "A = nb_linkval\n", - "yes\n", - "A = rem\n", - "yes\n", - "A = flatten\n", - "yes\n", - "A = open\n", - "yes\n", - "A = help\n", - "yes\n", - "A = VAcc0\n", - "yes\n", - "A = get_char\n", - "yes\n", - "A = source_sink\n", - "yes\n", - "A = extensions\n", - "yes\n", - "A = AccOut\n", - "yes\n", - "A = close_list\n", - "yes\n", - "A = compose_message\n", - "yes\n", - "A = !------- failed.\n", - "yes\n", - "A = uninstantiation_error\n", - "yes\n", - "A = compile_term\n", - "yes\n", - "A = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc\n", - "yes\n", - "A = term_attvars\n", - "yes\n", - "A = fb\n", - "yes\n", - "A = Mod\n", - "yes\n", - "A = indexed\n", - "yes\n", - "A = ground\n", - "yes\n", - "A = else\n", - "yes\n", - "A = ~a: has argument ~a not consistent with type.\n", - "yes\n", - "A = VAccF\n", - "yes\n", - "A = s skip t fastskip~n\n", - "yes\n", - "A = Debug mode off.\n", - "yes\n", - "A = VAccI\n", - "yes\n", - "A = read_line_to_string\n", - "yes\n", - "A = atom_length\n", - "yes\n", - "A = clauses_not_together\n", - "yes\n", - "A = call_residue\n", - "yes\n", - "A = expects_dialect\n", - "yes\n", - "A = Dir\n", - "yes\n", - "A = Defaults\n", - "yes\n", - "A = exists\n", - "yes\n", - "A = selectlist\n", - "yes\n", - "A = ~w first\n", - "yes\n", - "A = assert\n", - "yes\n", - "A = part\n", - "yes\n", - "A = thread_join\n", - "yes\n", - "A = listing.yap\n", - "yes\n", - "A = nb_beam_peek\n", - "yes\n", - "A = nb_queue_replace\n", - "yes\n", - "A = Index\n", - "yes\n", - "A = fx\n", - "yes\n", - "A = swi_predicate_table\n", - "yes\n", - "A = nb_create_accumulator\n", - "yes\n", - "A = fy\n", - "yes\n", - "A = print_lines\n", - "yes\n", - "A = ~t~3f~12+ sec. for ~w garbage collections which collected ~d bytes~n\n", - "yes\n", - "A = ./libpython.dylib\n", - "yes\n", - "A = close_shared_object\n", - "yes\n", - "A = evaluable term\n", - "yes\n", - "A = checknodes_body\n", - "yes\n", - "A = nofileerrors\n", - "yes\n", - "A = check_dialect\n", - "yes\n", - "A = gc\n", - "yes\n", - "A = sig_stack_dump\n", - "yes\n", - "A = period\n", - "yes\n", - "A = uncutable\n", - "yes\n", - "A = volatile\n", - "yes\n", - "A = char_type_white\n", - "yes\n", - "A = Tail\n", - "yes\n", - "A = stream_property\n", - "yes\n", - "A = code_type_alnum\n", - "yes\n", - "A = dbload_from_stream\n", - "yes\n", - "A = mapnodes\n", - "yes\n", - "A = past\n", - "yes\n", - "A = /usr/local/share/Yap/shlib.pl\n", - "yes\n", - "A = message_to_string\n", - "yes\n", - "A = atom_number\n", - "yes\n", - "A = checknodes_list\n", - "yes\n", - "A = closed_stream\n", - "yes\n", - "A = continuation\n", - "yes\n", - "A = prolog_atom_start\n", - "yes\n", - "A = program space~t~d bytes~35+\n", - "yes\n", - "A = No leashing.\n", - "yes\n", - "A = toplevel_query\n", - "yes\n", - "A = current_host\n", - "yes\n", - "A = :- dynamic ~q:~q/~d.~n\n", - "yes\n", - "A = print_message_lines\n", - "yes\n", - "A = Sub\n", - "yes\n", - "A = python_index\n", - "yes\n", - "A = /Users/vsc/share/Yap/lists.prolog\n", - "yes\n", - "A = erase\n", - "yes\n", - "A = host_type\n", - "yes\n", - "A = off\n", - "yes\n", - "A = path\n", - "yes\n", - "A = real_path\n", - "yes\n", - "A = list_or_partial_list\n", - "yes\n", - "A = uninstall\n", - "yes\n", - "A = ./maputils.yap\n", - "yes\n", - "A = .~n\n", - "yes\n", - "A = dbload.yap\n", - "yes\n", - "A = ^ view subg ^^ view using~n\n", - "yes\n", - "A = dec10\n", - "yes\n", - "A = c_libs\n", - "yes\n", - "A = NewListOut\n", - "yes\n", - "A = sublist\n", - "yes\n", - "A = prolog_var_start\n", - "yes\n", - "A = c_cc\n", - "yes\n", - "A = id\n", - "yes\n", - "A = heapused\n", - "yes\n", - "A = Base\n", - "yes\n", - "A = incore\n", - "yes\n", - "A = variable_in_term\n", - "yes\n", - "A = unifiable\n", - "yes\n", - "A = if\n", - "yes\n", - "A = generate_message\n", - "yes\n", - "A = file_name_extension\n", - "yes\n", - "A = abolish\n", - "yes\n", - "A = freeze_choice_point\n", - "yes\n", - "A = python_do_import\n", - "yes\n", - "A = parallel\n", - "yes\n", - "A = mega_clause\n", - "yes\n", - "A = xml\n", - "yes\n", - "A = len\n", - "yes\n", - "A = creep_allowed\n", - "yes\n", - "A = prolog_initialization\n", - "yes\n", - "A = is\n", - "yes\n", - "A = Format\n", - "yes\n", - "A = python_command\n", - "yes\n", - "A = digit\n", - "yes\n", - "A = fact\n", - "yes\n", - "A = Action (\";\" for more choices, for exit)\n", - "yes\n", - "A = x86_64\n", - "yes\n", - "A = tabling.yap\n", - "yes\n", - "A = malformed message ~q: message level is unbound~n\n", - "yes\n", - "A = thread_exit\n", - "yes\n", - "A = stream_encoding\n", - "yes\n", - "A = open_pipe_streams\n", - "yes\n", - "A = write_attributes\n", - "yes\n", - "A = idb\n", - "yes\n", - "A = t_head\n", - "yes\n", - "A = static_array\n", - "yes\n", - "A = exclude\n", - "yes\n", - "A = BaseD\n", - "yes\n", - "A = python_assign_item\n", - "yes\n", - "A = size\n", - "yes\n", - "A = compile\n", - "yes\n", - "A = trace\n", - "yes\n", - "A = set_prolog_flag\n", - "yes\n", - "A = apple\n", - "yes\n", - "A = io_mode\n", - "yes\n", - "A = sumnodes_body\n", - "yes\n", - "A = array_to_python_view\n", - "yes\n", - "A = /Users/vsc/share/Yap/maputils\n", - "yes\n", - "A = ~t ~d max~73+~n\n", - "yes\n", - "A = file_no\n", - "yes\n", - "A = arithmetic_predicates\n", - "yes\n", - "A = char_type_cntrl\n", - "yes\n", - "A = editor\n", - "yes\n", - "A = float_underflow\n", - "yes\n", - "A = open_memory_file\n", - "yes\n", - "A = export_term\n", - "yes\n", - "A = $quasi_quotation\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/listing.yap\n", - "yes\n", - "A = \n", - "yes\n", - "A = garbage_collection\n", - "yes\n", - "A = copy_term_nat\n", - "yes\n", - "A = simplify_frozen\n", - "yes\n", - "A = time_file\n", - "yes\n", - "A = ~w is not yet implemented\n", - "yes\n", - "A = %15f\n", - "yes\n", - "A = EXISTENCE ERROR- ~w: ~w is an erased mutex\n", - "yes\n", - "A = CONSISTENCY ERROR (arguments not compatible with format)- ~w ~w\n", - "yes\n", - "A = TopLevel\n", - "yes\n", - "A = vsc_go\n", - "yes\n", - "A = ___ypp\n", - "yes\n", - "A = backquoted_string\n", - "yes\n", - "A = profile_reset\n", - "yes\n", - "A = create_thread\n", - "yes\n", - "A = xor\n", - "yes\n", - "A = Dict\n", - "yes\n", - "A = code_type_punct\n", - "yes\n", - "A = number_atom\n", - "yes\n", - "A = PERMISSION ERROR- ~w: cannot read from text stream ~w\n", - "yes\n", - "A = absolute_file_path\n", - "yes\n", - "A = module_transparent\n", - "yes\n", - "A = run_formats\n", - "yes\n", - "A = on_exception\n", - "yes\n", - "A = do_c_built_in\n", - "yes\n", - "A = uninstantiated message~n\n", - "yes\n", - "A = $win_insert_menu_item\n", - "yes\n", - "A = python_exports\n", - "yes\n", - "A = shlib\n", - "yes\n", - "A = ~a:~d:0, \n", - "yes\n", - "A = user_defined_directive\n", - "yes\n", - "A = immediate_update\n", - "yes\n", - "A = Public\n", - "yes\n", - "A = base\n", - "yes\n", - "A = clause\n", - "yes\n", - "A = message\n", - "yes\n", - "A = instance\n", - "yes\n", - "A = out_of_attvars_error\n", - "yes\n", - "A = Somehow the meta_predicate declarations of on_signal are subverted!\n", - "yes\n", - "A = ~a: ~q is not allowed in ~a ~q,\n", - "yes\n", - "A = compilation_failed\n", - "yes\n", - "A = catch_ball\n", - "yes\n", - "A = c_goal\n", - "yes\n", - "A = p_char_type\n", - "yes\n", - "A = asin\n", - "yes\n", - "A = python_field\n", - "yes\n", - "A = decrease_reference_count\n", - "yes\n", - "A = dynamic_code\n", - "yes\n", - "A = SoFar\n", - "yes\n", - "A = PVars\n", - "yes\n", - "A = statistics\n", - "yes\n", - "A = ls\n", - "yes\n", - "A = $set_source_module\n", - "yes\n", - "A = input\n", - "yes\n", - "A = EOT\n", - "yes\n", - "A = ~/prolog.ini\n", - "yes\n", - "A = underflow\n", - "yes\n", - "A = Apply\n", - "yes\n", - "A = _Entry\n", - "yes\n", - "A = callable goal\n", - "yes\n", - "A = call_tracer\n", - "yes\n", - "A = append_args\n", - "yes\n", - "A = python_assign_field\n", - "yes\n", - "A = big_numbers\n", - "yes\n", - "A = No matching predicate for ~w.\n", - "yes\n", - "A = scanl_\n", - "yes\n", - "A = unbind_attvar\n", - "yes\n", - "A = _LOOP_\n", - "yes\n", - "A = end_of_file_found_before_end_of_term\n", - "yes\n", - "A = /Users/vsc/share/Yap/arg.yap\n", - "yes\n", - "A = lib\n", - "yes\n", - "A = in_byte\n", - "yes\n", - "A = qload_file\n", - "yes\n", - "A = ------------------------------------------------------------------------~n\n", - "yes\n", - "A = inline\n", - "yes\n", - "A = unification_stack\n", - "yes\n", - "A = c creep e exit~n\n", - "yes\n", - "A = ~n~*c(\n", - "yes\n", - "A = ~n~*c)\n", - "yes\n", - "A = alarm\n", - "yes\n", - "A = ~w is not a stream property\n", - "yes\n", - "A = $foreign\n", - "yes\n", - "A = paren\n", - "yes\n", - "A = action\n", - "yes\n", - "A = udi.yap\n", - "yes\n", - "A = ttyskip\n", - "yes\n", - "A = code_type_lower\n", - "yes\n", - "A = user_error\n", - "yes\n", - "A = ListOut1\n", - "yes\n", - "A = or_frames\n", - "yes\n", - "A = streams\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/tabling.yap\n", - "yes\n", - "A = upcase_text_to_string\n", - "yes\n", - "A = unix\n", - "yes\n", - "A = thread_at_exit\n", - "yes\n", - "A = read_only\n", - "yes\n", - "A = ~n~*c;\n", - "yes\n", - "A = nb\n", - "yes\n", - "A = python_apply\n", - "yes\n", - "A = autoload\n", - "yes\n", - "A = variables_within_term\n", - "yes\n", - "A = Diff\n", - "yes\n", - "A = after environment variable expansion: ~s\n", - "yes\n", - "A = thread_set_default\n", - "yes\n", - "A = nl\n", - "yes\n", - "A = yes~n\n", - "yes\n", - "A = no\n", - "yes\n", - "A = goal_expansion\n", - "yes\n", - "A = syntax_error_term\n", - "yes\n", - "A = single_var\n", - "yes\n", - "A = banner\n", - "yes\n", - "A = PArgs\n", - "yes\n", - "A = ttyget\n", - "yes\n", - "A = statistics.yap\n", - "yes\n", - "A = nb_heap_peek\n", - "yes\n", - "A = current_reference_count\n", - "yes\n", - "A = \\=@=\n", - "yes\n", - "A = Spec\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/preddecls.yap\n", - "yes\n", - "A = /usr/local/share/Yap/charsio.yap\n", - "yes\n", - "A = prolog_flag_property\n", - "yes\n", - "A = mode\n", - "yes\n", - "A = $foreign_registered\n", - "yes\n", - "A = CONTEXT ERROR- ~w: ~w appeared in ~w\n", - "yes\n", - "A = tanh\n", - "yes\n", - "A = ok\n", - "yes\n", - "A = fail\n", - "yes\n", - "A = \n", - "\n", - "yes\n", - "A = on\n", - "yes\n", - "A = strict_iso\n", - "yes\n", - "A = op\n", - "yes\n", - "A = to_lower\n", - "yes\n", - "A = I2s\n", - "yes\n", - "A = load_absolute_foreign_files\n", - "yes\n", - "A = REPRESENTATION ERROR- ~w: expected character code\n", - "yes\n", - "A = attgoal_for_delays\n", - "yes\n", - "A = PERMISSION ERROR ~w- redefining module ~a in a different file\n", - "yes\n", - "A = descend_exp\n", - "yes\n", - "A = atomics_to_string\n", - "yes\n", - "A = entry\n", - "yes\n", - "A = ~n~*c|\n", - "yes\n", - "A = Break (level \n", - "yes\n", - "A = protected_exodb_add_fact\n", - "yes\n", - "A = ~w is not a supported stream encoding\n", - "yes\n", - "A = , line \n", - "yes\n", - "A = read_stream_to_terms\n", - "yes\n", - "A = \n", - "yes\n", - "A = !\n", - "yes\n", - "A = skip_unix_header\n", - "yes\n", - "A = compound\n", - "yes\n", - "A = code_type_white\n", - "yes\n", - "A = #\n", - "yes\n", - "A = $$$__expansion__ for maplist/3 0\n", - "yes\n", - "A = __builtin__\n", - "yes\n", - "A = There are no ancestors.\n", - "yes\n", - "A = $\n", - "yes\n", - "A = $$$__expansion__ for maplist/3 1\n", - "yes\n", - "A = %\n", - "yes\n", - "A = $$$__expansion__ for maplist/3 2\n", - "yes\n", - "A = $$$__expansion__ for maplist/3 3\n", - "yes\n", - "A = is_list_or_partial_list\n", - "yes\n", - "A = pi\n", - "yes\n", - "A = $$$__expansion__ for maplist/3 4\n", - "yes\n", - "A = newline creep a abort~n\n", - "yes\n", - "A = (\n", - "yes\n", - "A = )\n", - "yes\n", - "A = pl\n", - "yes\n", - "A = *\n", - "yes\n", - "A = trail\n", - "yes\n", - "A = read_term\n", - "yes\n", - "A = +\n", - "yes\n", - "A = ,\n", - "yes\n", - "A = -\n", - "yes\n", - "A = sig_hup\n", - "yes\n", - "A = .\n", - "yes\n", - "A = /\n", - "yes\n", - "A = 0\n", - "yes\n", - "A = I3s\n", - "yes\n", - "A = ProtoArgs\n", - "yes\n", - "A = atom_codes\n", - "yes\n", - "A = sum_list\n", - "yes\n", - "A = 2\n", - "yes\n", - "A = display_stack_info\n", - "yes\n", - "A = 4\n", - "yes\n", - "A = exo_interval\n", - "yes\n", - "A = thread_local\n", - "yes\n", - "A = ~d ticks, ~d accounted for~n\n", - "yes\n", - "A = symbol_char\n", - "yes\n", - "A = python_function\n", - "yes\n", - "A = map_to_dict\n", - "yes\n", - "A = export_list\n", - "yes\n", - "A = :\n", - "yes\n", - "A = ~*|% ~a:~w ~a ~d bytes in ~d seconds...~n\n", - "yes\n", - "A = ;\n", - "yes\n", - "A = <\n", - "yes\n", - "A = char_type_end_of_file\n", - "yes\n", - "A = load_answers\n", - "yes\n", - "A = =\n", - "yes\n", - "A = >\n", - "yes\n", - "A = ?\n", - "yes\n", - "A = @\n", - "yes\n", - "A = A\n", - "yes\n", - "A = B\n", - "yes\n", - "A = PERMISSION ERROR- ~w: cannot open file ~w\n", - "yes\n", - "A = call_and_retry_counter\n", - "yes\n", - "A = C\n", - "yes\n", - "A = D\n", - "yes\n", - "A = notrace\n", - "yes\n", - "A = E\n", - "yes\n", - "A = Arg\n", - "yes\n", - "A = F\n", - "yes\n", - "A = G\n", - "yes\n", - "A = length\n", - "yes\n", - "A = H\n", - "yes\n", - "A = PERMISSION ERROR- ~w: cannot read from binary stream ~w\n", - "yes\n", - "A = ascii\n", - "yes\n", - "A = FObj\n", - "yes\n", - "A = I\n", - "yes\n", - "A = K\n", - "yes\n", - "A = L\n", - "yes\n", - "A = ~a:~d:0: ~a while compiling.\n", - "yes\n", - "A = hide_atom\n", - "yes\n", - "A = M\n", - "yes\n", - "A = N\n", - "yes\n", - "A = O\n", - "yes\n", - "A = =..\n", - "yes\n", - "A = P\n", - "yes\n", - "A = Q\n", - "yes\n", - "A = system_foreign\n", - "yes\n", - "A = toupper\n", - "yes\n", - "A = R\n", - "yes\n", - "A = S\n", - "yes\n", - "A = acylic_term\n", - "yes\n", - "A = sys_export\n", - "yes\n", - "A = predsort\n", - "yes\n", - "A = T\n", - "yes\n", - "A = single_var_warnings\n", - "yes\n", - "A = U\n", - "yes\n", - "A = V\n", - "yes\n", - "A = W\n", - "yes\n", - "A = call_entry\n", - "yes\n", - "A = Entry\n", - "yes\n", - "A = X\n", - "yes\n", - "A = number_of_clauses\n", - "yes\n", - "A = Y\n", - "yes\n", - "A = Z\n", - "yes\n", - "A = call_cleanup\n", - "yes\n", - "A = [\n", - "yes\n", - "A = setup_call_cleanup\n", - "yes\n", - "A = ../os/edio.yap\n", - "yes\n", - "A = \\\n", - "yes\n", - "A = ]\n", - "yes\n", - "A = syntax_error_tokens\n", - "yes\n", - "A = ^\n", - "yes\n", - "A = _\n", - "yes\n", - "A = retry_counter\n", - "yes\n", - "A = `\n", - "yes\n", - "A = /Users/vsc/share/Yap/lists.pl\n", - "yes\n", - "A = a\n", - "yes\n", - "A = ~a:~w <- ~a:~w~n\n", - "yes\n", - "A = b\n", - "yes\n", - "A = ~a:~d:0 \n", - "yes\n", - "A = execute_continuation\n", - "yes\n", - "A = c\n", - "yes\n", - "A = d\n", - "yes\n", - "A = try_ground\n", - "yes\n", - "A = load_foreign_files\n", - "yes\n", - "A = nth_clause\n", - "yes\n", - "A = style_name\n", - "yes\n", - "A = e\n", - "yes\n", - "A = FRef\n", - "yes\n", - "A = f\n", - "yes\n", - "A = prolog_identifier_continue\n", - "yes\n", - "A = atomic_list_concat\n", - "yes\n", - "A = downcase_text_to_codes\n", - "yes\n", - "A = g\n", - "yes\n", - "A = cprolog\n", - "yes\n", - "A = socket_connect\n", - "yes\n", - "A = current_line_number\n", - "yes\n", - "A = h\n", - "yes\n", - "A = asinh\n", - "yes\n", - "A = i\n", - "yes\n", - "A = j\n", - "yes\n", - "A = k\n", - "yes\n", - "A = l\n", - "yes\n", - "A = get_mutable\n", - "yes\n", - "A = m\n", - "yes\n", - "A = stream\n", - "yes\n", - "A = n\n", - "yes\n", - "A = isnan\n", - "yes\n", - "A = system_library_directory\n", - "yes\n", - "A = o\n", - "yes\n", - "A = Spy point set on ~w:~w/~w.\n", - "yes\n", - "A = delete_import_module\n", - "yes\n", - "A = p\n", - "yes\n", - "A = q\n", - "yes\n", - "A = python_import\n", - "yes\n", - "A = r\n", - "yes\n", - "A = number\n", - "yes\n", - "A = s\n", - "yes\n", - "A = exports\n", - "yes\n", - "A = t\n", - "yes\n", - "A = output\n", - "yes\n", - "A = opt\n", - "yes\n", - "A = consult\n", - "yes\n", - "A = u\n", - "yes\n", - "A = v\n", - "yes\n", - "A = w\n", - "yes\n", - "A = message_hook\n", - "yes\n", - "A = EXISTENCE ERROR- ~w: prolog flag ~w is undefined\n", - "yes\n", - "A = x\n", - "yes\n", - "A = y\n", - "yes\n", - "A = z\n", - "yes\n", - "A = {\n", - "yes\n", - "A = proper_list\n", - "yes\n", - "A = messages.yap\n", - "yes\n", - "A = |\n", - "yes\n", - "A = }\n", - "yes\n", - "A = ~\n", - "yes\n", - "A = expand_exprs\n", - "yes\n", - "A = code_type_prolog_identifier_continue\n", - "yes\n", - "A = term_expansion\n", - "yes\n", - "A = not_loaded\n", - "yes\n", - "A = bounded\n", - "yes\n", - "A = substitute\n", - "yes\n", - "A = private\n", - "yes\n", - "A = truncate\n", - "yes\n", - "A = peek_code\n", - "yes\n", - "A = false\n", - "yes\n", - "A = python_check_args\n", - "yes\n", - "A = log\n", - "yes\n", - "A = PERMISSION ERROR- ~w: cannot access static procedure ~w\n", - "yes\n", - "A = sh\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/depth_bound.yap\n", - "yes\n", - "A = code_type_cntrl\n", - "yes\n", - "A = TupleL\n", - "yes\n", - "A = RESOURCE ERROR- too large an integer in absolute value\n", - "yes\n", - "A = reset_variables\n", - "yes\n", - "A = context_module\n", - "yes\n", - "A = YAPLIBDIR\n", - "yes\n", - "A = checklist\n", - "yes\n", - "A = new_memory_file\n", - "yes\n", - "A = permutation\n", - "yes\n", - "A = project_module\n", - "yes\n", - "A = /usr/local/share/Yap/libpython.dylib\n", - "yes\n", - "A = getenv\n", - "yes\n", - "A = current_atom\n", - "yes\n", - "A = representation_error\n", - "yes\n", - "A = thread_sleep\n", - "yes\n", - "A = defined_elsewhere\n", - "yes\n", - "A = stop_low_level_trace\n", - "yes\n", - "A = ord\n", - "yes\n", - "A = ypp_state\n", - "yes\n", - "A = inf\n", - "yes\n", - "A = running\n", - "yes\n", - "A = index_sub_term_search_depth\n", - "yes\n", - "A = NewTupleL\n", - "yes\n", - "A = OPERATING SYSTEM ERROR- ~w\n", - "yes\n", - "A = /init.yap\n", - "yes\n", - "A = nth_instance\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/yapor.yap\n", - "yes\n", - "A = abolish_all_tables\n", - "yes\n", - "A = no_effect\n", - "yes\n", - "A = int\n", - "yes\n", - "A = list_to_conj\n", - "yes\n", - "A = mmapped_array\n", - "yes\n", - "A = ./lists.yap\n", - "yes\n", - "A = ~*|exception raised from ~a:~q/~d, ~a:~d:0: \n", - "yes\n", - "A = protect.yap\n", - "yes\n", - "A = INTEGER OVERFLOW ERROR- ~w\n", - "yes\n", - "A = /usr/local/share/Yap/maputils.yap\n", - "yes\n", - "A = qsave_program\n", - "yes\n", - "A = Rest_of_part\n", - "yes\n", - "A = digit_weight\n", - "yes\n", - "A = |: \n", - "yes\n", - "A = nb_beam_close\n", - "yes\n", - "A = sync\n", - "yes\n", - "A = resource_error\n", - "yes\n", - "A = slice\n", - "yes\n", - "A = python_eval_term\n", - "yes\n", - "A = multifile\n", - "yes\n", - "A = read_write\n", - "yes\n", - "A = catch\n", - "yes\n", - "A = must_be_of_type\n", - "yes\n", - "A = ./python\n", - "yes\n", - "A = run\n", - "yes\n", - "A = same_length\n", - "yes\n", - "A = python_callable\n", - "yes\n", - "A = operator\n", - "yes\n", - "A = myddas\n", - "yes\n", - "A = export\n", - "yes\n", - "A = ~a: failed_processing syntax error term ~q\n", - "yes\n", - "A = reset\n", - "yes\n", - "A = read_option\n", - "yes\n", - "A = array\n", - "yes\n", - "A = already\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/os/chartypes.yap\n", - "yes\n", - "A = invalid static array type ~w\n", - "yes\n", - "A = recorda\n", - "yes\n", - "A = parallel_mode\n", - "yes\n", - "A = static_array_properties\n", - "yes\n", - "A = sandboxed\n", - "yes\n", - "A = nb_add_to_accumulator\n", - "yes\n", - "A = table\n", - "yes\n", - "A = source_mode\n", - "yes\n", - "A = /dev/null\n", - "yes\n", - "A = filled_in\n", - "yes\n", - "A = plain\n", - "yes\n", - "A = trace_help\n", - "yes\n", - "A = set_stream_position\n", - "yes\n", - "A = dialect\n", - "yes\n", - "A = Garbage Collections\n", - "yes\n", - "A = vv\n", - "yes\n", - "A = radix\n", - "yes\n", - "A = free_of_term\n", - "yes\n", - "A = recordz\n", - "yes\n", - "A = integer_rounding_function\n", - "yes\n", - "A = sumargs_args\n", - "yes\n", - "A = lsb\n", - "yes\n", - "A = global_trie_nodes\n", - "yes\n", - "A = float_fractional_part\n", - "yes\n", - "A = thread\n", - "yes\n", - "A = Slice\n", - "yes\n", - "A = pred_name\n", - "yes\n", - "A = char_type\n", - "yes\n", - "A = variable\n", - "yes\n", - "A = genarg\n", - "yes\n", - "A = operator_priority\n", - "yes\n", - "A = PERMISSION ERROR- ~w: trying to read from closed stream ~w\n", - "yes\n", - "A = location\n", - "yes\n", - "A = write_depth\n", - "yes\n", - "A = code_type_prolog_prolog_symbol\n", - "yes\n", - "A = no_skip\n", - "yes\n", - "A = /Users/vsc/github/yap-6.3/pl/error.yap\n", - "yes\n", - "A = sumargs\n", - "yes\n", - "A = YList\n", - "yes\n", - "A = python_item\n", - "yes\n", - "A = DefUninstall\n", - "yes\n", - "A = display" - ] - } - ], - "source": [ - "current_atom(" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true, - "run_control": { - "marked": true - } - }, - "outputs": [], - "source": [ - "X := plot()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": " YAP-6.3", - "language": "prolog", - "name": "yap_kernel" - }, - "language_info": { - "codemirror_mode": { - "name": "prolog", - "version": 2 - }, - "file_extension": ".yap", - "help_links": [ - { - "text": "MetaKernel Magics", - "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" - } - ], - "mimetype": "text/prolog", - "name": "text", - "pygments_lexer": "prolog", - "version": "0.0.1" - }, - "latex_envs": { - "bibliofile": "biblio.bib", - "cite_by": "apalike", - "current_citInitial": 1, - "eqLabelWithNumbers": true, - "eqNumInitial": 0 - }, - "nav_menu": {}, - "toc": { - "navigate_menu": true, - "number_sections": true, - "sideBar": true, - "threshold": 6, - "toc_cell": false, - "toc_section_display": "block", - "toc_window_display": false - }, - "widgets": { - "state": {}, - "version": "1.1.2" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/packages/python/yap_kernel/Untitled2.ipynb b/packages/python/yap_kernel/Untitled2.ipynb deleted file mode 100644 index e255bd479..000000000 --- a/packages/python/yap_kernel/Untitled2.ipynb +++ /dev/null @@ -1,86 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "code_folding": [], - "collapsed": false - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "No (more) answers\n" - ] - } - ], - "source": [ - ":= import(mathplot).\n", - "X := plot([1,2,3])" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": " YAP-6.3", - "language": "prolog", - "name": "yap_kernel" - }, - "language_info": { - "codemirror_mode": { - "name": "prolog", - "version": 2 - }, - "file_extension": ".yap", - "help_links": [ - { - "text": "MetaKernel Magics", - "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" - } - ], - "mimetype": "text/prolog", - "name": "text", - "pygments_lexer": "prolog", - "version": "0.0.1" - }, - "latex_envs": { - "bibliofile": "biblio.bib", - "cite_by": "apalike", - "current_citInitial": 1, - "eqLabelWithNumbers": true, - "eqNumInitial": 0 - }, - "nav_menu": {}, - "toc": { - "navigate_menu": true, - "number_sections": true, - "sideBar": true, - "threshold": 6, - "toc_cell": false, - "toc_section_display": "block", - "toc_window_display": false - }, - "widgets": { - "state": { - "09b21d398da9424d94cf3c8e51054154": { - "views": [] - }, - "369de2fecba34468a7c9cf64076bac60": { - "views": [] - }, - "7f758a42f83c469882761606f7f8133e": { - "views": [] - }, - "c028bb350ed6424eb48a02762907868d": { - "views": [] - } - }, - "version": "1.1.2" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/packages/python/yap_kernel/__init__.py b/packages/python/yap_kernel/__init__.py index ae45c83a8..78c99c56c 100644 --- a/packages/python/yap_kernel/__init__.py +++ b/packages/python/yap_kernel/__init__.py @@ -1,3 +1,2 @@ -"""A Prolog kernel for Jupyter""" - -__version__ = '0.0.1' +from ipykernel._version import version_info, __version__, kernel_protocol_version_info, kernel_protocol_version +from ipykernel.connect import * diff --git a/packages/python/yap_kernel/__main__.py b/packages/python/yap_kernel/__main__.py index 61e1af4e6..faba9e882 100644 --- a/packages/python/yap_kernel/__main__.py +++ b/packages/python/yap_kernel/__main__.py @@ -1,6 +1,9 @@ -try: - from ipykernel.kernelapp import IPKernelApp -except ImportError: - from IPython.kernel.zmq.kernelapp import IPKernelApp -from .kernel import YAPKernel -IPKernelApp.launch_instance(kernel_class=YAPKernel) +import sys + + +import ipdb; ipdb.set_trace() + + +if __name__ == '__main__': + from yap_kernel import kernelapp as app + app.launch_new_instance() diff --git a/packages/python/yap_kernel/images.py b/packages/python/yap_kernel/images.py deleted file mode 100644 index f7abfbb12..000000000 --- a/packages/python/yap_kernel/images.py +++ /dev/null @@ -1,48 +0,0 @@ -import base64 -import imghdr -import os - -#from IPython. - -_TEXT_SAVED_IMAGE = "yap_kernel: saved image data to:" - -image_setup_cmd = """ -display () { - TMPFILE=$(mktemp ${TMPDIR-/tmp}/yap_kernel.XXXXXXXXXX) - cat > $TMPFILE - echo "%s $TMPFILE" >&2 -} -""" % _TEXT_SAVED_IMAGE - -def display_data_for_image(filename): - with open(filename, 'rb') as f: - image = f.read() - os.unlink(filename) - - image_type = imghdr.what(None, image) - if image_type is None: - raise ValueError("Not a valid image: %s" % image) - - image_data = base64.b64encode(image).decode('ascii') - content = { - 'data': { - 'image/' + image_type: image_data - }, - 'metadata': {} - } - return content - - -def extract_image_filenames(output): - output_lines = [] - image_filenames = [] - - for line in output.split("\n"): - if line.startswith(_TEXT_SAVED_IMAGE): - filename = line.rstrip().split(": ")[-1] - image_filenames.append(filename) - else: - output_lines.append(line) - - output = "\n".join(output_lines) - return image_filenames, output diff --git a/packages/python/yap_kernel/install.py b/packages/python/yap_kernel/install.py deleted file mode 100644 index da6ee30dc..000000000 --- a/packages/python/yap_kernel/install.py +++ /dev/null @@ -1,44 +0,0 @@ -import json -import os -import sys - -try: - from jupyter_client.kernelspec import install_kernel_spec -except ImportError: - from IPython.kernel.kernelspec import install_kernel_spec -from IPython.utils.tempdir import TemporaryDirectory - - -kernel_json = { - "argv": [sys.executable, - "-m", "yap_kernel", - "-f", "{connection_file}"], - "display_name": "yap", - "mimetype": "text/x-prolog", - "language": "prolog", - "name": "yap", -} - -def install_my_kernel_spec(user=False): - with TemporaryDirectory() as td: - os.chmod(td, 0o755) # Starts off as 700, not user readable - with open(os.path.join(td, 'kernel.json'), 'w') as f: - json.dump(kernel_json, f, sort_keys=True) - # TODO: Copy resources once they're specified - - print('Installing IPython kernel spec') - install_kernel_spec(td, 'yap', user=False, replace=True) - -def _is_root(): - return True - try: - return os.geteuid() == 0 - except AttributeError: - return False # assume not an admin on non-Unix platforms - -def main(argv=[]): - user = '--user' in argv or not _is_root() - install_my_kernel_spec(user=user) - -if __name__ == '__main__': - main(argv=sys.argv) diff --git a/packages/python/yap_kernel/jupyter.yap b/packages/python/yap_kernel/jupyter.yap index a0ed4d270..3f9d71fe3 100644 --- a/packages/python/yap_kernel/jupyter.yap +++ b/packages/python/yap_kernel/jupyter.yap @@ -1,5 +1,15 @@ :- if( current_prolog_flag(apple, true) ). -:- putenv( 'LC_CTYPE', 'en_us:UTF-8'), +:- putenv( 'LC_CTYPE', 'en_us:UTF-8'). + +plot_inline :- + X := self.inline_plotting, + nb_setval(inline, X ), + X = true, + !, + := ( + import( matplotlib ), + matplotlib.use( `nbagg` ) + ). :- endif. diff --git a/packages/python/yap_kernel/setup.py.cmake b/packages/python/yap_kernel/setup.py.cmake index c033ee4de..bbf609d9b 100644 --- a/packages/python/yap_kernel/setup.py.cmake +++ b/packages/python/yap_kernel/setup.py.cmake @@ -1,60 +1,81 @@ -from distutils.command.install import install -from distutils.core import setup -from distutils import log -import json +#!/usr/bin/env python +# coding: utf-8 + +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. + +from __future__ import print_function + +# the name of the package +name = 'yap_kernel' + +#----------------------------------------------------------------------------- +# Minimal Python version sanity check +#----------------------------------------------------------------------------- + import sys + +v = sys.version_info +if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)): + error = "ERROR: %s requires Python version 2.7 or 3.3 or above." % name + print(error, file=sys.stderr) + sys.exit(1) + +PY3 = (sys.version_info[0] >= 3) + +#----------------------------------------------------------------------------- +# get on with it +#----------------------------------------------------------------------------- + import os +from glob import glob -PY3 = sys.version_info[0] >= 3 +from distutils.core import setup -kernel_json = { - "argv": [sys.executable, - "-m", "yap_kernel", - "-f", "{connection_file}"], - "display_name": " YAP-6.3" , - "language": "prolog", - "name": "yap_kernel", +packages = ["${CMAKE_CURRENT_SOURCE_DIR}"] + +version_ns = {} +setup_args = dict( + name = 'yap_kernel', + version = '0.0.1', + packages = ["yap_kernel"], + package_dir = {'': '${CMAKE_SOURCE_DIR}/packages/python' }, + description = "YAP Kernel for Jupyter", + long_description="A simple YAP kernel for Jupyter/IPython", + url="https://github.com/vscosta/yap-6.3", + author='Vitor Santos Costa, based on the the IPython', + author_email='vsc@dcc.fc.up.pt', + license = 'BSD', + platforms = "Linux, Mac OS X, Windows", + keywords = ['Interactive', 'Interpreter', 'Shell', 'Web'], + classifiers = [ + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: BSD License', + 'Programming Language :: Prolog', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + ], +) + +if 'develop' in sys.argv or any(a.startswith('bdist') for a in sys.argv): + import setuptools + +setuptools_args = {} +install_requires = setuptools_args['install_requires'] = [ + 'ipython>=4.0.0', + 'traitlets>=4.1.0', + 'jupyter_client', + 'tornado>=4.0', +] + +extras_require = setuptools_args['extras_require'] = { + 'test:python_version=="2.7"': ['mock', 'nose_warnings_filters'], } +if 'setuptools' in sys.modules: + setup_args.update(setuptools_args) -class install_with_kernelspec(install): - def run(self): - install.run(self) - from jupyter_client.kernelspec import install_kernel_spec - from IPython.utils.tempdir import TemporaryDirectory - with TemporaryDirectory() as td: - os.chmod(td, 0o755) # Starts off as 700, not user readable - with open(os.path.join(td, 'kernel.json'), 'w') as f: - json.dump(kernel_json, f, sort_keys=True) - log.info('Installing kernel spec') - try: - install_kernel_spec(td, 'yap_kernel', user=self.user, - replace=True) - except: - install_kernel_spec(td, 'yap_kernel', user=not self.user, - replace=True) - -svem_flag = '--single-version-externally-managed' -if svem_flag in sys.argv: - # Die, setuptools, die. - sys.argv.remove(svem_flag) - -setup(name='yap_kernel', - version='0.0.1', - package_dir = {'': '${CMAKE_SOURCE_DIR}/packages/python/yap_kernel' }, - description='A simple YAP kernel for Jupyter/IPython', - long_description="A simple YAP kernel for Jupyter/IPython, based on MetaKernel", - url="https://github.com/vscosta/yap-6.3", - author='Vitor Santos Costa, based on the metakernel from Douglas Blank', - author_email='vsc@dcc.fc.up.pt', - py_modules=['yap_kernel'], - install_requires=["metakernel","yap"], - cmdclass={'install': install_with_kernelspec}, - classifiers = [ - 'Framework :: IPython', - 'License :: OSI Approved :: BSD License', - 'Programming Language :: YAP :: 6.3', - 'Programming Language :: Python :: 3', - 'Topic :: System :: Shells', - ] -) +if __name__ == '__main__': + setup(**setup_args) diff --git a/packages/python/yap_kernel/yap_kernel.py b/packages/python/yap_kernel/yap_kernel.py index a2dac0274..7a11109f7 100644 --- a/packages/python/yap_kernel/yap_kernel.py +++ b/packages/python/yap_kernel/yap_kernel.py @@ -1,44 +1,59 @@ from __future__ import print_function -from metakernel import MetaKernel +from ipykernel.ipkernel import IPythonKernel import sys import signal import yap -import yapex -import ipywidgets as widgets +import logging + +logger = logging.getLogger() +handler = logging.StreamHandler() +formatter = logging.Formatter( + '%(asctime)s %(name)-12s %(levelname)-8s %(message)s') +handler.setFormatter(formatter) +logger.addHandler(handler) +logger.setLevel(logging.DEBUG) + +logger.debug('often makes a very good meal of %s', 'visiting tourists') + +kernel_json = { + "argv": [sys.executable, + "-m", "yap_kernel", + "-f", "{connection_file}"], + "display_name": " YAP-6.3" , + "language": "prolog", + "name": "yap_kernel", +} def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) - -class MetaKernelyap(MetaKernel): +class YAPKernel(IPythonKernel): implementation = 'MetaKernel YAP' implementation_version = '1.0' language = 'text' language_version = '0.1' - banner = "MetaKernel YAP" + banner = "YAP-6.3" language_info = { 'mimetype': 'text/prolog', 'name': 'text', # ------ If different from 'language': - 'codemirror_mode': { + 'codemirror_mode': { "version": 2, "name": "prolog" - }, - 'pygments_lexer': 'prolog', - 'version' : "0.0.1", + }, + 'pygments_lexer': 'prolog', + 'version' : "0.0.1", 'file_extension': '.yap', - 'help_links': MetaKernel.help_links, } + def __init__(self, **kwargs): - MetaKernel.__init__(self, **kwargs) - self._start_yap(**kwargs) - self.olines = "" - self.ask = True + super(YAPKernel, self).__init__( **kwargs) + _start_yap( **kwargs ) def _start_yap(self, **kwargs): # Signal handlers are inherited by forked processes, and we can't easily @@ -51,18 +66,16 @@ class MetaKernelyap(MetaKernel): self.q = None self.engine.query("load_files(library(python), [])").command() self.engine.query("load_files(library(jupyter), [])").command() - banner = "YAP {0} Kernel".format(self.engine.version()) + banner = "YAP6-3 Kernel" self.olines = banner finally: signal.signal(signal.SIGINT, sig) - # Register Yap function to write image data to temporary file - #self.yapwrapper.run_command(image_setup_cmd) - def get_usage(self): return "This is the YAP kernel." - def query_prolog(self, s): + + def run_cell(self, s, store_history=False, silent=False, shell_futures=True): if not self.q: self.q = self.engine.query(s) @@ -94,118 +107,3 @@ class MetaKernelyap(MetaKernel): if self.q: self.q.close() self.q = None - - def do_execute_direct(self, code): - if not code.strip(): - return "" - lines = code.split("\n") - interrupted = False - self.doReset = True - nlines = "" - try: - for line in lines: - line = line.strip() - if line.startswith('#'): - # wait - print( "comment") - elif line.startswith('%'): - # wait - call_magic( line ) - elif line.endswith(';'): - nlines += line.rstrip(';').rstrip() - self.doReset = False - break - elif line.endswith('!'): - nlines += line.rstrip('!').rstrip() - self.ask = False - self.doReset = False - break - else: - line = line.rstrip() - if line: - nlines += line + "\n" - if nlines != self.olines: - self.closeq( ) - self.olines = nlines - elif self.doReset: - opt = widgets.ToggleButtons( - description='Query Solutions:', - options=['First', 'Next', 'All'], - ) - print( opt ) - if opt == 'First': - self.closeq( ) - elif opt == 'Next': - self.doReset = False - else: - self.ask = False - self.doReset = False - self.query_prolog( nlines ) - while not self.ask and self.q: - self.query_prolog( nlines ) - - except SyntaxError as err: - print("Syntax Error error: {0}".format(err)) - except EOFError: - return - except RuntimeError as err: - print("YAP Execution Error: {0}".format(err)) - except ValueError: - print("Could not convert data to an integer.") - except KeyboardInterrupt: - return 'stopped by user' - except: - print("Unexpected error:", sys.exc_info()[0]) - raise - - def do_complete(self, code, cursor_pos): - print(code) - print(cursor_pos) - eprint( code, " -- ", str(cursor_pos ) ) - # code = code[:cursor_pos] - # default = {'matches': [], 'cursor_start': 0, - # 'cursor_end': cursor_pos, 'metadata': dict(), - # 'status': 'ok'} - - # if not code or code[-1] == ' ': - # return default - - # tokens = code.replace(';', ' ').split() - # if not tokens: - # return default - - # matches = [] - # token = tokens[-1] - # start = cursor_pos - len(token) - - # if token[0] == '$': - # # complete variables - # cmd = 'compgen -A arrayvar -A export \ - # -A variable %s' % token[1:] # strip leading $ - # output = self.bashwrapper.run_command(cmd).rstrip() - # completions = set(output.split()) - # # append matches including leading $ - # matches.extend(['$'+c for c in completions]) - # else: - # # complete functions and builtins - # cmd = 'compgen -cdfa %s' % token - # output = self.bashwrapper.run_command(cmd).rstrip() - # matches.extend(output.split()) - - # if not matches: - # return default - # matches = [m for m in matches if m.startswith(token)] - - # return {'matches': sorted(matches), 'cursor_start': start, - # 'cursor_end': cursor_pos, 'metadata': dict(), - # 'status': 'ok'} - - def repr(self, data): - return repr(data) - -if __name__ == '__main__': - try: - from ipykernel.kernelapp import IPKernelApp - except ImportError: - from jupyter_client.zmq.kernelapp import IPKernelApp - IPKernelApp.launch_instance(kernel_class=MetaKernelyap)