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

Mozart IDE (emacs) parse error

Wrote this code using the mozart emacs system I downloaded from here: This is my code: declare fun {Mult X Y} X*Y end end {Browse {Mult 1 1}} When I run it it says: parse error in file Oz, line 6, column 1. What does this mean? How do I…
Hank
  • 11
  • 2
1
vote
1 answer

is there an new version of mozart/oz?

Would like to know if there is a new version of mozart/oz currently it is 1.4. That was in 2008. There has to have been progress.
Setori
  • 10,326
  • 11
  • 40
  • 46
1
vote
1 answer

Implementing Ports using Cells and viceversa in Oz

I'm trying to figure out how to "simulate" a Port using cells but I can't make it. The main idea is to have a function or procedure that simulates {NewPort S P} and other one that simulates {Send P X} behavior. Here what I got. declare P S proc…
Sean Sabe
  • 79
  • 9
1
vote
4 answers

Sum of the digits of a number?

I am a newbie to programming .here I have been solving a simple problem in functional programming (OZ) which is finding the sum of the Digits of a 6 digit positive integer. Example:- if n = 123456 then output = 1+2+3+4+5+6 which is 21. here I found…
læran91
  • 283
  • 1
  • 15
1
vote
1 answer

I want to do a sort of a list with oz language

I want to do a sort of a list with oz language: But I can not understand This is my simple idea but it is not correct can you help me please declare fun {Permute L } if L==nil then nil else L.2.1|L.1|L.2.2 end end fun {Trie L } if…
user7254462
1
vote
2 answers

Errors in Mozart / Oz with tree traversal examples from book " Concepts, Techniques, and Models of Computer Programming "

Thanks in advance, and apologies for any errors or anything confusing about my post. I am getting errors with the tree traversal examples in section 3.4.6 of " Concepts, Techniques, and Models of Computer Programming ". I am using Oz /…
crh777
  • 23
  • 5
1
vote
2 answers

free and bound identifiers in functional programming

I've been banging my head at this question for sometime and I can't figure it out. I've read the definition of free variable "Free variables and bound variables" from wikipedia and several books but I can't get the answer right Consider the…
Mihai Vinaga
  • 1,059
  • 2
  • 10
  • 27
1
vote
2 answers

How can I make this code tail recursive?

The following code is intended to append two lists. fun {AppendLists L1 L2} if L1 == nil then L2 else L1.1 | {AppendLists L1.2 L2} end end
user5346004
1
vote
1 answer

How to build symbolic differential OZ Mozart

I want to make a symbolic differentiation program in OZ Mozart but I'm stuck, don't know how to start, in prolog would be something like the rules below but I need help atleast in how to make the most symple rule in OZ, derivate of X is equal to 1…
1
vote
1 answer

Mozart/Oz : convert string to feature

I need to generate features names that I don't know in advance, in order to make a record. The record should look like: record(day1:[...] day2:[...] day3:[...] ...). As I don't know how many days the record will contain, I cannot write features…
Nicolas Cailloux
  • 418
  • 4
  • 13
1
vote
1 answer

I'm creating a chess board in Oz, my program seems not to terminate

For a homework assignment I have to (amongst other things) create a chess board in Oz. I'm rather unfamiliar with the language but here's how I wanted to do it: declare fun {MakeTile Col Row} if Col==1 then if {And (Row=<10) (Row>=2)} then…
RaptorDotCpp
  • 1,425
  • 14
  • 26
1
vote
2 answers

Return true if an element in a list is true Oz

I need to do this two very similar exercises in Oz: *. Write the function {Some L P} that takes a list L and a Boolean function P. It returns true if P returns true for at least one element of L and false otherwise. *. Write the function {All L P}…
Zaz On Ira
  • 11
  • 2
1
vote
1 answer

Duplicate the elements of a list OZ

Write a function that duplicates every element in a list. For instance: {Duplicate [1 2 3]} returns the list [1 1 2 2 3 3]. How can I make it in OZ mozart? I don't know the sintaxis of oz, in prolog would be something like: even(N) :- N mod 2…
1
vote
1 answer

How do I use loops in Oz?

From this documentation: http://mozart.github.io/mozart-v1/doc-1.4.0/loop/node1.html I get the basic loop usage for iteration: for X in SomeList do % ... end And numbers: for X in x..y do % ... end But the "features" that are explained has…
Hubro
  • 56,214
  • 69
  • 228
  • 381
1
vote
1 answer

Why can't I get functional methods to work?

My class: declare class Collection attr list meth init list := nil end meth put(X) list := X|@list end meth get($) if @list == nil then nil else local X in X = @list.1 …
Hubro
  • 56,214
  • 69
  • 228
  • 381