URM (Unlimited Register Machine) de Cutland Plus de détails...
Classes | |
| class | UrmCutlandInstruction |
| Une instruction pour la machine virtuelle UrmCutland. Plus de détails... | |
| class | UrmCutlandProg |
| Programme (suite de UrmCutlandInstruction) pour la machine virtuelle UrmCutland. Plus de détails... | |
| class | UrmCutland |
| Machine virtuelle UrmCutland : Unlimited Register Machine de Cutland (variante de la machine de Shepherdson – Sturgis) Plus de détails... | |
Variables | |
| string | VERSION = 'urmCutland --- 2010 April 12' |
| Date du dernier changement pour ce module. | |
| int | Z = 0 |
| Code associé à l'instruction Z. | |
| int | S = 1 |
| Code associé à l'instruction S. | |
| int | T = 2 |
| Code associé à l'instruction T. | |
| int | J = 3 |
| Code associé à l'instruction J. | |
| tuple | NOTHING = UrmCutlandInstruction(T, 1, 1) |
| Instruction qui ne fait rien. | |
| tuple | NOT |
| Programme négation booléenne de n (càd si n == 0 alors 1 sinon 0) | |
| tuple | LESSOREQ |
| Programme a <= b (càd si a <= b alors 1 sinon 0) | |
| tuple | LESS |
| Programme a < b (càd si a < b alors 1 sinon 0) | |
| tuple | GREATOREQ |
| Programme a >= b (càd si a >= b alors 1 sinon 0) | |
| tuple | GREAT |
| Programme a > b (càd si a > b alors 1 sinon 0) | |
| tuple | MIN |
| Programme minimum de a et b : min(a, b) | |
| tuple | MAX |
| Programme maximum de a et b : max(a, b) | |
| tuple | INC = UrmCutlandProg((UrmCutlandInstruction(S, 1), )) |
| Programme n + 1. | |
| tuple | DEC |
| Programme n - 1. | |
| tuple | ADD |
| Programme a + b. | |
| tuple | SUB |
| Programme a - b. | |
| tuple | MUL |
| Programme a*b. | |
| tuple | DIV |
| Programme division euclidienne : quotient entier a//b et reste ab. | |
| tuple | POW |
| Programme ab == a**b. | |
| tuple | GCD |
| Programme plus grand commun diviseur : gcd(a, b) | |
| tuple | FIBONACCI2 |
| Programme ne et (n + 1)e nombres de Fibonacci : Fn et Fn + 1 | |
| tuple | FACTORIAL |
| Programme n! | |
URM (Unlimited Register Machine) de Cutland
| tuple DSPython.urmCutland.ADD |
Programme a + b.
Pre: | a | b | Post: | a + b | Bord: | | b | b | O() = b
Définition à la ligne 1171 du fichier urmCutland.py.
| tuple DSPython.urmCutland.DEC |
Programme n - 1.
Pre: | n | Post: | n - 1 | si n > 0, sinon ne s'arrête jamais Bord: | | n | n | O() = n
Définition à la ligne 1153 du fichier urmCutland.py.
| tuple DSPython.urmCutland.DIV |
Programme division euclidienne : quotient entier a//b et reste ab.
Pre: | a | b | Post: | a//b | a%b | si b != 0, sinon ne s'arrête jamais Bord: | | | a | b | a | O() = a
Définition à la ligne 1221 du fichier urmCutland.py.
| tuple DSPython.urmCutland.FACTORIAL |
Programme n!
Pre: | n |
Post: | n! |
Bord: | | n | | | | n | si n == 0,
| | n | (n - 1)! | n | n | n | sinon
O() = n!
Définition à la ligne 1310 du fichier urmCutland.py.
| tuple DSPython.urmCutland.FIBONACCI2 |
Programme ne et (n + 1)e nombres de Fibonacci : Fn et Fn + 1
Pre: | n |
Post: | F_n | F_(n+1) |
Bord: | | | | n | n | si n == 0,
| | | F_n | n | n | sinon
O() = F_(n+1)
Définition à la ligne 1288 du fichier urmCutland.py.
| tuple DSPython.urmCutland.GCD |
Programme plus grand commun diviseur : gcd(a, b)
Pre: | a | b |
Post: | gcd(a, b) | | si a != 0 ou a!= b, sinon ne s'arrête jamais
Bord: | | 0 | 0 | gcd(a, b) | 0 | si a == 0 ou b == 0,
| | 0 | k*gcd(a, b) | gcd(a, b) | 0 | sinon
(avec k naturel >= 1 et gcd(a, b) <= k*gcd(a, b) <= max(a, b))
O() = ...
Définition à la ligne 1271 du fichier urmCutland.py.
| tuple DSPython.urmCutland.GREAT |
Programme a > b (càd si a > b alors 1 sinon 0)
Pre: | a | b |
Post: | a > b |
Bord: | | b | | si a == b,
| | b | min(a, b) | sinon
O() = min(a, b)
Définition à la ligne 1085 du fichier urmCutland.py.
| tuple DSPython.urmCutland.GREATOREQ |
Programme a >= b (càd si a >= b alors 1 sinon 0)
Pre: | a | b | Post: | a >= b | Bord: | | b | min(a, b) | O() = min(a, b)
Définition à la ligne 1062 du fichier urmCutland.py.
| tuple DSPython.urmCutland.INC = UrmCutlandProg((UrmCutlandInstruction(S, 1), )) |
Programme n + 1.
Pre: | n | Post: | n | O() = 1
Définition à la ligne 1146 du fichier urmCutland.py.
| tuple DSPython.urmCutland.LESS |
Programme a < b (càd si a < b alors 1 sinon 0)
Pre: | a | b |
Post: | a < b |
Bord: | | b | | si a == b,
| | b | min(a, b) | sinon
O() = min(a, b)
Définition à la ligne 1040 du fichier urmCutland.py.
| tuple DSPython.urmCutland.LESSOREQ |
Programme a <= b (càd si a <= b alors 1 sinon 0)
Pre: | a | b | Post: | a <= b | Bord: | | b | min(a, b) | O() = min(a, b)
Définition à la ligne 1017 du fichier urmCutland.py.
| tuple DSPython.urmCutland.MAX |
Programme maximum de a et b : max(a, b)
Pre: | a | b | Post: | max(a, b) | Bord: | | b | min(a, b) | O() = min(a, b)
Définition à la ligne 1127 du fichier urmCutland.py.
| tuple DSPython.urmCutland.MIN |
Programme minimum de a et b : min(a, b)
Pre: | a | b | Post: | min(a, b) | Bord: | | b | min(a, b) | O() = min(a, b)
Définition à la ligne 1109 du fichier urmCutland.py.
| tuple DSPython.urmCutland.MUL |
Programme a*b.
Pre: | a | b |
Post: | a*b |
Bord: | | a | | b | b | si b == 0,
| | a | a | b | b | sinon
O() = a*b
Définition à la ligne 1203 du fichier urmCutland.py.
| tuple DSPython.urmCutland.NOT |
Programme négation booléenne de n (càd si n == 0 alors 1 sinon 0)
Pre: | n | Post: | négation booléenne de n | Bord: | | 0 | O() = 1
Définition à la ligne 1003 du fichier urmCutland.py.
| tuple DSPython.urmCutland.POW |
Programme ab == a**b.
Pre: | a | b |
Post: | a**b |
Bord: | | a | 0 | 0 | 0 | b | b | si b == 0,
| | a | | a | a | b | b | si b > 0 et a == 0,
| | a | a**(b - 1) | a | a | b | b | sinon
O() = a**b
Définition à la ligne 1248 du fichier urmCutland.py.
| tuple DSPython.urmCutland.SUB |
Programme a - b.
Pre: | a | b | Post: | a - b | si a >= b, sinon ne s'arrête jamais Bord: | | a | a | O() = a - b
Définition à la ligne 1186 du fichier urmCutland.py.