请输入您要查询的百科知识:

 

词条 Gödel (programming language)
释义

  1. Features

  2. Sample code

  3. External links

{{Infobox programming language
| name =Gödel
| logo =
| paradigm = declarative, logic
| year = 1992
| designer =John Lloyd & Patricia Hill
| developer = John Lloyd & Patricia Hill
| latest_release_version = 1.5
| latest release date ={{release date|1995|8|11}}
| typing = strong
| implementations =
| dialects = [https://web.archive.org/web/20091207092823/http://www.scs.leeds.ac.uk/hill/GOEDEL/expgoedel.html Gödel with Generic (Parametrised) Modules]
| influenced_by =
| influenced =
| operating_system = Unix-like
| license = Non-commercial research/educational use only
| website =
| file_ext =
}}

Gödel is a declarative, general-purpose programming language that adheres to the logic programming paradigm. It is a strongly typed language, the type system being based on many-sorted logic with parametric polymorphism. It is named after logician Kurt Gödel.

Features

Gödel has a module system, and it supports arbitrary precision integers, arbitrary precision rationals, and also floating-point numbers. It can solve constraints over finite domains of integers and also linear rational constraints. It supports processing of finite sets. It also has a flexible computation rule and a pruning operator which generalises the commit of the concurrent logic programming languages.

Gödel's meta-logical facilities provide support for meta-programs that do analysis, transformation, compilation, verification, and debugging, among other tasks.

Sample code

The following Gödel module is a specification of the greatest common divisor (GCD) of two numbers. It is intended to demonstrate the declarative nature of Gödel, not to be particularly efficient.

The CommonDivisor predicate says that if i and j are not zero, then d is a common divisor of i and j if it lies between 1 and the smaller of i and j and divides both i and j exactly.

The Gcd predicate says that d is a greatest common divisor of i and j if it is a common divisor of i and j, and there is no e that is also a common divisor of i and j and is greater than d.

 MODULE      GCD. IMPORT      Integers.   PREDICATE   Gcd : Integer * Integer * Integer. Gcd(i,j,d) <-             CommonDivisor(i,j,d) &            ~ SOME [e] (CommonDivisor(i,j,e) & e > d).   PREDICATE   CommonDivisor : Integer * Integer * Integer. CommonDivisor(i,j,d) <-            IF (i = 0 \\/ j = 0)            THEN              d = Max(Abs(i),Abs(j))            ELSE              1 =< d =< Min(Abs(i),Abs(j)) &              i Mod d = 0 &              j Mod d = 0.

External links

  • https://web.archive.org/web/20091207092823/http://www.scs.leeds.ac.uk/hill/GOEDEL/expgoedel.html
{{DEFAULTSORT:Godel (programming language)}}

3 : Logic programming languages|Programming languages created in 1992|Programming languages created by women

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/12 0:45:10