Find Jobs
Hire Freelancers

assignment help

$30-250 USD

Terminado
Publicado hace más de 10 años

$30-250 USD

Pagado a la entrega
dec2bin: Write a predicate dec2bin(N, L) that takes a positive integer N and returns a list L that is the binary representation of N. For instance: dec2bin(1,L) should succeed with L=[1] and dec2bin(2,L) should succeed with L=[1,0] dec2bin(26,L) should succeed with L=[1,1,0,1,0] eval: Consider expression trees represented as a Prolog data structure, as discussed in class (Sep 20). Write a predicate eval(E, V) that takes an expression tree E and returns in V the value of the expression. For instance: eval(plus(num(4), num(2)), V) succeeds with V=6 eval(star(plus(num(4), num(2)),minus(num(3), num(1))), V) succeeds with V=12 You may assume that the first argument is always a valid expression tree. comp: This question also deals with expression trees. Write a predicate traverse(E, L) that takes an expression tree E and returns in L the list of stack machine instructions that evaluate E. The relevant instructions for this exercise are: ildc(n) which pushes a given integer n on the stack; iadd, isub, imul and idiv that add, subtract, multiply or divide the top two elements of the stack. For instance: comp(plus(num(4), num(2)), C) succeeds with C=[ildc(4), ildc(2), iadd] comp(minus(num(4), num(2)), C) succeeds with C=[ildc(4), ildc(2), isub] comp(star(plus(num(4), num(2)),minus(num(3), num(1))), C) succeeds with C=[ildc(4), ildc(2), iadd, ildc(3), ildc(1), isub, imul] You may assume that the first argument is always a valid expression tree.
ID del proyecto: 5195986

Información sobre el proyecto

1 propuesta
Proyecto remoto
Activo hace 10 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
Adjudicado a:
Avatar del usuario
Hi. I am good at functional programming. Check out my previous work where I did haskell assignments, also on functional programming. PM me if you want me to do this job. Also send me the source of the assignment. Thanks. Price is negotiable over chat. Cheers.
$50 USD en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de SINGAPORE
singapore, Singapore
5,0
1
Forma de pago verificada
Miembro desde dic 4, 2013

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.