SELECT sqrt(2) INTO square_root
SELECT round(sqrt::NUMERIC, 2) FROM square_root
An SQL console is a REPL environment that allows for interaction with previous results. So, apart from the natural language interface I think that's pretty much what you're describing (and if required that natural language interface could be added using something like Siri or wit.ai)
That's why I mentioned SQL. Both SQL and Prolog are declarative languages but SQL has a much more approachable syntax. In SQL constraints can be expressed using WHERE and ON clauses. For your more complex robot example this would require some work but it's certainly possible.
The syntax is fine, but conventional logic programming is insufficient for what you describe; you need something more likely constraint logic programming as inplemented in, among other languages, Oz.
in the Scheme programming language you would write
(define (add a b) (+ a b))
in my language you would write
.(add).. a b
number
.(+).. a b
to define subtraction declaratively in terms of "add" you would write the following
.(sub).. a b
number
.(add).. () b a
this says "to subtract b from a find the quantity that added to b equals a"
genetic algorithms are used as a mechanism for finding the quantity in question