Questions tagged [oz]

Oz is a multiparadigm programming language including logic, functional (both lazy and eager), imperative, object-oriented, constraint, distributed, and concurrent programming.

Oz is a multiparadigm programming language including logic, functional (both lazy and eager), imperative, object-oriented, constraint, distributed, and concurrent programming.

The major strengths of Oz are in constraint programming and distributed programming. Due to its factored design, Oz is able to successfully implement a network-transparent distributed programming model. This model makes it easy to program open, fault-tolerant applications within the language. For constraint programming, Oz introduces the idea of "computation spaces"; these allow user-defined search and distribution strategies orthogonal to the constraint domain.

A canonical book on Oz programming is Concepts, Techniques, and Models of Computer Programming.

For more information, see the Mozart programming system, which is a multiplatform implementation of the Oz programming language.

110 questions
0
votes
2 answers

Kernel language representation of a function

What is the kernel language representation of N + {Add N - 1} following the stub local I1 in // the code end end end the procedure definition of function {Add N} is as follows proc {Add N R} if N == 0 then R = 0 else N + {Add…
user5346004
0
votes
1 answer

How to use the module List in Oz

I found info about a module in Oz that contains procedures operating on lists here: https://mozart.github.io/mozart-v1/doc-1.4.0/base/list.html But I have been trying different procedures in different ways, for example: declare proc {Length L} …
Angela
  • 7
  • 2
0
votes
1 answer

Why I get sum(

) when I use Show in OZ?

I'm learning Oz, and was trying to run an example that I found in a book, it is about to simulate a full adder, but what I get is sum( ), so I do not know where the mistake, I would appreciate your help. Here is part of the code: fun {XorG X Y} …
Angela
  • 7
  • 2
0
votes
1 answer

Oz - Write a more efficient function

How can I write the following function in a more efficient manner to reduce the number of recursive calls made? declare fun {Calc N} if N == 0 then 2 elseif N == 1 then 4 elseif N == 2 then 8 else {Calc N-1}+{Calc N-2}+{Calc N-3} …
user5346004
0
votes
1 answer

Programming with Oz on another text editor

I'm learning the Oz programming language at the university and we've used Emacs to run Oz code. I was wondering if it was possible to run Oz code on any other text editor like Notepad++ or even using an IDE like VS?
Corvinus
  • 169
  • 2
  • 10
0
votes
2 answers

How can an Oz program tell the difference between a list and a non-list?

How can an Oz program tell the difference between a value which is of type List and one which is a non-list such as simple scalar value 1 or string 'Hello'? (Like Haskell, does Oz treat a string as a list of characters?)
Derek Mahar
  • 27,608
  • 43
  • 124
  • 174
0
votes
2 answers

What is the syntax for a block comment in the Oz programming language?

What is the syntax for a block comment in the Oz programming language?
Derek Mahar
  • 27,608
  • 43
  • 124
  • 174
0
votes
1 answer

Find the max in a list - OZ

I have to make a program in Oz that will return the max integer in a list. The code that I have so far looks like this: declare proc {Max Xs K} case Xs of nil then K = 0 [] X|Xr then local M in …
april
  • 1
  • 2
0
votes
2 answers

How to bind an unbound value in a List in Oz

Let's say we have the following code: local L in L = {List.make 10 $} % Bind nth element to something here end How does one set any of these unbound values? The Oz List Documentation didn't shed any light on this. The only related question…
Spyral
  • 760
  • 1
  • 12
  • 33
0
votes
1 answer

How to use absolute values in Mozart?

I'm trying to get an absolute value of expression Z=:X-Y but it's not working. Here is my code: declare PSO proc {PSO W} X Y Z W in X=5 Y=2 Z=:Y-X W=:Abs(Z) W=w(w:W) {FD.distribute ff W} end {ExploreOne PSO} I would like to…
always_bloo
  • 165
  • 5
  • 13
0
votes
1 answer

Using "If statement" - OZ

I have problem using "if statement" in Mozart. Program starts but only result it gives is: 1#_. I'd like to know why it's now working. declare PSO proc{PSO W} X1 X2 X3 X4 Y1 Y2 Y3 Y4 in X1::1#6 X2::1#6 X3::1#6 X4::1#6 Y1::1#6 …
always_bloo
  • 165
  • 5
  • 13
0
votes
1 answer

Mozart Function parse error

when am trying to run this factorial function on this Mozart online complier i got parse error ! declare fun {Fact N} fun{Aux N Nmax FactNminus1} if N>Nmax then nil else (FactNminus1*N)|{Aux N+1 Nmax FactNminus1*N} end …
Mohamed A. Shebl
  • 384
  • 3
  • 5
  • 16
0
votes
1 answer

Mozart Oz function that returns nothing but executes several instructions

The question is in the title, how do I create a function which doesn't provide a returned value, but could execute several instructions? For example: declare fun {doStuff Tree} case Tree of bTree(T left:leaf right:leaf) then {Browse Tree} …
user3078046
  • 31
  • 1
  • 7
0
votes
2 answers

Writing a Factorial function with Lists

While I believe I have found a sound algorithm for my function (Factorial) I'm very confused as to why it loops infinitely. Here's my code : declare fun{Fact N} local M=1 in %I suppose it loops from here?? local FactT in …
user3078046
  • 31
  • 1
  • 7
0
votes
1 answer

How do you change an element in a list in Oz?

I want to swap an item in a list in oz. So let's say I have L = [ 1 2 3], and I would like it to be L = [1 4 3]. How would one go about doing that? I see {List.member X +Ys ?B} And other various possible functions on…
pearbear
  • 1,025
  • 4
  • 18
  • 23