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
1 answer

Mozart error "illegal use of nesting marker" when creating a functor

When compiling an Oz code with a functor, I get the error "illegal use of nesting marker" on the line where "functor" is declared. What can this mean? functor export sum:Sum divisao:Div mult:Mult sub:Sub define fun {Sum X Y} X +…
0
votes
1 answer

Display the Two Maximum Numbers in a List in Oz Programming language

I need to make a program that displays the two maximum numbers in a list using Oz programming language. I have the code for printing the maximum number in a list, but I need the two biggest numbers. Here is what I have so far: fun {Max L1} case L1 …
ahpla
  • 1
0
votes
2 answers

How to work with labels in mozart oz to get the elements from pair/tuple?

I'm new to mozart oz and I have this problems to solve: a) Implement a function Zip that takes a pair Xs#Ys of two lists Xs and Ys (of the same length) and returns a pairlist, where the first field of each pair is taken from Xs and the second…
Cipri
  • 15
  • 1
  • 6
0
votes
1 answer

Declaring labels after function

I have this code in Oz: declare fun {NewCounter} C Bump Read in C={NewCell 0} fun {Bump} C:=@C+1 @C end fun {Read} @C end counter(bump:Bump read:Read) end I have two questions: 1) C, Bump and Read labels are declared after the NewCounter function.…
Jhdoe
  • 101
  • 1
0
votes
1 answer

Make a decreasing list from a number

I need to create a decreasing list of all whole numbers between X and Y (inclusive). I am trying this: declare local fun {Dec From To} From | {Dec From-1 To} end in {Browse {Loop 8 1}} % Should Display: [8, 7, 6, 5, 4, 3, 2,…
Moses
  • 157
  • 1
  • 1
  • 8
0
votes
1 answer

Pattern matching with a record in Oz

i'm having some trouble wrapping my head on how to utilize the elements of a record in Oz with pattern matching. Below is my code declare fun {Eval X E} case X of int(N) then N [] var(X) then E.X [] mul(X Y) then X*Y [] add(X Y) then X+Y …
0
votes
1 answer

Puzzle in Mozart Oz

I am trying to solve the below puzzle in Mozart oz. Susie loved animals and had a large collection of stuffed animals. However, there were several that were her favorites. She decided this morning to rearrange her stuffed animals and give each of…
0
votes
1 answer

Need the output horizontally in Mozart OZ programming

Below given is the code I have made for finding Non- Prime numbers between 1-100 by using Mozart OZ programming language. Code in Mozart OZ: declare for A in 1..20 do for I in 2..A div 2 break:Ab do if A mod I ==0 then {Browse A} {Ab} …
0
votes
1 answer

How to write a proper procedure in Oz?

I am very new to Oz, so sorry if this is somewhat basic. The following code, for calculating the area, diameter and circumference of a circle does not work. It throws an error saying "illegal arity in application". I have tried tweaking the code in…
Nora
  • 1,825
  • 8
  • 31
  • 47
0
votes
1 answer

toplevel abstraction in line 1

I see the following error when running the program at the bottom:- %***************************** failure ************************** %** %** Tell: 1024 = two_10 %** %** Call Stack: %** toplevel abstraction in line 1, column 0, PC =…
Himanshu
  • 2,384
  • 2
  • 24
  • 42
0
votes
1 answer

Mozart/Oz: how to make record with Record.make

I am trying to create a record from list using Record.make: declare L=[z [a b] [1 2]] {Record.make L.1 L.2 0} but getting an error: Expected type: feature At argument: 1 How to make a second argument L.2 to be A 'feature' type? I assume L.2 is a…
Alexey Novakov
  • 744
  • 6
  • 20
0
votes
1 answer

syntax error, unexpected T_end, expecting T_the

I'm new to OZ Mozart, I'm trying to write a triangular sequence but the programming won't work. declare fun {Sequence N R} fun {Help I} if I < N sum = {Int.toFloat(N*(N+1)/2.0)} %I + 1 case R of nil then {Append [sum] nil} …
Kun
  • 580
  • 2
  • 13
0
votes
1 answer

Scan through individual numbers in a list with Oz

I am working on learning Oz, but with very little online resources apart from the official documentation I am REALLY struggling to find out how to scan through a list in order to create a working partition function. In this example im just trying to…
Kyle Robinson
  • 45
  • 2
  • 7
0
votes
1 answer

Expected 'end' in case statement

The following code compiles and runs as expected: fun {Tokenize Lexemes} case Lexemes of Head|Tail then case Head of "+" then operator(type:plus)|{Tokenize Tail} else …
tsorn
  • 3,365
  • 1
  • 29
  • 48
0
votes
2 answers

Oz: Counting 0 in trees with unlimited subtrees

Im writing a code for an exercise for my uni and have a problem. I'm quite beginner with Oz and just can't figure out why does this code not showing anything but is accepted by the compiler: declare Tree W P T1 T2 T3 T4 fun {Count0 Tree} case…
wiwo
  • 721
  • 1
  • 13
  • 18