Find Jobs
Hire Freelancers

huffman code lisp prolog

€30-250 EUR

Cerrado
Publicado hace más de 6 años

€30-250 EUR

Pagado a la entrega
implement huffman libraries lisp prolog imht-decode bits huffman-tree message ht-encode message huffman-tree bits ht-encode-file filename huffman-tree bits ht-generate-huffman-tree symbols-n-weights huffman-tree ht-generate-symbol-bits-table huffman-tree symbol-bits-table ht-pprint-huffman-tree huffman-tree &optional (indent-level 0) huffman-tree is a Huffman tree (its root); symbols-n-weigths is a list of pairs of symbol-weight (<symbol>. <weight>); symbol-bits-table is a list of pairs (<symbol>. <bits>). The ht-encode-file function reads a text from a file and then invokes ht-encode on the read. Functions must generate errors (with the function error) if encoding and / or decoding are not possible. The ht-print-huffman-tree function prints a Huffman Tree terminal and serves essentially for debugging. No perticular format is required, but printed information has to be fine represent the tree structure of Huffman Prolog You must implement the following predicates: ht_decode / 3 Bits HuffmanTree Message ht_encode / 3 Message HuffmanTree Bits ht_encode_file / 3 Filename HuffmanTree Bits ht_generate_huffman_tree / 2 SymbolsAndWeights HuffmanTree ht_generate_symbol_bits_table / 2 HuffmanTree SymbolBitsTable ht_pprint_huffman_tree / 1 HuffmanTree The constraints are the same as above (obviously remodeled in Prolog). In particular, Symbolic pairs and bits symbol are represented as pairs lists of two elements (i.e., (<symbol>, <weight>) and (<symbol>, <bits>)). Predicates must fail if there are errors or if they encode and / or decoding can not be completed. The predicate ht_print_huffman_tree prints a Huffman Tree terminal. Examples The most important example to keep in mind (the specification, according to a more correct terminology) is the following. In Common Lisp: cl-prompt> (defparameter ht (ht-generate-huffman-tree '<symbols-n-weights>)) HT cl-prompt> (defparameter message '<some-message>) MESSAGE cl-prompt> (equal message (ht-decode (ht-encode message ht ht)) T In Prolog: ? - assert (symbols_n_weights (<symbols-n-weights>)). Yes. ? - assert (message (<some-message>)). Yes. ?- symbol_n_weights(SWs), | message(M), | ht_generate_huffman_tree(SWs, HT), | ht_encode(M, HT, Bits), | ht_decode(Bits, HT, M). Yes. As you may have noticed, the structure of the implementation of a tree has not been specified Huffman. A problem you will have will be in managing ordered sets of elements (leaves and tree nodes in construction); you will need to implement a structure and / or functions that keep them together ordered. The implementation of the various functions and predicates is relatively simple once it is exploited the sorting of knots and leaves. If you find yourself writing features or long predicates or complex then you are probably on the wrong track..
ID del proyecto: 15176734

Información sobre el proyecto

2 propuestas
Proyecto remoto
Activo hace 6 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
2 freelancers están ofertando un promedio de €208 EUR por este trabajo
Avatar del usuario
Hello Sir... I have a very good experience in Prolog & LISP. Please contact me for more details when possible. I look forward to work for you Sir. Best Regards. Relevant Skills and Experience I am a computer science tutor, I teach (among others) Scheme, LISP, Haskell, Prolog and Algorithms. Proposed Milestones €250 EUR - 1
€250 EUR en 3 días
5,0 (93 comentarios)
6,2
6,2

Sobre este cliente

Bandera de ITALY
milano, Italy
0,0
0
Miembro desde sept 15, 2017

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.