max_stars_repo_path
stringlengths 4
261
| max_stars_repo_name
stringlengths 6
106
| max_stars_count
int64 0
38.8k
| id
stringlengths 1
6
| text
stringlengths 7
1.05M
|
---|---|---|---|---|
out/euler21.adb
|
FardaleM/metalang
| 22 |
16378
|
<gh_stars>10-100
with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
procedure euler21 is
type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function eratostene(t : in a_PTR; max0 : in Integer) return Integer is
n : Integer;
j : Integer;
begin
n := 0;
for i in integer range 2..max0 - 1 loop
if t(i) = i
then
n := n + 1;
j := i * i;
while j < max0 and then j > 0 loop
t(j) := 0;
j := j + i;
end loop;
end if;
end loop;
return n;
end;
function fillPrimesFactors(t : in a_PTR; b : in Integer; primes : in a_PTR; nprimes : in Integer) return Integer is
n : Integer;
d : Integer;
begin
n := b;
for i in integer range 0..nprimes - 1 loop
d := primes(i);
while n rem d = 0 loop
t(d) := t(d) + 1;
n := n / d;
end loop;
if n = 1
then
return primes(i);
end if;
end loop;
return n;
end;
function sumdivaux2(t : in a_PTR; n : in Integer; c : in Integer) return Integer is
i : Integer;
begin
i := c;
while i < n and then t(i) = 0 loop
i := i + 1;
end loop;
return i;
end;
function sumdivaux(t : in a_PTR; n : in Integer; i : in Integer) return Integer is
p : Integer;
out0 : Integer;
o : Integer;
begin
if i > n
then
return 1;
else
if t(i) = 0
then
return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
else
o := sumdivaux(t, n, sumdivaux2(t, n, i + 1));
out0 := 0;
p := i;
for j in integer range 1..t(i) loop
out0 := out0 + p;
p := p * i;
end loop;
return (out0 + 1) * o;
end if;
end if;
end;
function sumdiv(nprimes : in Integer; primes : in a_PTR; n : in Integer) return Integer is
t : a_PTR;
max0 : Integer;
begin
t := new a (0..n);
for i in integer range 0..n loop
t(i) := 0;
end loop;
max0 := fillPrimesFactors(t, n, primes, nprimes);
return sumdivaux(t, max0, 0);
end;
sum : Integer;
primes : a_PTR;
othersum : Integer;
other : Integer;
nprimes : Integer;
maximumprimes : Integer;
l : Integer;
era : a_PTR;
begin
maximumprimes := 1001;
era := new a (0..maximumprimes - 1);
for j in integer range 0..maximumprimes - 1 loop
era(j) := j;
end loop;
nprimes := eratostene(era, maximumprimes);
primes := new a (0..nprimes - 1);
for o in integer range 0..nprimes - 1 loop
primes(o) := 0;
end loop;
l := 0;
for k in integer range 2..maximumprimes - 1 loop
if era(k) = k
then
primes(l) := k;
l := l + 1;
end if;
end loop;
PInt(l);
PString(new char_array'( To_C(" == ")));
PInt(nprimes);
PString(new char_array'( To_C("" & Character'Val(10))));
sum := 0;
for n in integer range 2..1000 loop
other := sumdiv(nprimes, primes, n) - n;
if other > n
then
othersum := sumdiv(nprimes, primes, other) - other;
if othersum = n
then
PInt(other);
PString(new char_array'( To_C(" & ")));
PInt(n);
PString(new char_array'( To_C("" & Character'Val(10))));
sum := sum + other + n;
end if;
end if;
end loop;
PString(new char_array'( To_C("" & Character'Val(10))));
PInt(sum);
PString(new char_array'( To_C("" & Character'Val(10))));
end;
|
src/prelude/titles.asm
|
endstation/golf
| 1 |
167107
|
; Top-hole Golf
; Copyright 2020-2021 <NAME>
; *****************
; *** CONSTANTS ***
; *****************
titles_c_SPR_BASE = 80
titles_c_SPR_PLAYERS0 = titles_c_SPR_BASE
titles_c_SPR_PLAYERS1 = titles_c_SPR_BASE+1
titles_c_SPR_SETTINGS0 = titles_c_SPR_BASE+2
titles_c_SPR_SETTINGS1 = titles_c_SPR_BASE+3
titles_c_SPR_TEEOFF0 = titles_c_SPR_BASE+4
titles_c_SPR_TEEOFF1 = titles_c_SPR_BASE+5
titles_c_SPR_NUM_PLAYERS = 0
titles_c_SPR_X_LHS = spr_c_VISIBLE_ALL_L+54
titles_c_SPR_X_RHS = spr_c_VISIBLE_ALL_L+54+24
titles_l_SPR_Y !byte spr_c_VISIBLE_ALL_T+123,spr_c_VISIBLE_ALL_T+132,spr_c_VISIBLE_ALL_T+141
titles_l_SPR_PTRS_LHS !byte titles_c_SPR_PLAYERS0,titles_c_SPR_SETTINGS0,titles_c_SPR_TEEOFF0
titles_l_SPR_PTRS_RHS !byte titles_c_SPR_PLAYERS1,titles_c_SPR_SETTINGS1,titles_c_SPR_TEEOFF1
titles_c_SPR_NUM_PLAYERS_X = $81
titles_c_SPR_NUM_PLAYERS_Y = $b0
titles_c_TEE_OFF_OK = 0
titles_c_TEE_OFF_ERROR_NO_PLAYERS = 1
titles_c_TEE_OFF_ERROR_INVALID_MATCH_PLAY = 2
titles_l_ERROR_MSG !raw "There are no golfers yet!You need 2 or 4 golfers for match play!"
titles_l_ERROR_MSG_LENS !byte 25,39
titles_l_ERROR_MSG_ADDR_LO !byte <titles_l_ERROR_MSG,<(titles_l_ERROR_MSG+25)
titles_l_ERROR_MSG_ADDR_HI !byte >titles_l_ERROR_MSG,>(titles_l_ERROR_MSG+25)
; 'EXIT' refers to exit from loop.
titles_c_EXIT_MSG_NONE = 0
titles_c_EXIT_MSG_GO_TO_SIGN_IN = 1
titles_c_EXIT_MSG_GO_TO_SETTINGS = 2
titles_c_EXIT_MSG_TEE_OFF = 3
; *****************
; *** VARIABLES ***
; *****************
titles_v_cursor_pos !byte 0
titles_v_must_exit_loop !byte 0
; *******************
; ****** MACROS *****
; *******************
; *******************
; *** SUBROUTINES ***
; *******************
; INPUTS: C flag set = do colorize; C clear = already colorized.
!zone {
titles_s_init
php
+utils_m_enable_bitmap_mode
+utils_m_enable_multicolor_mode
jsr titles_s_draw_bitmap
plp
bcc +
jsr titles_s_colorize_bitmap
+
jsr titles_s_init_sprites
ldx #0
stx titles_v_must_exit_loop
jsr titles_s_refresh_highlight
rts
; end sub titles_s_init
} ; !zone
; **************************************************
!zone {
titles_s_loop
lda titles_v_must_exit_loop
+branch_if_false titles_s_loop
rts
; end sub titles_s_loop
} ; !zone
; **************************************************
!zone {
titles_s_draw_bitmap
; 8000 bytes from $6000 to $e000.
lda #$00
sta P0
lda #$60
sta P1
lda #$00
sta P2
lda #$e0
sta P3
; 31*256 = 7936
ldx #0
ldy #0
-
lda (P0),y
sta (P2),y
iny
bne -
inx
cpx #32
beq .end
inc P1
inc P3
; P2 will never be 0 so can use a branch here.
bne -
.end
rts
; end sub titles_s_draw_bitmap
} ; !zone
; **************************************************
; FIXME: writes 1024 bytes in each case instead of (the more correct)
; 1000 bytes.
!zone {
titles_s_colorize_bitmap
; screen RAM: from $7f40 to gfxs_c_DISPLAY_BASE.
; color RAM: from $8328 to COLOR_RAM.
lda #$40
sta P0
lda #$7f
sta P1
lda #<gfxs_c_DISPLAY_BASE
sta P2
lda #>gfxs_c_DISPLAY_BASE
sta P3
lda #$28
sta P4
lda #$83
sta P5
lda #<COLOR_RAM
sta P6
lda #>COLOR_RAM
sta P7
ldx #0
ldy #0
-
lda (P0),y
sta (P2),y
lda (P4),y
sta (P6),y
iny
bne -
inx
cpx #4
beq .end
inc P1
inc P3
inc P5
inc P7
jmp -
.end
rts
; end sub titles_s_colorize_bitmap
} ; !zone
; **************************************************
; NOTE: h/w sprite #6 (the 'num players' sprite) must be handled separately
; because it doesn't form part of a regular pair.
; INPUTS: X = old cursor pos
!zone {
titles_s_refresh_highlight
lda #GREY3
sta spr_v_color,x
sta spr_v_color+3,x
sta spr_v_color+6
lda #WHITE
ldx titles_v_cursor_pos
bne +
sta spr_v_color+6
+
sta spr_v_color,x
sta spr_v_color+3,x
jsr titles_s_draw_sprites
rts
; end sub titles_s_refresh_highlight
} ; !zone
; **************************************************
!zone {
titles_s_move_cursor_up
lda titles_v_cursor_pos
; Store in X and Y - we'll manipulate Y and save X for call to
; 'titles_s_refresh_highlight' which needs to know old position.
tax
tay
dey
bpl +
ldy #2
+
sty titles_v_cursor_pos
jsr titles_s_refresh_highlight
rts
; end sub titles_s_move_cursor_up
} ; !zone
; **************************************************
!zone {
titles_s_move_cursor_down
lda titles_v_cursor_pos
tax
tay
iny
cpy #3
bne +
ldy #0
+
sty titles_v_cursor_pos
jsr titles_s_refresh_highlight
rts
; end sub titles_s_move_cursor_down
} ; !zone
; **************************************************
!zone {
titles_s_init_sprites
; Disable all sprites (for now).
; We will use sprites #0-5, all hi-res.
lda #$7f
sta SPENA
ldx #2
-
lda #titles_c_SPR_X_LHS
sta spr_v_x_lo,x
lda #titles_c_SPR_X_RHS
sta spr_v_x_lo+3,x
lda titles_l_SPR_Y,x
sta spr_v_y,x
sta spr_v_y+3,x
lda titles_l_SPR_PTRS_LHS,x
sta spr_v_current_ptr,x
lda titles_l_SPR_PTRS_RHS,x
sta spr_v_current_ptr+3,x
lda #GREY3
sta spr_v_color,x
sta spr_v_color+3,x
lda #0
sta spr_v_xxpand,x
sta spr_v_xxpand+3,x
lda #1
sta spr_v_hires,x
sta spr_v_hires+3,x
dex
bpl -
jsr titles_s_prepare_n_sprite
rts
; end sub titles_s_init_sprites
} ; !zone
; **************************************************
!zone {
titles_s_draw_sprites
ldx #6
ldy #6
-
jsr spr_s_write_to_vic_ii
dex
dey
bpl -
rts
; end sub titles_s_draw_sprites
} ; !zone
; **************************************************
; NOTE: this sprite is placed next to the 'Players' text to indicate how many
; players are currently signed in.
!zone {
; Put lookup tables here as they'll only ever be used by this routine!
.offsets !byte 0,3,6,9
.patterns !byte $e0,$00, $ee,$00, $ee,$e0, $ee,$ee
titles_s_prepare_n_sprite
+utils_m_clear_sprite_data prelude_l_BLANK_SPRITE
; What is drawn into the sprite area depends on how many players there are!
ldx shared_v_num_players
beq .end
; If there's 1 player, we want index=0 for the tables, so decrement the
; 'num_players' value before use. Then multiply it by 2 to get an index
; into .patterns. Copy the two byte patterns into MATHS0 and MATHS1.
dex
txa
asl
tax
lda .patterns,x
sta MATHS0
inx
lda .patterns,x
sta MATHS1
ldx #3
.loop
ldy .offsets,x
lda MATHS0
sta prelude_l_BLANK_SPRITE,y
lda MATHS1
sta prelude_l_BLANK_SPRITE+1,y
dex
bpl .loop
lda #GREY3
sta spr_v_color+6
sta spr_v_hires+6
lda #titles_c_SPR_NUM_PLAYERS_X
sta spr_v_x_lo+6
lda #titles_c_SPR_NUM_PLAYERS_Y
sta spr_v_y+6
lda #0
sta spr_v_x_hi+6
lda #titles_c_SPR_NUM_PLAYERS
sta spr_v_current_ptr+6
.end
rts
; end sub titles_s_prepare_n_sprite
} ; !zone
; **************************************************
; OUTPUTS: Z flag set = OK; otherwise error code in accumulator.
!zone {
titles_s_check_tee_off
lda shared_v_num_players
beq .error_no_players
ldx shared_v_scoring
cpx #shared_c_STROKE_PLAY
beq .ok
; Must be match play, so check that there's an even number of players.
; Number of players is still in the accumulator. 'lsr' to put bit #0 into
; the C flag.
lsr
bcc .ok
; Error - invalid number of players for match play.
lda #titles_c_TEE_OFF_ERROR_INVALID_MATCH_PLAY
rts ; EXIT POINT.
.error_no_players
+prelude_m_invalid_sfx
lda #titles_c_TEE_OFF_ERROR_NO_PLAYERS
rts ; EXIT POINT.
.ok
jsr sign_s_tidy_up_names
lda #titles_c_TEE_OFF_OK
rts
; end sub titles_s_check_tee_off
} ; !zone
; **************************************************
; INPUTS: A = error 'code'
!zone {
titles_s_display_error_msg
; Subtract 1 to get correct index into the relevant lookup tables.
tax
dex
lda titles_l_ERROR_MSG_ADDR_LO,x
sta P0
lda titles_l_ERROR_MSG_ADDR_HI,x
sta P1
lda #(24*8)
sta P2
lda #0
sta P3
lda titles_l_ERROR_MSG_LENS,x
sta P4
jsr font_s_draw_text
rts
; end sub titles_s_display_error_msg
} ; !zone
; **************************************************
; NOTE: called by interrupt. Joystick handling must go here!
!zone {
titles_s_update
; Listen for joystick up/down (port #2).
ldx #joy_c_PORT2
+joy_m_is_up
beq .up
+joy_m_is_down
beq .down
+joy_m_is_fire
beq .fire
; Neither up nor down nor fire - make sure locks are released.
jsr joy_s_release_all_locks
rts ; EXIT POINT.
.up
+joy_m_is_locked_up
+branch_if_true .end
+joy_m_lock_up
jsr titles_s_move_cursor_up
jmp .browse_sfx
.down
+joy_m_is_locked_down
+branch_if_true .end
+joy_m_lock_down
jsr titles_s_move_cursor_down
.browse_sfx
+prelude_m_browse_sfx
rts ; EXIT POINT.
.fire
+joy_m_is_locked_fire
+branch_if_true .end
+joy_m_lock_fire
lda titles_v_cursor_pos
beq .sign_in
cmp #1
beq .settings
; Tee off.
jsr titles_s_check_tee_off
beq +
jsr titles_s_display_error_msg
rts ; EXIT POINT.
+
lda shared_v_is_match_play
+branch_if_false +
jsr prelude_s_build_team_names
+
lda #prelude_c_MODE_TEE_OFF
bne +
.sign_in
lda #prelude_c_MODE_SIGN_IN
bne +
.settings
lda #prelude_c_MODE_SETTINGS
+
sta prelude_v_mode_after_fade
inc titles_v_must_exit_loop
+prelude_m_select_sfx
.end
rts
; end sub titles_s_update
} ; !zone
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/pack5.adb
|
best08618/asylo
| 7 |
7831
|
-- { dg-do compile }
procedure Pack5 is
type Kind is (v1, v2, v3);
type Error (k : Kind := Kind'First) is record
case k is
when v1 =>
null;
when v2 =>
null;
when Others =>
B : Boolean;
end case;
end record;
pragma Pack (Error);
for Error'Size use 16;
No_Error: constant Error := (k => v2);
type R (B : Boolean) is record
E : Error;
end record;
pragma Pack(R);
type Ptr is access R;
C : Ptr := new R (True);
begin
C.E := No_Error;
end;
|
Cubical/Relation/Nullary/DecidableEq.agda
|
limemloh/cubical
| 0 |
13453
|
{-# OPTIONS --cubical --safe #-}
module Cubical.Relation.Nullary.DecidableEq where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Data.Empty
open import Cubical.Relation.Nullary
-- Proof of Hedberg's theorem: a type with decidable equality is an h-set
Dec→Stable : ∀ {ℓ} (A : Type ℓ) → Dec A → Stable A
Dec→Stable A (yes x) = λ _ → x
Dec→Stable A (no x) = λ f → ⊥-elim (f x)
Stable≡→isSet : ∀ {ℓ} {A : Type ℓ} → (st : ∀ (a b : A) → Stable (a ≡ b)) → isSet A
Stable≡→isSet {A = A} st a b p q j i =
let f : (x : A) → a ≡ x → a ≡ x
f x p = st a x (λ h → h p)
fIsConst : (x : A) → (p q : a ≡ x) → f x p ≡ f x q
fIsConst = λ x p q i → st a x (isProp¬ _ (λ h → h p) (λ h → h q) i)
rem : (p : a ≡ b) → PathP (λ i → a ≡ p i) (f a refl) (f b p)
rem p j = f (p j) (λ i → p (i ∧ j))
in hcomp (λ k → λ { (i = i0) → f a refl k
; (i = i1) → fIsConst b p q j k
; (j = i0) → rem p i k
; (j = i1) → rem q i k }) a
-- Hedberg's theorem
Discrete→isSet : ∀ {ℓ} {A : Type ℓ} → Discrete A → isSet A
Discrete→isSet d = Stable≡→isSet (λ x y → Dec→Stable (x ≡ y) (d x y))
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_1456_488.asm
|
ljhsiun2/medusa
| 9 |
246040
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r15
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1b80c, %rax
nop
nop
nop
sub %r11, %r11
mov (%rax), %r12
nop
sub %r11, %r11
lea addresses_WT_ht+0x1294c, %rsi
lea addresses_A_ht+0xa0c, %rdi
nop
nop
nop
nop
cmp %r15, %r15
mov $97, %rcx
rep movsl
and %rax, %rax
lea addresses_UC_ht+0x420c, %r11
nop
nop
nop
nop
cmp %r12, %r12
mov (%r11), %cx
nop
nop
nop
nop
cmp $62331, %rax
lea addresses_A_ht+0x380c, %rsi
lea addresses_WT_ht+0xef4c, %rdi
nop
nop
nop
nop
dec %rbx
mov $67, %rcx
rep movsl
nop
nop
nop
nop
nop
sub $33810, %rdi
lea addresses_A_ht+0x1db0c, %r15
nop
nop
nop
nop
nop
sub %r11, %r11
mov $0x6162636465666768, %r12
movq %r12, %xmm2
vmovups %ymm2, (%r15)
nop
nop
inc %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_normal+0xa00c, %rsi
lea addresses_WT+0xaa85, %rdi
sub %rbx, %rbx
mov $55, %rcx
rep movsl
nop
nop
nop
nop
nop
and $40750, %rdi
// Faulty Load
lea addresses_UC+0x1280c, %rbx
nop
nop
nop
nop
and %rbp, %rbp
mov (%rbx), %ecx
lea oracles, %r14
and $0xff, %rcx
shlq $12, %rcx
mov (%r14,%rcx,1), %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT', 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'37': 1456}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
|
awa/plugins/awa-questions/src/awa-questions-beans.adb
|
Letractively/ada-awa
| 0 |
8907
|
<filename>awa/plugins/awa-questions/src/awa-questions-beans.adb
-----------------------------------------------------------------------
-- awa-questions-beans -- Beans for module questions
-- Copyright (C) 2012, 2013 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ADO.Queries;
with ADO.Utils;
with ADO.Sessions;
with ADO.Sessions.Entities;
with Util.Beans.Lists.Strings;
with AWA.Tags.Modules;
with AWA.Services.Contexts;
package body AWA.Questions.Beans is
package ASC renames AWA.Services.Contexts;
-- ------------------------------
-- Get the value identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Question_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "tags" then
return Util.Beans.Objects.To_Object (From.Tags_Bean, Util.Beans.Objects.STATIC);
elsif From.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return AWA.Questions.Models.Question_Bean (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name.
-- ------------------------------
overriding
procedure Set_Value (From : in out Question_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "title" then
From.Set_Title (Util.Beans.Objects.To_String (Value));
elsif Name = "description" then
From.Set_Description (Util.Beans.Objects.To_String (Value));
elsif Name = "id" and not Util.Beans.Objects.Is_Empty (Value) then
declare
Ctx : constant ASC.Service_Context_Access := AWA.Services.Contexts.Current;
DB : constant ADO.Sessions.Session := AWA.Services.Contexts.Get_Session (Ctx);
Id : constant ADO.Identifier := ADO.Utils.To_Identifier (Value);
begin
From.Service.Load_Question (From, Id);
From.Tags.Load_Tags (DB, Id);
end;
end if;
end Set_Value;
-- ------------------------------
-- Create or save the question.
-- ------------------------------
procedure Save (Bean : in out Question_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
pragma Unreferenced (Outcome);
begin
Bean.Service.Save_Question (Bean);
Bean.Tags.Update_Tags (Bean.Get_Id);
end Save;
-- ------------------------------
-- Delete the question.
-- ------------------------------
procedure Delete (Bean : in out Question_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
pragma Unreferenced (Outcome);
begin
Bean.Service.Delete_Question (Bean);
end Delete;
-- ------------------------------
-- Create the Question_Bean bean instance.
-- ------------------------------
function Create_Question_Bean (Module : in AWA.Questions.Modules.Question_Module_Access)
return Util.Beans.Basic.Readonly_Bean_Access is
Object : constant Question_Bean_Access := new Question_Bean;
begin
Object.Service := Module;
Object.Tags_Bean := Object.Tags'Access;
Object.Tags.Set_Entity_Type (AWA.Questions.Models.QUESTION_TABLE);
Object.Tags.Set_Permission ("question-edit");
return Object.all'Access;
end Create_Question_Bean;
-- Get the value identified by the name.
overriding
function Get_Value (From : in Answer_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "question_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Question.Get_Id));
elsif From.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return AWA.Questions.Models.Answer_Bean (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name.
-- ------------------------------
overriding
procedure Set_Value (From : in out Answer_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" and not Util.Beans.Objects.Is_Empty (Value) then
From.Service.Load_Answer (From, From.Question,
ADO.Utils.To_Identifier (Value));
elsif Name = "answer" then
From.Set_Answer (Util.Beans.Objects.To_String (Value));
elsif Name = "question_id" and not Util.Beans.Objects.Is_Null (Value) then
From.Service.Load_Question (From.Question,
ADO.Utils.To_Identifier (Value));
end if;
end Set_Value;
-- ------------------------------
-- Create or save the answer.
-- ------------------------------
procedure Save (Bean : in out Answer_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
pragma Unreferenced (Outcome);
begin
Bean.Service.Save_Answer (Question => Bean.Question,
Answer => Bean);
end Save;
-- ------------------------------
-- Delete the question.
-- ------------------------------
procedure Delete (Bean : in out Answer_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
pragma Unreferenced (Outcome);
begin
Bean.Service.Delete_Answer (Answer => Bean);
end Delete;
-- ------------------------------
-- Create the answer bean instance.
-- ------------------------------
function Create_Answer_Bean (Module : in AWA.Questions.Modules.Question_Module_Access)
return Util.Beans.Basic.Readonly_Bean_Access is
Object : constant Answer_Bean_Access := new Answer_Bean;
begin
Object.Service := Module;
return Object.all'Access;
end Create_Answer_Bean;
-- ------------------------------
-- Get the value identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Question_List_Bean;
Name : in String) return Util.Beans.Objects.Object is
Pos : Natural;
begin
if Name = "tags" then
Pos := From.Questions.Get_Row_Index;
if Pos = 0 then
return Util.Beans.Objects.Null_Object;
end if;
declare
Item : constant Models.Question_Info := From.Questions.List.Element (Pos - 1);
begin
return From.Tags.Get_Tags (Item.Id);
end;
elsif Name = "questions" then
return Util.Beans.Objects.To_Object (Value => From.Questions_Bean,
Storage => Util.Beans.Objects.STATIC);
elsif Name = "tag" then
return Util.Beans.Objects.To_Object (From.Tag);
else
return From.Questions.Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name.
-- ------------------------------
overriding
procedure Set_Value (From : in out Question_List_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "tag" then
From.Tag := Util.Beans.Objects.To_Unbounded_String (Value);
From.Load_List;
end if;
end Set_Value;
-- ------------------------------
-- Load the list of question. If a tag was set, filter the list of questions with the tag.
-- ------------------------------
procedure Load_List (Into : in out Question_List_Bean) is
use AWA.Questions.Models;
use AWA.Services;
use type ADO.Identifier;
Session : ADO.Sessions.Session := Into.Service.Get_Session;
Query : ADO.Queries.Context;
Tag_Id : ADO.Identifier;
begin
AWA.Tags.Modules.Find_Tag_Id (Session, Ada.Strings.Unbounded.To_String (Into.Tag), Tag_Id);
if Tag_Id /= ADO.NO_IDENTIFIER then
Query.Set_Query (AWA.Questions.Models.Query_Question_Tag_List);
Query.Bind_Param (Name => "tag", Value => Tag_Id);
else
Query.Set_Query (AWA.Questions.Models.Query_Question_List);
end if;
ADO.Sessions.Entities.Bind_Param (Params => Query,
Name => "entity_type",
Table => AWA.Questions.Models.QUESTION_TABLE,
Session => Session);
AWA.Questions.Models.List (Into.Questions, Session, Query);
declare
List : ADO.Utils.Identifier_Vector;
Iter : Question_Info_Vectors.Cursor := Into.Questions.List.First;
begin
while Question_Info_Vectors.Has_Element (Iter) loop
List.Append (Question_Info_Vectors.Element (Iter).Id);
Question_Info_Vectors.Next (Iter);
end loop;
Into.Tags.Load_Tags (Session, AWA.Questions.Models.QUESTION_TABLE.Table.all,
List);
end;
end Load_List;
-- ------------------------------
-- Create the Question_Info_List_Bean bean instance.
-- ------------------------------
function Create_Question_List_Bean (Module : in AWA.Questions.Modules.Question_Module_Access)
return Util.Beans.Basic.Readonly_Bean_Access is
use AWA.Questions.Models;
use AWA.Services;
Object : constant Question_List_Bean_Access := new Question_List_Bean;
-- Session : ADO.Sessions.Session := Module.Get_Session;
-- Query : ADO.Queries.Context;
begin
Object.Service := Module;
Object.Questions_Bean := Object.Questions'Unchecked_Access;
-- Query.Set_Query (AWA.Questions.Models.Query_Question_List);
-- ADO.Sessions.Entities.Bind_Param (Params => Query,
-- Name => "entity_type",
-- Table => AWA.Questions.Models.QUESTION_TABLE,
-- Session => Session);
-- AWA.Questions.Models.List (Object.Questions, Session, Query);
Object.Load_List;
return Object.all'Access;
end Create_Question_List_Bean;
-- ------------------------------
-- Get the value identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Question_Display_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "answers" then
return Util.Beans.Objects.To_Object (Value => From.Answer_List_Bean,
Storage => Util.Beans.Objects.STATIC);
elsif Name = "question" then
return Util.Beans.Objects.To_Object (Value => From.Question_Bean,
Storage => Util.Beans.Objects.STATIC);
elsif Name = "tags" then
return Util.Beans.Objects.To_Object (Value => From.Tags_Bean,
Storage => Util.Beans.Objects.STATIC);
else
return Util.Beans.Objects.Null_Object;
end if;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name.
-- ------------------------------
overriding
procedure Set_Value (From : in out Question_Display_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" and not Util.Beans.Objects.Is_Empty (Value) then
declare
package ASC renames AWA.Services.Contexts;
use AWA.Questions.Models;
use AWA.Services;
Session : ADO.Sessions.Session := From.Service.Get_Session;
Query : ADO.Queries.Context;
List : AWA.Questions.Models.Question_Display_Info_List_Bean;
Ctx : constant ASC.Service_Context_Access := ASC.Current;
Id : constant ADO.Identifier := ADO.Utils.To_Identifier (Value);
begin
Query.Set_Query (AWA.Questions.Models.Query_Question_Info);
Query.Bind_Param ("question_id", Id);
Query.Bind_Param ("user_id", Ctx.Get_User_Identifier);
ADO.Sessions.Entities.Bind_Param (Params => Query,
Name => "entity_type",
Table => AWA.Questions.Models.QUESTION_TABLE,
Session => Session);
AWA.Questions.Models.List (List, Session, Query);
if not List.List.Is_Empty then
From.Question := List.List.Element (0);
end if;
Query.Clear;
Query.Bind_Param ("question_id", Util.Beans.Objects.To_Integer (Value));
Query.Bind_Param ("user_id", Ctx.Get_User_Identifier);
ADO.Sessions.Entities.Bind_Param (Params => Query,
Name => "entity_type",
Table => AWA.Questions.Models.ANSWER_TABLE,
Session => Session);
Query.Set_Query (AWA.Questions.Models.Query_Answer_List);
AWA.Questions.Models.List (From.Answer_List, Session, Query);
-- Load the tags if any.
From.Tags.Load_Tags (Session, Id);
end;
end if;
end Set_Value;
-- ------------------------------
-- Create the Question_Display_Bean bean instance.
-- ------------------------------
function Create_Question_Display_Bean (Module : in AWA.Questions.Modules.Question_Module_Access)
return Util.Beans.Basic.Readonly_Bean_Access is
Object : constant Question_Display_Bean_Access := new Question_Display_Bean;
begin
Object.Service := Module;
Object.Question_Bean := Object.Question'Access;
Object.Answer_List_Bean := Object.Answer_List'Access;
Object.Tags_Bean := Object.Tags'Access;
Object.Tags.Set_Entity_Type (AWA.Questions.Models.QUESTION_TABLE);
return Object.all'Access;
end Create_Question_Display_Bean;
end AWA.Questions.Beans;
|
kb-code.asm
|
Unshifted1337/Nand2Tris-Hack
| 0 |
244941
|
<gh_stars>0
//Keyboard code
//Author: Unshifted1337
@KBD
D=M
@R0
M=D
@48
D=A
@R0
M=M-D
@KBD
D=M
@R1
M=D
@48
D=A
@R0
M=M-D
@0
D=M
@2
M=D
@1
D=M
@2
M=D+M
@24
0;JMP
|
source/command_line.adb
|
jquorning/WeDo
| 1 |
24901
|
<gh_stars>1-10
--
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May you do good and not evil.
-- May you find forgiveness for yourself and forgive others.
-- May you share freely, not taking more than you give.
--
with Ada.Text_IO;
package body Command_Line is
procedure Parse (Config : in out Setup.Configuration)
is
pragma Unreferenced (Config);
use Ada.Command_Line;
begin
if Argument_Count = 1 then
if Argument (1) = "--version" then
Put_Version;
raise Terminate_Program;
elsif Argument (1) = "--help" then
Put_Usage;
raise Terminate_Program;
else
Put_Usage;
raise Terminate_Program;
end if;
else
null;
-- Normal program run
end if;
end Parse;
procedure Put_Usage
is
use Ada.Text_IO;
Program_Name : constant String := Setup.Program_Name;
begin
Put_Line ("The program " & Program_Name & " manages your " &
"projects and activities via web page.");
New_Line;
Put_Line ("$ " & Program_Name & " [--port=PORT] [--dir=DIR]");
Put_Line ("$ " & Program_Name & " --version");
Put_Line ("$ " & Program_Name & " --help");
New_Line;
Put_Line ("--help - Show this usage text and exit");
Put_Line ("--version - Show program version and exit");
Put_Line ("--port=PORT - Web server port (Default 8080)");
Put_Line ("--dir=DIR - Colletion directory (Default current dir)");
New_Line;
Put_Line ("safari http://localhost:8080 - Web server port");
New_Line;
end Put_Usage;
procedure Put_Version is
use Setup, Ada.Text_IO;
begin
Put (Program_Name & " (" & Program_Version & ")");
Put ("Build (" & Build_ISO8601_UTC & ")");
end Put_Version;
end Command_Line;
|
src/test_led_pwm.adb
|
JCGobbi/Nucleo-STM32G474RE
| 0 |
12332
|
-- This demonstration illustrates the use of PWM to control the brightness of
-- an LED. The effect is to make the LED increase and decrease in brightness,
-- iteratively, for as long as the application runs. In effect the LED light
-- waxes and wanes as function of a PWM sine wave generated with the CORDIC
-- coprocessor.
--
-- The demo uses an abstract data type PWM_Modulator to control the power to
-- the LED via pulse-width-modulation. A timer is still used underneath, but
-- the details are hidden. For direct use of the timer see the other demo.
with HAL; use HAL;
with STM32.Device; use STM32.Device;
with STM32.Timers; use STM32.Timers;
with STM32.PWM; use STM32.PWM;
with STM32.CORDIC.Polling; use STM32.CORDIC;
with STM_Board; use STM_Board;
with Last_Chance_Handler; pragma Unreferenced (Last_Chance_Handler);
-- The "last chance handler" is the user-defined routine that is called when
-- an exception is propagated. We need it in the executable, therefore it
-- must be somewhere in the closure of the context clauses.
procedure Test_LED_PWM is
-- The LD2 green led at GPIO PA5 is the TIM2_CH1 timer output when
-- programmed as AF1 alternate function.
Selected_Timer : Timer renames Timer_2;
Timer_AF : constant STM32.GPIO_Alternate_Function := GPIO_AF_TIM2_1;
Output_Channel : constant Timer_Channel := Channel_1;
Requested_Frequency : constant Hertz := 25_000;
Power_Control : PWM_Modulator;
begin
Configure_PWM_Timer (Selected_Timer'Access, Requested_Frequency);
Power_Control.Attach_PWM_Channel
(Selected_Timer'Access,
Channel => Output_Channel,
Point => Green_LED,
PWM_AF => Timer_AF);
Power_Control.Enable_Output;
-- Configure CORDIC coprocessor with sine function
Enable_Clock (CORDIC_Unit);
Configure_CORDIC_Coprocessor
(CORDIC_Unit,
Operation => Sine,
Precision => Iteration_12,
Data_Size => Data_32_Bit);
declare
-- The CORDIC operates in fixed point signed integer format. Input and
-- output values can be either q1.31 or q1.15.
-- In q1.31 format, numbers are represented by one sign bit and 31
-- fractional bits (binary decimal places). The numeric range is
-- therefore -1 (0x80000000) to 1 - 2**(-31) (0x7FFFFFFF).
-- In q1.15 format, the numeric range is 1 (0x8000) to 1 - 2**(-15)
-- (0x7FFF).
Angle : Q1_31 := -0.5;
-- The start angle is -0.5, that corresponds to -Pi/2, so with sine
-- funtion the LED start off.
Modulus : constant UInt32 := 16#7FFFFFFF#; -- 1 - 2**(-31)
-- For sine function, the first argument is the angle, while the second
-- argument is the modulus, that in this case doesn't change.
Increment : Q1_31 := 1.0 / 4_194_304; -- = 1.0 / 2**22
-- This value must be a multiple of delta (2.0**(-31)).
-- The Increment value controls the rate at which the brightness
-- increases and decreases and depends on the CPU clock frequency.
Data_In : UInt32_Array := (Q1_31_To_UInt32 (Angle), Modulus);
-- The sine function goes from -1.0 to 0.0 to 1.0 in a complete sine
-- period, that corresponds to -Pi to 0 to Pi.
Data_Out : UInt32_Array := (0, 0);
Value : Percentage;
begin
loop
-- Calculate sine function
Polling.Calculate_CORDIC_Function
(CORDIC_Unit,
Argument => Data_In,
Result => Data_Out);
-- The input (WDATA) and output (RDATA) data of the CORDIC uses UInt32
-- to represent the fixed point values. So we need to convert the type
-- Fraction_32 to UInt32 and vice-versa.
Value := Percentage (100.0 * (Float (UInt32_To_Q1_31 (Data_Out (1)))));
Power_Control.Set_Duty_Cycle (Value);
-- Data input to CORDIC must be between -1.0 and 1.0 - 1 / 2**(-31),
-- and this corresponds to -pi and pi. The value calculation considers
-- that the LED is OFF when the Angle is -0.5 (-Pi/2), it is half
-- bright when the Angle is 0 and it is ON when the Angle is 0.5 (Pi/2).
-- When the angle value reaches any of these maximum, it must be
-- incremented/decremented.
if (Angle + Increment > 0.5) or (Angle + Increment < -0.5) then
Increment := -Increment;
end if;
Angle := Angle + Increment;
-- Write the new angle value into the first position of the buffer.
Data_In (1) := Q1_31_To_UInt32 (Angle);
end loop;
end;
end Test_LED_PWM;
|
src/_for_debug_purposes/apsepp-debug_trace.ads
|
thierr26/ada-apsepp
| 0 |
28231
|
<filename>src/_for_debug_purposes/apsepp-debug_trace.ads
-- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
with Apsepp.Generic_Shared_Instance;
with Apsepp.Debug_Trace_Class; use Apsepp.Debug_Trace_Class;
package Apsepp.Debug_Trace is
package Shared_Instance
is new Generic_Shared_Instance (Debug_Trace_Interfa);
subtype Debug_Trace_Access is Shared_Instance.Instance_Type_Access;
function Debug_Trace return Debug_Trace_Access
renames Shared_Instance.Instance;
end Apsepp.Debug_Trace;
|
Cubical/HITs/Susp/Properties.agda
|
Schippmunk/cubical
| 0 |
10
|
<filename>Cubical/HITs/Susp/Properties.agda
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.Susp.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Path
open import Cubical.Data.Bool
open import Cubical.HITs.Join
open import Cubical.HITs.Susp.Base
open Iso
Susp-iso-joinBool : ∀ {ℓ} {A : Type ℓ} → Iso (Susp A) (join A Bool)
fun Susp-iso-joinBool north = inr true
fun Susp-iso-joinBool south = inr false
fun Susp-iso-joinBool (merid a i) = (sym (push a true) ∙ push a false) i
inv Susp-iso-joinBool (inr true ) = north
inv Susp-iso-joinBool (inr false) = south
inv Susp-iso-joinBool (inl _) = north
inv Susp-iso-joinBool (push a true i) = north
inv Susp-iso-joinBool (push a false i) = merid a i
rightInv Susp-iso-joinBool (inr true ) = refl
rightInv Susp-iso-joinBool (inr false) = refl
rightInv Susp-iso-joinBool (inl a) = sym (push a true)
rightInv Susp-iso-joinBool (push a true i) j = push a true (i ∨ ~ j)
rightInv Susp-iso-joinBool (push a false i) j
= hcomp (λ k → λ { (i = i0) → push a true (~ j)
; (i = i1) → push a false k
; (j = i1) → push a false (i ∧ k) })
(push a true (~ i ∧ ~ j))
leftInv Susp-iso-joinBool north = refl
leftInv Susp-iso-joinBool south = refl
leftInv (Susp-iso-joinBool {A = A}) (merid a i) j
= hcomp (λ k → λ { (i = i0) → transp (λ _ → Susp A) (k ∨ j) north
; (i = i1) → transp (λ _ → Susp A) (k ∨ j) (merid a k)
; (j = i1) → merid a (i ∧ k) })
(transp (λ _ → Susp A) j north)
Susp≃joinBool : ∀ {ℓ} {A : Type ℓ} → Susp A ≃ join A Bool
Susp≃joinBool = isoToEquiv Susp-iso-joinBool
Susp≡joinBool : ∀ {ℓ} {A : Type ℓ} → Susp A ≡ join A Bool
Susp≡joinBool = isoToPath Susp-iso-joinBool
congSuspEquiv : ∀ {ℓ} {A B : Type ℓ} → A ≃ B → Susp A ≃ Susp B
congSuspEquiv {ℓ} {A} {B} h = isoToEquiv isom
where isom : Iso (Susp A) (Susp B)
Iso.fun isom north = north
Iso.fun isom south = south
Iso.fun isom (merid a i) = merid (fst h a) i
Iso.inv isom north = north
Iso.inv isom south = south
Iso.inv isom (merid a i) = merid (invEq h a) i
Iso.rightInv isom north = refl
Iso.rightInv isom south = refl
Iso.rightInv isom (merid a i) j = merid (retEq h a j) i
Iso.leftInv isom north = refl
Iso.leftInv isom south = refl
Iso.leftInv isom (merid a i) j = merid (secEq h a j) i
suspToPropElim : ∀ {ℓ ℓ'} {A : Type ℓ} {B : Susp A → Type ℓ'} (a : A)
→ ((x : Susp A) → isProp (B x))
→ B north
→ (x : Susp A) → B x
suspToPropElim a isProp Bnorth north = Bnorth
suspToPropElim {B = B} a isProp Bnorth south = subst B (merid a) Bnorth
suspToPropElim {B = B} a isProp Bnorth (merid a₁ i) =
isOfHLevel→isOfHLevelDep 1 isProp Bnorth (subst B (merid a) Bnorth) (merid a₁) i
suspToPropElim2 : ∀ {ℓ ℓ'} {A : Type ℓ} {B : Susp A → Susp A → Type ℓ'} (a : A)
→ ((x y : Susp A) → isProp (B x y))
→ B north north
→ (x y : Susp A) → B x y
suspToPropElim2 _ _ Bnorth north north = Bnorth
suspToPropElim2 {B = B} a _ Bnorth north south = subst (B north) (merid a) Bnorth
suspToPropElim2 {B = B} a isprop Bnorth north (merid x i) =
isProp→PathP (λ i → isprop north (merid x i))
Bnorth (subst (B north) (merid a) Bnorth) i
suspToPropElim2 {B = B} a _ Bnorth south north = subst (λ x → B x north) (merid a) Bnorth
suspToPropElim2 {B = B} a _ Bnorth south south = subst (λ x → B x x) (merid a) Bnorth
suspToPropElim2 {B = B} a isprop Bnorth south (merid x i) =
isProp→PathP (λ i → isprop south (merid x i))
(subst (λ x → B x north) (merid a) Bnorth)
(subst (λ x → B x x) (merid a) Bnorth) i
suspToPropElim2 {B = B} a isprop Bnorth (merid x i) north =
isProp→PathP (λ i → isprop (merid x i) north)
Bnorth (subst (λ x → B x north) (merid a) Bnorth) i
suspToPropElim2 {B = B} a isprop Bnorth (merid x i) south =
isProp→PathP (λ i → isprop (merid x i) south)
(subst (B north) (merid a) Bnorth)
(subst (λ x → B x x) (merid a) Bnorth) i
suspToPropElim2 {B = B} a isprop Bnorth (merid x i) (merid y j) =
isSet→SquareP (λ i j → isOfHLevelSuc 1 (isprop _ _))
(isProp→PathP (λ i₁ → isprop north (merid y i₁)) Bnorth
(subst (B north) (merid a) Bnorth))
(isProp→PathP (λ i₁ → isprop south (merid y i₁))
(subst (λ x₁ → B x₁ north) (merid a) Bnorth)
(subst (λ x₁ → B x₁ x₁) (merid a) Bnorth))
(isProp→PathP (λ i₁ → isprop (merid x i₁) north) Bnorth
(subst (λ x₁ → B x₁ north) (merid a) Bnorth))
(isProp→PathP (λ i₁ → isprop (merid x i₁) south)
(subst (B north) (merid a) Bnorth)
(subst (λ x₁ → B x₁ x₁) (merid a) Bnorth)) i j
{- Clever proof:
suspToPropElim2 a isProp Bnorth =
suspToPropElim a (λ x → isOfHLevelΠ 1 λ y → isProp x y)
(suspToPropElim a (λ x → isProp north x) Bnorth)
-}
|
programs/oeis/151/A151974.asm
|
neoneye/loda
| 22 |
170254
|
<filename>programs/oeis/151/A151974.asm<gh_stars>10-100
; A151974: a(n) = n*(n+1)*(n+2)*(n+3)*(n+4)/8.
; 0,15,90,315,840,1890,3780,6930,11880,19305,30030,45045,65520,92820,128520,174420,232560,305235,395010,504735,637560,796950,986700,1210950,1474200,1781325,2137590,2548665,3020640,3560040,4173840,4869480
add $0,4
bin $0,5
mul $0,15
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt25_pkg1.adb
|
best08618/asylo
| 7 |
15329
|
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt25_pkg1.adb
package body Opt25_Pkg1 is
procedure Swap (A, B : in out T) is
Tmp : T := A;
begin
A := B;
B := Tmp;
end Swap;
end Opt25_Pkg1;
|
programs/oeis/132/A132770.asm
|
neoneye/loda
| 22 |
176476
|
<reponame>neoneye/loda<filename>programs/oeis/132/A132770.asm
; A132770: a(n) = n*(n + 28).
; 0,29,60,93,128,165,204,245,288,333,380,429,480,533,588,645,704,765,828,893,960,1029,1100,1173,1248,1325,1404,1485,1568,1653,1740,1829,1920,2013,2108,2205,2304,2405,2508,2613,2720,2829,2940,3053,3168,3285,3404,3525
mov $1,$0
add $1,28
mul $0,$1
|
asm/floatingPoint/approxRoot.asm
|
IronHeart7334/AssemblyPrograms
| 0 |
240613
|
<reponame>IronHeart7334/AssemblyPrograms
; general comments
; This algorithm approximates the cube root of a real number x:
; root := 1.0
; until ( |root - oldRoot| < smallValue ) loop
; oldRoot := root
; root := (2.0*root + x/(root*root)) / 3.0
; end until
; Write a console32 Assembly Language program to approximate the cube root of a real number.
; preprocessor directives
.586
.MODEL FLAT
; external files to link with
; stack configuration
.STACK 4096
; named memory allocation and initialization
.DATA
root REAL4 1.0
oldRoot REAL4 0.0
_x REAL4 3.12
smallValue REAL4 0.0001
three REAL4 3.0
; names of procedures defined in other *.asm files in the project
; procedure code
.CODE
main PROC
checkLoopCondition: ; ST(0) | ST(1)
finit ; ~~~ ~~~
fld root ; root ~~~
fld oldRoot ; oldRoot root
fsub ; root - oldRoot ~~~
fabs ; | root - oldRoot | ~~~
fld smallValue ; smallValue | root - oldRoot |
fcom
fstsw AX
sahf
ja endLoop ; checks if smallValue > | root - oldRoot |
loopBody: ; ignore the values currently in ST(0) and ST(1)
; Instruction | ST(0) | ST(1) | ST(2)
fld root ; root | ~~~ | ~~~
fst oldRoot ; root | ~~~ | ~~~
fld root ; root | root | ~~~
fmul ; root^2 | ~~~ | ~~~
fld _x ; x | root^2 | ~~~
fdivr ; x/(root^2) | ~~~ | ~~~
fld root ; root | x/(root^2) | ~~~
fld root ; root | root | x/(root^2)
fadd ; 2*root | x/(root^2) | ~~~
fadd ; 2*root + x/(root^2) | ~~~ | ~~~
fld three ; 3.0 | 2*root + x/(root^2) | ~~~
fdiv ; (2*root + x/(root^2)) / 3 | ~~~ | ~~~
fstp root ; ~~~ | ~~~ | ~~~
jmp checkLoopCondition
endLoop:
; done
mov EAX, 0
ret
main ENDP
END
|
src/nnclassifier.adb
|
sebsgit/textproc
| 0 |
9952
|
with Ada.Text_IO;
package body NNClassifier is
function create(config: NeuralNet.Config; numberOfClasses: Positive) return DNN is
result: DNN(config.size + 1);
configWithLogits: NeuralNet.Config(config.size + 1);
begin
configWithLogits.act := config.act;
configWithLogits.lr := config.lr;
configWithLogits.inputSize := config.inputSize;
configWithLogits.gradientClipAbs := config.gradientClipAbs;
for i in 1 .. config.size loop
configWithLogits.sizes(i) := config.sizes(i);
end loop;
configWithLogits.sizes(configWithLogits.sizes'Length) := numberOfClasses;
result.labelCount := numberOfClasses;
result.nn := NeuralNet.create(configWithLogits);
return result;
end create;
function oneHotEncode(label: Natural; labelCount: Positive) return MathUtils.Vector
with Pre => label < labelCount
is
result: MathUtils.Vector;
begin
result.Set_Length(Ada.Containers.Count_Type(labelCount));
for x of result loop
x := 0.0;
end loop;
result(label + 1) := 1.0;
return result;
end oneHotEncode;
procedure print(nn: in DNN) is
begin
nn.nn.print;
end print;
procedure train(nn: in out DNN; data: in DataBatch.Batch; labels: in LabelVector) is
li: Positive;
target: MathUtils.Vector;
begin
li := labels.First_Index;
for vec of data.data loop
target := oneHotEncode(labels(li), nn.labelCount);
nn.nn.train(input => vec,
target => target);
li := li + 1;
end loop;
end train;
function classify(nn: in out DNN; vec: MathUtils.Vector) return MathUtils.Vector is
result: MathUtils.Vector;
begin
result := nn.nn.forward(vec);
MathUtils.multiply(result, 10.0);
MathUtils.softmax(result);
return result;
end classify;
end NNClassifier;
|
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver1/sfc/ys_w65.asm
|
prismotizm/gigaleak
| 0 |
247524
|
<gh_stars>0
Name: ys_w65.asm
Type: file
Size: 19208
Last-Modified: '2016-05-13T04:51:16Z'
SHA-1: A25396919ADD9E81E87BA85A9DA47FA81E8C8FAA
Description: null
|
programs/oeis/134/A134012.asm
|
karttu/loda
| 1 |
167013
|
<reponame>karttu/loda
; A134012: Period 5: repeat 1, 6, 11, 6, 1.
; 1,6,11,6,1,1,6,11,6,1,1,6,11,6,1,1,6,11,6,1,1,6,11,6,1,1,6,11,6,1,1,6,11,6,1,1,6,11,6,1,1,6,11,6,1,1,6,11,6,1,1,6,11,6,1
mod $0,5
gcd $0,4
mod $0,4
mov $1,$0
mul $1,5
add $1,1
|
src/kernel/drivers/soc/watchdog_cseg.asm
|
rostislav-nikitin/socOS
| 1 |
104583
|
;=======================================================================================================================
; ;
; Name: socOS (System On Chip Operation System) ;
; Year: 2020 ;
; License: MIT License ;
; ;
;=======================================================================================================================
; Require:
;.include "m8def.inc"
;.include "kernel/kernel_def.asm"
;.include "kernel/drivers/device_def.asm"
;.include "kernel/kernel_cseg.asm"
;.include "kernel/drivers/device_cseg.asm"
; code region
.macro m_watchdog_init
; input parameters:
; @0 byte watchdog_timeout (enumeration)
; save registers
m_save_r23_registers
; push timeout parameter
ldi r23, @0
rcall watchdog_init
m_restore_r23_registers
.endm
.macro m_watchdog_init_default
; default timeout is 2.2ms
m_watchdog_init WATCHDOG_DEFAULT_TIMEOUT
.endm
watchdog_init:
; input parameters:
; r23 byte watchdog_timeout (enumeration)
m_save_r16_r23_SREG_registers
rcall device_init
ori r23, (1 << WDE)
out WDTCR, r23
m_restore_r16_r23_SREG_registers
ret
|
programs/oeis/302/A302048.asm
|
karttu/loda
| 0 |
101281
|
<reponame>karttu/loda<gh_stars>0
; A302048: a(n) = 1 if n = p^2 for some prime p, otherwise 0. Characteristic function of squares of primes (A001248).
; 0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
sub $0,1
cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
mov $1,3
cmp $1,$0
pow $0,4
bin $0,$1
div $0,2
mul $0,2
mov $1,$0
div $1,80
|
Ada/inc/Problem_59.ads
|
Tim-Tom/project-euler
| 0 |
9463
|
<gh_stars>0
package Problem_59 is
-- Each character on a computer is assigned a unique code and the preferred
-- standard is ASCII (American Standard Code for Information
-- Interchange). For example, uppercase A = 65, asterisk (*) = 42, and
-- lowercase k = 107.
--
-- A modern encryption method is to take a text file, convert the bytes to
-- ASCII, then XOR each byte with a given value, taken from a secret
-- key. The advantage with the XOR function is that using the same
-- encryption key on the cipher text, restores the plain text; for example,
-- 65 XOR 42 = 107, then 107 XOR 42 = 65.
--
-- For unbreakable encryption, the key is the same length as the plain text
-- message, and the key is made up of random bytes. The user would keep the
-- encrypted message and the encryption key in different locations, and
-- without both "halves", it is impossible to decrypt the message.
--
-- Unfortunately, this method is impractical for most users, so the modified
-- method is to use a password as a key. If the password is shorter than the
-- message, which is likely, the key is repeated cyclically throughout the
-- message. The balance for this method is using a sufficiently long
-- password key for security, but short enough to be memorable.
--
-- Your task has been made easy, as the encryption key consists of three
-- lower case characters. Using cipher1.txt, a file containing the encrypted
-- ASCII codes, and the knowledge that the plain text must contain common
-- English words, decrypt the message and find the sum of the ASCII values
-- in the original text.
procedure Solve;
end Problem_59;
|
Transynther/x86/_processed/US/_st_zr_/i3-7100_9_0x84_notsx.log_16812_1640.asm
|
ljhsiun2/medusa
| 9 |
3014
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r14
push %rbx
push %rcx
push %rdi
lea addresses_D_ht+0x1c639, %r10
nop
nop
nop
cmp $21834, %rcx
movb (%r10), %r14b
nop
lfence
lea addresses_normal_ht+0x11139, %rbx
nop
nop
nop
sub %r11, %r11
mov $0x6162636465666768, %rdi
movq %rdi, %xmm4
vmovups %ymm4, (%rbx)
nop
nop
nop
nop
inc %rcx
lea addresses_WT_ht+0xd96d, %rcx
xor %r11, %r11
mov (%rcx), %r10
nop
nop
dec %r10
lea addresses_WC_ht+0xf3b9, %r11
nop
nop
inc %rbx
mov (%r11), %rcx
xor %rcx, %rcx
pop %rdi
pop %rcx
pop %rbx
pop %r14
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
// Load
lea addresses_UC+0x5239, %r10
nop
nop
nop
sub %r13, %r13
movups (%r10), %xmm7
vpextrq $0, %xmm7, %rdi
and $58556, %rsi
// Load
lea addresses_normal+0x1d7de, %r9
nop
nop
nop
and %rax, %rax
movb (%r9), %r10b
nop
nop
sub %r13, %r13
// Load
lea addresses_UC+0x6639, %rsi
nop
nop
nop
xor %rax, %rax
movups (%rsi), %xmm0
vpextrq $1, %xmm0, %r9
add $62712, %r13
// REPMOV
lea addresses_US+0x13221, %rsi
lea addresses_UC+0x8639, %rdi
sub %rdx, %rdx
mov $54, %rcx
rep movsb
nop
nop
dec %r9
// Store
lea addresses_WC+0x6e5f, %r10
nop
nop
cmp $14677, %rcx
mov $0x5152535455565758, %rdx
movq %rdx, %xmm1
vmovups %ymm1, (%r10)
nop
nop
nop
nop
nop
xor %r13, %r13
// Faulty Load
lea addresses_US+0x9e39, %r13
clflush (%r13)
nop
nop
nop
nop
nop
sub %rax, %rax
movups (%r13), %xmm7
vpextrq $1, %xmm7, %r10
lea oracles, %r9
and $0xff, %r10
shlq $12, %r10
mov (%r9,%r10,1), %r10
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC', 'same': False, 'size': 16, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC', 'same': False, 'size': 16, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_US', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_US', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'same': True, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'37': 16775, '00': 37}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
|
CyBRICS/2021/rev/Listing/listing.asm
|
ruhan-islam/ctf-archives
| 1 |
24781
|
BITS 64
global check
section .text
check:
mov rbp, rsp
sub rsp, 0x100
VMOVDQA ymm0, [rdi]
and rsp, 0xffffffffffffff00
mov rax, 0xfeca50051345b0b0
push rax
push rax
push rax
push rax
VMOVDQA ymm1, [rsp]
VPXOR ymm2, ymm1, ymm0
mov rax, 0x0100030205040706
push rax
mov rax, 0x09080b0a0c0d0f0e
push rax
mov rax, 0x1110131215141716
push rax
mov rax, 0x19181b1a1c1d1f1e
push rax
VMOVDQA ymm3, [rsp]
VPSHUFB ymm4, ymm2, ymm3
mov rax, 0xd1d3762335619aab
push rax
mov rax, 0xd5d52327356583f8
push rax
mov rax, 0xc9d36127336c85b9
push rax
mov rax,0xd5d622713161cbf8
push rax
VMOVDQA ymm0, [rsp]
VPCMPEQQ ymm1, ymm4, ymm0
VMOVDQA [rsp], ymm1
pop rax
cmp rax, 0xffffffffffffffff
jnz fail
pop rax
cmp rax, 0xffffffffffffffff
jnz fail
pop rax
cmp rax, 0xffffffffffffffff
jnz fail
pop rax
cmp rax, 0xffffffffffffffff
jnz fail
mov rax, 1
jmp fin
fail:
xor rax, rax
fin:
mov rsp, rbp
ret
|
C/BiosLib/swapb.asm
|
p-k-p/SysToolsLib
| 232 |
168749
|
<gh_stars>100-1000
page ,132
;*****************************************************************************;
; ;
; FILE NAME: swapb.asm ;
; ;
; DESCRIPTION: Swap the two bytes of a word ;
; ;
; NOTES: ;
; ;
; HISTORY: ;
; 1995/08/25 JFL Created this file. ;
; ;
; (c) Copyright 1995-2017 Hewlett Packard Enterprise Development LP ;
; Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 ;
;*****************************************************************************;
INCLUDE ADEFINE.INC ; For the macro definitions
.CODE
;-----------------------------------------------------------------------------;
; ;
; Function: reverse / swapb ;
; ;
; Description: Swap bytes ;
; ;
; Parameters: AX Word, which bytes need to be swapped. ;
; ;
; Returns: AX with bytes swapped. ;
; ;
; Notes: ;
; ;
; Regs altered: AX. ;
; ;
; History: ;
; ;
; 1990/12/14 JFL Created routine reverse ;
; 1995/08/25 JFL Created routine swapb ;
; 1995/08/28 JFL Merged the two, and moved them to a separate file. ;
; ;
;-----------------------------------------------------------------------------;
CFASTPROC reverse
CFASTPROC swapb
xchg al, ah
ret
ENDCFASTPROC swapb
ENDCFASTPROC reverse
END
|
src/asis/asis-iterator.ads
|
My-Colaborations/dynamo
| 15 |
359
|
<gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT INTERFACE COMPONENTS --
-- --
-- A S I S . I T E R A T O R --
-- --
-- S p e c --
-- --
-- Copyright (c) 2006, Free Software Foundation, Inc. --
-- --
-- This specification is adapted from the Ada Semantic Interface --
-- Specification Standard (ISO/IEC 15291) for use with GNAT. In accordance --
-- with the copyright of that document, you can freely copy and modify this --
-- specification, provided that if you redistribute a modified version, any --
-- changes that you have made are clearly indicated. The copyright notice --
-- above, and the license provisions that follow apply solely to the --
-- contents of the part following the private keyword. --
-- --
-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adacore.com). --
-- --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- 14 package Asis.Iterator
------------------------------------------------------------------------------
------------------------------------------------------------------------------
package Asis.Iterator is
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Asis.Iterator encapsulates the generic procedure Traverse_Element which
-- allows an ASIS application to perform an iterative traversal of a
-- logical syntax tree. It requires the use of two generic procedures,
-- Pre_Operation, which identifies processing for the traversal, and
-- Post_Operation, which identifies processing after the traversal.
-- The State_Information allows processing state to be passed during the
-- iteration of Traverse_Element.
--
-- Package Asis.Iterator is established as a child package to highlight the
-- iteration capability and to facilitate the translation of ASIS to IDL.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- 14.1 procedure Traverse_Element
------------------------------------------------------------------------------
generic
type State_Information is limited private;
with procedure Pre_Operation
(Element : Asis.Element;
Control : in out Traverse_Control;
State : in out State_Information) is <>;
with procedure Post_Operation
(Element : Asis.Element;
Control : in out Traverse_Control;
State : in out State_Information) is <>;
procedure Traverse_Element
(Element : Asis.Element;
Control : in out Traverse_Control;
State : in out State_Information);
------------------------------------------------------------------------------
-- Element - Specifies the initial element in the traversal
-- Control - Specifies what next to do with the traversal
-- State_Information - Specifies other information for the traversal
--
-- Traverses the element and all its component elements, if any.
-- Component elements are all elements that can be obtained by a combination
-- of the ASIS structural queries appropriate for the given element.
--
-- If an element has one or more component elements, each is called a child
-- element. An element's parent element is its Enclosing_Element. Children
-- with the same parent are sibling elements. The type Traverse_Control uses
-- the terms children and siblings to control the traverse.
--
-- For each element, the formal procedure Pre_Operation is called when first
-- visiting the element. Each of that element's children are then visited
-- and finally the formal procedure Post_Operation is called for the element.
--
-- The order of Element traversal is in terms of the textual representation of
-- the Elements. Elements are traversed in left-to-right and top-to-bottom
-- order.
--
-- Traversal of Implicit Elements:
--
-- Implicit elements are not traversed by default. However, they may be
-- explicitly queried and then passed to the traversal instance. Implicit
-- elements include implicit predefined operator declarations, implicit
-- inherited subprogram declarations, implicit expanded generic specifications
-- and bodies, default expressions supplied to procedure, function, and entry
-- calls, etc.
--
-- Applications that wish to traverse these implicit Elements shall query for
-- them at the appropriate places in a traversal and then recursively call
-- their instantiation of the traversal generic. (Implicit elements provided
-- by ASIS do not cover all possible Ada implicit constructs. For example,
-- implicit initializations for variables of an access type are not provided
-- by ASIS.)
--
-- Traversal of Association lists:
--
-- Argument and association lists for procedure calls, function calls, entry
-- calls, generic instantiations, and aggregates are traversed in their
-- unnormalized forms, as if the Normalized parameter was False for those
-- queries. Implementations that always normalize certain associations may
-- return Is_Normalized associations. See the Implementation Permissions
-- for the queries Discriminant_Associations, Generic_Actual_Part,
-- Call_Statement_Parameters, Record_Component_Associations, or
-- Function_Call_Parameters.
--
-- Applications that wish to explicitly traverse normalized associations can
-- do so by querying the appropriate locations in order to obtain the
-- normalized list. The list can then be traversed by recursively calling
-- the traverse instance. Once that sub-traversal is finished, the Control
-- parameter can be set to Abandon_Children to skip processing of the
-- unnormalized argument list.
--
-- Traversal can be controlled with the Control parameter.
--
-- A call to an instance of Traverse_Element will not result in calls to
-- Pre_Operation or Post_Operation unless Control is set to Continue.
--
-- The subprograms matching Pre_Operation and Post_Operation can set
-- their Control parameter to affect the traverse:
--
-- Continue -- Continues the normal depth-first traversal.
--
-- Abandon_Children -- Prevents traversal of the current element's
-- -- children.
-- -- If set in a Pre_Operation, traversal picks up
-- -- with the next sibling element of the current
-- -- element.
-- -- If set in a Post_Operation, this is the
-- -- same as Continue, all children will already
-- -- have been traversed. Traversal picks up with
-- -- the Post_Operation of the parent.
--
-- Abandon_Siblings -- Prevents traversal of the current element's
-- -- children and remaining siblings.
-- -- If set in a Pre_Operation, this abandons the
-- -- associated Post_Operation for the current
-- -- element. Traversal picks up with the
-- -- Post_Operation of the parent.
-- -- If set in a Post_Operation, traversal picks
-- -- up with the Post_Operation of the parent.
--
-- Terminate_Immediately -- Does exactly that.
--
-- Raises ASIS_Inappropriate_Element if the element is a Nil_Element
------------------------------------------------------------------------------
end Asis.Iterator;
|
src/main/antlr4/ca/umontreal/iro/UCD.g4
|
abdelq/ucd-parser
| 0 |
6272
|
<filename>src/main/antlr4/ca/umontreal/iro/UCD.g4
grammar UCD;
model : 'MODEL' ID declaration* ;
declaration : ( classDeclaration | association | aggregation | generalization ) ';' ;
classDeclaration : 'CLASS' ID 'ATTRIBUTES' (attribute (',' attribute)*)?
'OPERATIONS' (operation (',' operation)*)? ;
attribute : ID ':' type ;
operation : ID '(' (argument (',' argument)*)? ')' ':' type ;
argument : ID ':' type ;
type : ID ;
association : 'RELATION' ID 'ROLES' role ',' role ;
aggregation : 'AGGREGATION' 'CONTAINER' container
'PARTS' part (',' part)* ;
container : role ;
part : role ;
role : 'CLASS' ID multiplicity ;
multiplicity
: 'ONE'
| 'MANY'
| 'ONE_OR_MANY'
| 'OPTIONALLY_ONE'
| 'UNDEFINED'
;
generalization : 'GENERALIZATION' ID 'SUBCLASSES' subclass (',' subclass)* ;
subclass : ID ;
ID : [a-zA-Z_]+ ;
WS : [ \r\t\n]+ -> skip ;
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_5_565.asm
|
ljhsiun2/medusa
| 9 |
6902
|
<filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_5_565.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r15
push %r8
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xc3cd, %r12
nop
nop
inc %r9
mov $0x6162636465666768, %r8
movq %r8, (%r12)
nop
nop
dec %r11
lea addresses_WC_ht+0xa21, %r12
nop
nop
nop
nop
sub %rdi, %rdi
mov $0x6162636465666768, %r9
movq %r9, (%r12)
nop
and $21476, %r11
lea addresses_UC_ht+0x14071, %rdx
clflush (%rdx)
nop
and $17236, %r15
mov $0x6162636465666768, %r12
movq %r12, %xmm3
movups %xmm3, (%rdx)
and $48250, %r12
lea addresses_A_ht+0x131, %rsi
lea addresses_normal_ht+0x16511, %rdi
nop
nop
nop
xor $39154, %r11
mov $71, %rcx
rep movsw
nop
nop
nop
inc %rcx
lea addresses_normal_ht+0x89e9, %rdx
xor %rsi, %rsi
movl $0x61626364, (%rdx)
nop
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_WT_ht+0xb8b9, %rcx
nop
nop
nop
and %r12, %r12
movb $0x61, (%rcx)
nop
nop
cmp %r8, %r8
lea addresses_UC_ht+0x1a6c1, %rsi
nop
nop
nop
nop
and $58964, %r9
movb $0x61, (%rsi)
nop
nop
nop
nop
nop
add %rsi, %rsi
lea addresses_normal_ht+0x17531, %rsi
lea addresses_A_ht+0xe1f1, %rdi
clflush (%rdi)
cmp %r11, %r11
mov $40, %rcx
rep movsw
nop
nop
nop
nop
and %rdx, %rdx
lea addresses_WT_ht+0x1ee8b, %rdx
nop
and %rsi, %rsi
movw $0x6162, (%rdx)
nop
add %r8, %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %rbp
push %rbx
push %rcx
push %rsi
// Store
lea addresses_US+0x188d1, %rbp
lfence
mov $0x5152535455565758, %rsi
movq %rsi, %xmm2
vmovups %ymm2, (%rbp)
and $40438, %r8
// Store
mov $0xdb1, %rcx
add %r15, %r15
movw $0x5152, (%rcx)
nop
nop
nop
nop
dec %rbp
// Store
lea addresses_WT+0xcd15, %rcx
and %r8, %r8
mov $0x5152535455565758, %r14
movq %r14, %xmm4
and $0xffffffffffffffc0, %rcx
vmovntdq %ymm4, (%rcx)
nop
nop
nop
nop
nop
sub $23089, %rbp
// Faulty Load
lea addresses_D+0x1aa71, %rcx
nop
nop
nop
add %rsi, %rsi
mov (%rcx), %r15
lea oracles, %rbx
and $0xff, %r15
shlq $12, %r15
mov (%rbx,%r15,1), %r15
pop %rsi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_US'}}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_P'}}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_WT'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': True, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}}
{'36': 5}
36 36 36 36 36
*/
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_13061_257.asm
|
ljhsiun2/medusa
| 9 |
177040
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xe09c, %rsi
lea addresses_A_ht+0x816c, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
sub %r11, %r11
mov $66, %rcx
rep movsb
nop
nop
add $26756, %r14
pop %rsi
pop %rdi
pop %rcx
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %r9
push %rbp
push %rcx
push %rsi
// Store
lea addresses_RW+0x352c, %r9
nop
nop
nop
nop
nop
inc %r10
mov $0x5152535455565758, %rbp
movq %rbp, %xmm3
movups %xmm3, (%r9)
xor $5131, %r10
// Store
mov $0x31c, %rcx
nop
nop
nop
nop
inc %r15
movl $0x51525354, (%rcx)
nop
nop
nop
and %rbp, %rbp
// Store
lea addresses_D+0x1785a, %rsi
nop
nop
nop
xor $33378, %r9
movw $0x5152, (%rsi)
nop
nop
cmp $62988, %r10
// Store
lea addresses_PSE+0x131dc, %rsi
nop
nop
nop
nop
nop
sub %r9, %r9
mov $0x5152535455565758, %rbp
movq %rbp, (%rsi)
// Exception!!!
nop
nop
nop
mov (0), %rcx
dec %rsi
// Faulty Load
lea addresses_RW+0x1a71c, %rsi
clflush (%rsi)
nop
nop
nop
nop
nop
and $22354, %r12
mov (%rsi), %rbp
lea oracles, %r12
and $0xff, %rbp
shlq $12, %rbp
mov (%r12,%rbp,1), %rbp
pop %rsi
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'32': 13061}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
programs/oeis/186/A186852.asm
|
neoneye/loda
| 22 |
19847
|
; A186852: Number of 3-step knight's tours on a (n+2)X(n+2) board summed over all starting positions
; 16,104,328,664,1112,1672,2344,3128,4024,5032,6152,7384,8728,10184,11752,13432,15224,17128,19144,21272,23512,25864,28328,30904,33592,36392
mov $1,$0
pow $1,2
add $0,$1
mul $0,7
trn $0,3
mul $0,8
add $0,16
|
Library/Kernel/Geodes/geodesDriver.asm
|
steakknife/pcgeos
| 504 |
86983
|
<reponame>steakknife/pcgeos<gh_stars>100-1000
COMMENT @-----------------------------------------------------------------------
Copyright (c) GeoWorks 1988 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Geode
FILE: geodeDriver.asm
ROUTINES:
Name Description
---- -----------
GLB GeodeFreeDriver Free a driver
GLB GeodeInfoDriver Return information about a driver
GLB GeodeInfoDefaultDriver Return information about default drivers
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 9/88 Initial version
DESCRIPTION:
This file contains routines to handle drivers.
$Id: geodesDriver.asm,v 1.1 97/04/05 01:11:57 newdeal Exp $
-------------------------------------------------------------------------------@
COMMENT @-----------------------------------------------------------------------
FUNCTION: GeodeGetDefaultDriver
DESCRIPTION: Return information about default drivers
CALLED BY: GLOBAL
PASS:
ax - GeodeDefaultDriverType
RETURN:
ax - handle default driver
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 9/88 Initial version
mike 2/89 added code for serial driver
-------------------------------------------------------------------------------@
GeodeGetDefaultDriver proc far
push ds
EC< cmp ax, GeodeDefaultDriverType >
EC< ERROR_AE GEODE_GET_DEF_DRIVER_BAD_TYPE >
EC< test ax, 1 >
EC< ERROR_NZ GEODE_GET_DEF_DRIVER_BAD_TYPE >
LoadVarSeg ds
xchg ax, bx
mov bx, {word} ds:[defaultDrivers][bx]
xchg ax, bx
pop ds
ret
GeodeGetDefaultDriver endp
GLoad segment resource
COMMENT @-----------------------------------------------------------------------
FUNCTION: GeodeSetDefaultDriver
DESCRIPTION: Sets the specified default driver
CALLED BY: GLOBAL
PASS: ax - GeodeDefaultDriverType
bx - handle
RETURN: nothing
DESTROYED: ax
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 6/90 Initial version
-------------------------------------------------------------------------------@
GeodeSetDefaultDriver proc far
uses di, si, ds
.enter
LoadVarSeg ds
EC< cmp ax, GeodeDefaultDriverType >
EC< ERROR_AE GEODE_SET_DEF_DRIVER_BAD_TYPE >
EC< test ax, 1 >
EC< ERROR_NZ GEODE_SET_DEF_DRIVER_BAD_TYPE >
; If the driver is of type video, task, or keyboard, we need to also
; store the address of the strategy routine.
mov di, offset defaultVideoStrategy
cmp ax, GDDT_VIDEO ; for video, set the default strategy
je storeStrategy
mov di, offset taskDriverStrategy
cmp ax, GDDT_TASK
je storeStrategy
mov di, offset kbdStrategy
cmp ax, GDDT_KEYBOARD
jne setDefaultDriver
; If the driver is a video driver, set the defaultVideoStrategy variable
; in idata. (ds already pointing there)
storeStrategy:
push ax
call GeodeInfoDriver ; get pointer to info struct
mov ax, ds:[si].DIS_strategy.offset ; copy the routine address
mov si, ds:[si].DIS_strategy.segment
LoadVarSeg ds
mov ds:[di].offset, ax
mov ds:[di].segment, si
pop ax
setDefaultDriver:
mov si, ax
mov {word} ds:[defaultDrivers][si], bx
.leave
ret
GeodeSetDefaultDriver endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeodeUseDriver
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Similar to GeodeUseLibrary, dynamically loads a driver
given its file name.
CALLED BY: GLOBAL
PASS: ds:si = filename of driver to load.
(file name *can* be in movable XIP code resource)
ax = expected major protocol number (0 => any ok)
bx = expected minor protocol number
RETURN: if carry set:
ax = GeodeLoadError describing problem
else
bx = handle of library/driver
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 1/ 3/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FXIP <CopyStackCodeXIP segment >
GeodeUseDriver proc far
push dx
clr dx ; indicate ds:si is file name
FALL_THRU GeodeUseDriverCommon, dx
GeodeUseDriver endp
GeodeUseDriverCommon proc far
push cx
mov cx, mask GA_DRIVER
call UseLibraryDriverCommon
pop cx
FALL_THRU_POP dx
ret
GeodeUseDriverCommon endp
FXIP <CopyStackCodeXIP ends >
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GeodeUseDriverPermName
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Similar to GeodeUseLibraryPermName, dynamically uses a
driver given its permanent name.
CALLED BY: GLOBAL
PASS: ds:si = driver permanent geode name (GEODE_NAME_SIZE)
(*can* be in movable XIP code resource)
RETURN: if carry set:
ax = GeodeLoadError describing problem
else
bx = handle of library/driver
DESTROYED: ax
PSEUDO CODE/STRATEGY:
Call UseLibraryDriverCommon, passing dx = nonzero
REVISION HISTORY:
Name Date Description
---- ---- -----------
Administrator 8/10/00 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FXIP <CopyStackCodeXIP segment >
GeodeUseDriverPermName proc far
push dx
mov dx, TRUE ; indicate ds:si is permanent name
GOTO GeodeUseDriverCommon, dx
GeodeUseDriverPermName endp
FXIP <CopyStackCodeXIP ends >
GLoad ends
|
test/Succeed/Issue1380b.agda
|
shlevy/agda
| 1,989 |
2436
|
{-# OPTIONS --exact-split #-}
postulate
I : Set
P : I → Set
record ∃ (P : I → Set) : Set where
constructor _,_
field
fst : I
snd : P fst
open ∃
data S : ∃ P → Set where
s : (i : I) (x : P i) → S (i , x)
Foo : (p : ∃ P) → S p → Set
Foo p (s .(fst p) .(snd p)) = I
|
src/examples/zeerust.asm
|
Ppjet6/zeerust
| 9 |
22263
|
ld A, 'Z'
out (0), A
ld A, 'E'
out (0), A
out (0), A
ld A, 'R'
out (0), A
ld A, 'U'
out (0), A
ld A, 'S'
out (0), A
ld A, 'T'
out (0), A
halt
|
CpuIdDll/src/cpuidx86.asm
|
jcurl/RJCP.DLL.CpuId
| 0 |
22804
|
.686 ; create 32 bit code, required for "cpuid" instruction
.model flat, stdcall ; 32 bit memory model
option casemap: none ; case sensitive
option language: stdcall
.code
;stdcall calling convention used for 32-bit
; EBP+28 pedx:NEAR PTR DWORD
; EBP+24 pecx:NEAR PTR DWORD
; EBP+20 pebx:NEAR PTR DWORD
; EBP+16 peax:NEAR PTR DWORD
; EBP+12 vecx:DWORD
; EBP+8 veax:DWORD
; EBP+4 callers EIP
; EBP+0 callers EBP
cpuidl proc veax:DWORD, vecx:DWORD, peax:NEAR PTR DWORD, pebx:NEAR PTR DWORD, pecx:NEAR PTR DWORD, pedx:NEAR PTR DWORD
;push ebp
;mov ebp,esp
push ebx
mov eax, veax
mov ecx, vecx
cpuid
push eax
mov eax, pedx
mov dword ptr [eax],edx
mov eax, pecx
mov dword ptr [eax],ecx
mov eax, pebx
mov dword ptr [eax],ebx
pop ebx
mov eax, peax
mov dword ptr [eax],ebx
pop ebx
xor eax,eax
;mov esp,ebp
;pop ebp
;ret 24
ret
cpuidl endp
; To be called on a 486 processor or later
; EAX != 0 => CPUID instruction exists
cpuidt proc
pushfd
pop eax ; Get EFLAGS in EAX
mov ecx, eax ; ECX is an original copy of EFLAGS
xor eax, 200000h ; Toggle bit 21 of the EFLAGS register
push eax ;
popfd ;
pushfd ;
pop eax ; with result in EAX
xor eax,ecx ; Check if bit can be toggled
; If it can be toggled, EAX=200000, implies CPU supports CPUID
ret
cpuidt endp
end
|
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/old_cos/sfc/yst_play.asm
|
prismotizm/gigaleak
| 0 |
23107
|
Name: yst_play.asm
Type: file
Size: 7380
Last-Modified: '2016-05-13T04:52:55Z'
SHA-1: 71284E257C8B4CDCA5E1CB9587916F3B2B956C42
Description: null
|
ada/src/goertzel.adb
|
sveljko/goertzel
| 10 |
29682
|
<gh_stars>1-10
with Ada.Numerics.Generic_Elementary_Functions;
package body goertzel with
SPARK_Mode => On
is
package Ef is new Ada.Numerics.Generic_Elementary_Functions(Value);
use Ef;
function Calc_Koef(F, Fs: Value) return Value is (2.0 * Cos(2.0 * Ada.Numerics.Pi * F / Fs))
with
Pre => (Fs < 100_000.0) and (F < Fs / 2.0) and (Fs > 0.0);
procedure Reset(Vn: out Vn2) is
begin
Vn.m1 := 0.0;
Vn.m2 := 0.0;
end;
function Make(F, Fs: Value) return Filter is ( F, Fs, Calc_Koef(F, Fs), (0.0, 0.0) );
procedure Reset(Flt: in out Filter) is
begin
Reset(Flt.Vn);
end;
procedure Kernel(Sample: Samples; K: Value; Vn: in out Vn2) is
T: Value;
begin
for I in Sample'Range loop
T := K * Vn.m1 - Vn.m2 + Sample(I);
Vn.m2 := Vn.m1;
Vn.m1 := T;
end loop;
end;
function Power(Koef: Value; Vn: Vn2; N: Sample_Count) return Value
is
Rslt: Value;
begin
Rslt := Vn.m1 * Vn.m1 + Vn.m2* Vn.m2 - Koef * Vn.m1 * Vn.m2;
if Rslt < Value'Model_Epsilon then Rslt := Value'Model_Epsilon; end if;
return Rslt / Value(N*N);
end Power;
function DBm(Power: Value) return Value is (10.0 * Log(2.0 * Power * 1000.0 / 600.0, 10.0));
procedure Process(Flt: in out Filter; Sample: Samples; Rslt: out Value) is
begin
Kernel(Sample, Flt.Koef, Flt.Vn);
Rslt := Power(Flt.Koef, Flt.Vn, Sample'Length);
end Process;
end goertzel;
|
alloy4fun_models/trashltl/models/17/TAmuXKRJQHbs8t6cv.als
|
Kaixi26/org.alloytools.alloy
| 0 |
4569
|
<reponame>Kaixi26/org.alloytools.alloy
open main
pred idTAmuXKRJQHbs8t6cv_prop18 {
always all f: Protected | f in Protected until f in Trash
}
pred __repair { idTAmuXKRJQHbs8t6cv_prop18 }
check __repair { idTAmuXKRJQHbs8t6cv_prop18 <=> prop18o }
|
lemmas-subst-ta.agda
|
hazelgrove/hazelnut-agda
| 0 |
10247
|
open import Prelude
open import Nat
open import dynamics-core
open import contexts
open import contraction
open import weakening
open import exchange
open import lemmas-disjointness
open import binders-disjoint-checks
module lemmas-subst-ta where
-- this is what makes the binders-unique assumption below good enough: it
-- tells us that we can pick fresh variables
mutual
binders-envfresh : ∀{Δ Γ Γ' y σ} →
Δ , Γ ⊢ σ :s: Γ' →
y # Γ →
unbound-in-σ y σ →
binders-unique-σ σ →
envfresh y σ
binders-envfresh {Γ' = Γ'} {y = y} (STAId x) apt unbound unique with ctxindirect Γ' y
binders-envfresh {Γ' = Γ'} {y = y} (STAId x₁) apt unbound unique | Inl x = abort (somenotnone (! (x₁ y (π1 x) (π2 x)) · apt))
binders-envfresh (STAId x₁) apt unbound unique | Inr x = EFId x
binders-envfresh {Γ = Γ} {y = y} (STASubst {y = z} subst x₁) apt (UBσSubst x₂ unbound neq) (BUσSubst zz x₃ x₄) =
EFSubst (binders-fresh {y = y} x₁ zz x₂ apt)
(binders-envfresh subst (apart-extend1 Γ neq apt) unbound x₃)
neq
binders-fresh : ∀{Δ Γ d2 τ y} →
Δ , Γ ⊢ d2 :: τ →
binders-unique d2 →
unbound-in y d2 →
Γ y == None →
fresh y d2
binders-fresh TANum BUHole UBNum apt = FNum
binders-fresh {y = y} (TAVar {x = x} x₁) BUVar UBVar apt with natEQ y x
binders-fresh (TAVar x₂) BUVar UBVar apt | Inl refl = abort (somenotnone (! x₂ · apt))
binders-fresh (TAVar x₂) BUVar UBVar apt | Inr x₁ = FVar x₁
binders-fresh {y = y} (TALam {x = x} x₁ wt) bu2 ub apt with natEQ y x
binders-fresh (TALam x₂ wt) bu2 (UBLam2 x₁ ub) apt | Inl refl = abort (x₁ refl)
binders-fresh {Γ = Γ} (TALam {x = x} x₂ wt) (BULam bu2 x₃) (UBLam2 x₄ ub) apt | Inr x₁ = FLam x₁ (binders-fresh wt bu2 ub (apart-extend1 Γ x₄ apt))
binders-fresh (TAAp wt wt₁) (BUAp bu2 bu3 x) (UBAp ub ub₁) apt = FAp (binders-fresh wt bu2 ub apt) (binders-fresh wt₁ bu3 ub₁ apt)
binders-fresh (TAEHole x₁ x₂) (BUEHole x) (UBHole x₃) apt = FHole (binders-envfresh x₂ apt x₃ x )
binders-fresh (TANEHole x₁ wt x₂) (BUNEHole bu2 x) (UBNEHole x₃ ub) apt = FNEHole (binders-envfresh x₂ apt x₃ x) (binders-fresh wt bu2 ub apt)
binders-fresh (TACast wt x₁) (BUCast bu2) (UBCast ub) apt = FCast (binders-fresh wt bu2 ub apt)
binders-fresh (TAFailedCast wt x x₁ x₂) (BUFailedCast bu2) (UBFailedCast ub) apt = FFailedCast (binders-fresh wt bu2 ub apt)
binders-fresh (TAInl wt) (BUInl bu) (UBInl ub) apt = FInl (binders-fresh wt bu ub apt)
binders-fresh (TAInr wt) (BUInr bu) (UBInr ub) apt = FInr (binders-fresh wt bu ub apt)
binders-fresh {Γ = Γ} (TACase wt x wt₁ x₁ wt₂) (BUCase bu bu₁ bu₂ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ x₁₀) (UBCase ub x₁₁ ub₁ x₁₂ ub₂) apt = FCase (binders-fresh wt bu ub apt) x₁₁ (binders-fresh wt₁ bu₁ ub₁ (apart-extend1 Γ x₁₁ apt)) x₁₂ (binders-fresh wt₂ bu₂ ub₂ (apart-extend1 Γ x₁₂ apt))
binders-fresh (TAPlus wt wt₁) (BUPlus bu bu₁ x) (UBPlus ub ub₁) apt = FPlus (binders-fresh wt bu ub apt) (binders-fresh wt₁ bu₁ ub₁ apt)
binders-fresh (TAPair wt wt₁) (BUPair bu bu₁ x) (UBPair ub ub₁) apt = FPair (binders-fresh wt bu ub apt) (binders-fresh wt₁ bu₁ ub₁ apt)
binders-fresh (TAFst wt) (BUFst bu) (UBFst ub) apt = FFst (binders-fresh wt bu ub apt)
binders-fresh (TASnd wt) (BUSnd bu) (UBSnd ub) apt = FSnd (binders-fresh wt bu ub apt)
-- the substition lemma for preservation
lem-subst : ∀{Δ Γ x τ1 d1 τ d2} →
x # Γ →
binders-disjoint d1 d2 →
binders-unique d2 →
Δ , Γ ,, (x , τ1) ⊢ d1 :: τ →
Δ , Γ ⊢ d2 :: τ1 →
Δ , Γ ⊢ [ d2 / x ] d1 :: τ
lem-subst apt bd bu2 (TANum) wt = TANum
lem-subst apt (BDPlus bd bd₁) bu2 (TAPlus wt1 wt2) wt3 = TAPlus (lem-subst apt bd bu2 wt1 wt3) (lem-subst apt bd₁ bu2 wt2 wt3)
lem-subst {x = x} apt bd bu2 (TAVar {x = x'} x₂) wt2 with natEQ x' x
... | Inl refl with natEQ x x
... | Inr x≠x = abort (x≠x refl)
... | Inl refl with someinj x₂
... | refl = wt2
lem-subst {x = x} apt bd bu2 (TAVar {x = x'} x₂) wt2 | Inr x'≠x with natEQ x x'
... | Inl refl = abort (x'≠x refl)
... | Inr x'≠x = TAVar x₂
lem-subst {Δ = Δ} {Γ = Γ} {x = x} {d2 = d2} x#Γ (BDLam bd bd') bu2 (TALam {x = y} {τ1 = τ1} {d = d} {τ2 = τ2} x₂ wt1) wt2 with natEQ y x
... | Inl refl with natEQ x x
... | Inr x≠x = abort (x≠x refl)
... | Inl refl = abort (somenotnone x₂)
lem-subst {Δ = Δ} {Γ = Γ} {x = x} {d2 = d2} x#Γ (BDLam bd bd') bu2 (TALam {x = y} {τ1 = τ1} {d = d} {τ2 = τ2} x₂ wt1) wt2 | Inr y≠x with natEQ x y
... | Inl refl = abort (y≠x refl)
... | Inr x≠y = TALam x₂ (lem-subst (apart-extend1 Γ x≠y x#Γ) bd bu2 (exchange-ta-Γ x≠y wt1) (weaken-ta (binders-fresh wt2 bu2 bd' x₂) wt2))
lem-subst apt (BDAp bd bd₁) bu3 (TAAp wt1 wt2) wt3 = TAAp (lem-subst apt bd bu3 wt1 wt3) (lem-subst apt bd₁ bu3 wt2 wt3)
lem-subst apt bd bu2 (TAEHole inΔ sub) wt2 = TAEHole inΔ (STASubst sub wt2)
lem-subst apt (BDNEHole x₁ bd) bu2 (TANEHole x₃ wt1 x₄) wt2 = TANEHole x₃ (lem-subst apt bd bu2 wt1 wt2) (STASubst x₄ wt2)
lem-subst apt (BDCast bd) bu2 (TACast wt1 x₁) wt2 = TACast (lem-subst apt bd bu2 wt1 wt2) x₁
lem-subst apt (BDFailedCast bd) bu2 (TAFailedCast wt1 x₁ x₂ x₃) wt2 = TAFailedCast (lem-subst apt bd bu2 wt1 wt2) x₁ x₂ x₃
lem-subst apt (BDInl bd) bu (TAInl wt1) wt2 = TAInl (lem-subst apt bd bu wt1 wt2)
lem-subst apt (BDInr bd) bu (TAInr wt1) wt2 = TAInr (lem-subst apt bd bu wt1 wt2)
lem-subst {Δ = Δ} {Γ = Γ} {x = x} {d1 = .(case _ _ _ _ _)} {d2 = d2} apt (BDCase bd x₁ bd₁ x₂ bd₂) bu (TACase {d = d} {τ1 = τ1} {τ2 = τ2} {x = y} {y = z} wt1 x₃ wt3 x₄ wt4) wt2
with natEQ y x | natEQ z x
... | Inl refl | Inl refl with natEQ x x
... | Inr x≠x = abort (x≠x refl)
... | Inl refl = abort (somenotnone x₄)
lem-subst {Δ = Δ} {Γ = Γ} {x = x} {d1 = .(case _ _ _ _ _)} {d2 = d2} apt (BDCase bd x₁ bd₁ x₂ bd₂) bu (TACase {d = d} {τ1 = τ1} {τ2 = τ2} {x = y} {y = z} wt1 x₃ wt3 x₄ wt4) wt2 | Inl refl | Inr z≠x with natEQ x x
... | Inr x≠x = abort (x≠x refl)
... | Inl refl = abort (somenotnone x₃)
lem-subst {Δ = Δ} {Γ = Γ} {x = x} {d1 = .(case _ _ _ _ _)} {d2 = d2} apt (BDCase bd x₁ bd₁ x₂ bd₂) bu (TACase {d = d} {τ1 = τ1} {τ2 = τ2} {x = y} {y = z} wt1 x₃ wt3 x₄ wt4) wt2 | Inr y≠x | Inl refl with natEQ x x
... | Inr x≠x = abort (x≠x refl)
... | Inl refl = abort (somenotnone x₄)
lem-subst {Δ = Δ} {Γ = Γ} {x = x} {d1 = .(case _ _ _ _ _)} {d2 = d2} apt (BDCase bd x₁ bd₁ x₂ bd₂) bu (TACase {d = d} {τ1 = τ1} {τ2 = τ2} {x = y} {y = z} wt1 x₃ wt3 x₄ wt4) wt2 | Inr y≠x | Inr z≠x with natEQ x z
... | Inl refl = abort (z≠x refl)
... | Inr x≠z with natEQ x y
... | Inl refl = abort (y≠x refl)
... | Inr x≠y = TACase (lem-subst apt bd bu wt1 wt2) x₃ (lem-subst (apart-extend1 Γ x≠y apt) bd₁ bu (exchange-ta-Γ x≠y wt3) (weaken-ta (binders-fresh wt2 bu x₁ x₃) wt2)) x₄ (lem-subst (apart-extend1 Γ x≠z apt) bd₂ bu (exchange-ta-Γ x≠z wt4) (weaken-ta (binders-fresh wt2 bu x₂ x₄) wt2))
lem-subst apt (BDPair bd bd₁) bu (TAPair wt1 wt3) wt2 = TAPair (lem-subst apt bd bu wt1 wt2) (lem-subst apt bd₁ bu wt3 wt2)
lem-subst apt (BDFst bd) bu (TAFst wt1) wt2 = TAFst (lem-subst apt bd bu wt1 wt2)
lem-subst apt (BDSnd bd) bu (TASnd wt1) wt2 = TASnd (lem-subst apt bd bu wt1 wt2)
lem-subst-cast-sta : ∀{Δ Γ x τ1 τ2 σ Γ'} →
x # Γ →
τ1 ~ τ2 →
Δ , Γ ,, (x , τ2) ⊢ σ :s: Γ' →
Δ , Γ ,, (x , τ1) ⊢ Subst (X x ⟨ τ1 ⇒ τ2 ⟩) x σ :s: Γ'
lem-subst-cast-sta {Γ = Γ} {x = x} {τ1 = τ1} {τ2 = τ2} {Γ' = Γ'} x#Γ con (STAId sub) = STASubst (STAId Γ'⊆) (TACast (TAVar (ctx-top Γ x τ1 x#Γ)) con)
where
Γ'⊆ : (y : Nat) (τ : htyp) → (y , τ) ∈ Γ' → (y , τ) ∈ (Γ ,, (x , τ1) ,, (x , τ2))
Γ'⊆ y τ y∈Γ' with lem-dom-union {Δ1 = ■(x , τ2)} {Δ2 = Γ} (sub y τ y∈Γ')
... | Inl y∈x with natEQ x y
... | Inr x≠y = abort (somenotnone (! y∈x))
... | Inl refl = y∈x
Γ'⊆ y τ y∈Γ' | Inr y∈Γ with natEQ x y
... | Inl refl = abort (somenotnone ((! y∈Γ) · x#Γ))
... | Inr x≠y with natEQ x y
... | Inl refl = abort (x≠y refl)
... | Inr x≠y' = y∈Γ
lem-subst-cast-sta {Δ = Δ} {Γ = Γ} {x = x} {τ1 = τ1} {τ2 = τ2} {Γ' = Γ'} x#Γ con (STASubst {σ = σ} {y = y} {d = d} {τ = τ} wsta wt) = STASubst (STASubst (tr (λ c → Δ , c ,, (y , τ) ⊢ σ :s: Γ') (! (update Γ x τ1 τ2)) wsta) (tr (λ c → Δ , c ⊢ d :: τ) (! (update Γ x τ1 τ2)) wt)) (TACast (TAVar (ctx-top Γ x τ1 x#Γ)) con)
lem-subst-cast-ta : ∀{Δ Γ d x τ1 τ2 τ} →
x # Γ →
binders-unique d →
τ1 ~ τ2 →
Δ , Γ ,, (x , τ2) ⊢ d :: τ →
Δ , Γ ,, (x , τ1) ⊢ [ (X x ⟨ τ1 ⇒ τ2 ⟩) / x ] d :: τ
lem-subst-cast-ta apt bu con TANum = TANum
lem-subst-cast-ta apt (BUPlus bu bu₁ x) con (TAPlus wt wt₁) = TAPlus (lem-subst-cast-ta apt bu con wt) (lem-subst-cast-ta apt bu₁ con wt₁)
lem-subst-cast-ta {Γ = Γ} {x = x} {τ1 = τ1} {τ2 = τ2} apt bu con (TAVar {x = x'} x₁)
with natEQ x x'
... | Inl refl with natEQ x' x
... | Inr x'≠x = abort (x'≠x refl)
... | Inl refl with Γ x
... | None with natEQ x x
... | Inr x≠x = abort (x≠x refl)
... | Inl refl with someinj x₁
... | refl = TACast (TAVar (x∈∪l (■ (x , τ1)) Γ x τ1 (x∈■ x τ1))) con
lem-subst-cast-ta {Γ = Γ} {x = x} {τ1 = τ1} {τ2 = τ2} apt bu con (TAVar {x = x} x₁) | Inl refl | Inl refl | Some t with someinj x₁
... | refl = abort (somenotnone apt)
lem-subst-cast-ta {Γ = Γ} {x = x} {τ1 = τ1} {τ2 = τ2} {τ = τ} apt bu con (TAVar {x = x'} x₁) | Inr x≠x' with natEQ x' x
... | Inl refl = abort (x≠x' refl)
... | Inr x'≠x = TAVar (x∈∪r (■(x , τ1)) Γ x' τ x₁ (apart-singleton (λ refl → abort (x'≠x refl))))
lem-subst-cast-ta {Δ = Δ} {Γ = Γ} {x = x} {τ = τ1 ==> τ3} apt (BULam bu x₁) con (TALam {x = y} x₂ wt)
with natEQ x y
... | Inl refl = abort (somenotnone x₂)
... | Inr x≠y with natEQ y x
... | Inl refl = abort (x≠y refl)
... | Inr y≠x = TALam (apart-extend1 Γ y≠x x₂) (exchange-ta-Γ y≠x (lem-subst-cast-ta (apart-extend1 Γ x≠y apt) bu con (exchange-ta-Γ x≠y wt)))
lem-subst-cast-ta {Γ = Γ} apt (BUAp bu bu₁ x) con (TAAp wt wt₁) = TAAp (lem-subst-cast-ta {Γ = Γ} apt bu con wt) (lem-subst-cast-ta {Γ = Γ} apt bu₁ con wt₁)
lem-subst-cast-ta {Γ = Γ} apt (BUInl bu) con (TAInl wt) = TAInl (lem-subst-cast-ta {Γ = Γ} apt bu con wt)
lem-subst-cast-ta {Γ = Γ} apt (BUInr bu) con (TAInr wt) = TAInr (lem-subst-cast-ta {Γ = Γ} apt bu con wt)
lem-subst-cast-ta {x = x} apt (BUCase bu bu₁ bu₂ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ x₁₀) con (TACase {x = y} {y = z} wt apty wt₁ aptz wt₂) with natEQ y x | natEQ z x
... | Inl refl | Inl refl with natEQ x x
... | Inr x≠x = abort (x≠x refl)
... | Inl refl = abort (somenotnone aptz)
lem-subst-cast-ta {x = x} apt (BUCase bu bu₁ bu₂ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ x₁₀) con (TACase {x = y} {y = z} wt apty wt₁ aptz wt₂) | Inl refl | Inr z≠x with natEQ x x
... | Inr x≠x = abort (x≠x refl)
... | Inl refl = abort (somenotnone apty)
lem-subst-cast-ta {x = x} apt (BUCase bu bu₁ bu₂ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ x₁₀) con (TACase {x = y} {y = z} wt apty wt₁ aptz wt₂) | Inr y≠x | Inl refl with natEQ x x
... | Inr x≠x = abort (x≠x refl)
... | Inl refl = abort (somenotnone aptz)
lem-subst-cast-ta {Γ = Γ} {x = x} apt (BUCase bu bu₁ bu₂ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ x₁₀) con (TACase {x = y} {y = z} wt apty wt₁ aptz wt₂) | Inr y≠x | Inr z≠x with natEQ x z
... | Inl refl = abort (z≠x refl)
... | Inr x≠z with natEQ x y
... | Inl refl = abort (y≠x refl)
... | Inr x≠y = TACase (lem-subst-cast-ta apt bu con wt) (apart-extend1 Γ y≠x apty) (exchange-ta-Γ y≠x (lem-subst-cast-ta (apart-extend1 Γ x≠y apt) bu₁ con (exchange-ta-Γ x≠y wt₁))) (apart-extend1 Γ z≠x aptz) (exchange-ta-Γ z≠x (lem-subst-cast-ta (apart-extend1 Γ x≠z apt) bu₂ con (exchange-ta-Γ x≠z wt₂)))
lem-subst-cast-ta apt (BUEHole x₂) con (TAEHole x x₁) = TAEHole x (lem-subst-cast-sta apt con x₁)
lem-subst-cast-ta apt (BUNEHole bu x₂) con (TANEHole x wt x₁) = TANEHole x (lem-subst-cast-ta apt bu con wt) (lem-subst-cast-sta apt con x₁)
lem-subst-cast-ta apt (BUCast bu) con (TACast wt x) = TACast (lem-subst-cast-ta apt bu con wt) x
lem-subst-cast-ta apt (BUFailedCast bu) con (TAFailedCast wt x x₁ x₂) = TAFailedCast (lem-subst-cast-ta apt bu con wt) x x₁ x₂
lem-subst-cast-ta apt (BUPair bu bu₁ x) con (TAPair wt wt₁) = TAPair (lem-subst-cast-ta apt bu con wt) (lem-subst-cast-ta apt bu₁ con wt₁)
lem-subst-cast-ta apt (BUFst bu) con (TAFst wt) = TAFst (lem-subst-cast-ta apt bu con wt)
lem-subst-cast-ta apt (BUSnd bu) con (TASnd wt) = TASnd (lem-subst-cast-ta apt bu con wt)
|
library/fmGUI_RecordManipulation/fmGUI_getRecCounts.applescript
|
NYHTC/applescript-fm-helper
| 1 |
662
|
<gh_stars>1-10
-- fmGUI_getRecCounts()
-- <NAME>, NYHTC
-- Get the counts of the found set and total # of records
(*
HISTORY:
1.0 - 2016-08-12 ( eshagdar ): first created
REQUIRES:
fmGUI_ModeEnsure_Browse
getTextAfter
getTextBefore
*)
on run
fmGUI_getRecCounts()
end run
--------------------
-- START OF CODE
--------------------
on fmGUI_getRecCounts()
-- version 1.0
fmGUI_ModeEnsure_Browse()
try
-- get the count string
tell application "System Events"
tell application process "FileMaker Pro Advanced"
set recString to value of static text 3 of group 1 of toolbar 1 of window 1
end tell
end tell
-- found set
if recString contains "/" then
set recsFound to getTextBefore(recString, "/") as integer
else
set recsFound to recString as integer
end if
-- total
if recString contains "/" then
set recsTotal to getTextAfter(recString, "/") as integer
else
set recsTotal to recString as integer
end if
return {recsFound:recsFound, recsTotal:recsTotal}
on error errMsg number errNum
error "Couldn't fmGUI_getRecCounts - " & errMsg number errNum
end try
end fmGUI_getRecCounts
--------------------
-- END OF CODE
--------------------
on fmGUI_ModeEnsure_Browse()
tell application "htcLib" to fmGUI_ModeEnsure_Browse()
end fmGUI_ModeEnsure_Browse
on getTextAfter(sourceText, afterThis)
tell application "htcLib" to getTextAfter(sourceText, afterThis)
end getTextAfter
on getTextBefore(sourceTEXT, stopHere)
tell application "htcLib" to getTextBefore(sourceTEXT, stopHere)
end getTextBefore
|
samples/lazy.asm
|
Idorobots/asm
| 2 |
173723
|
################################################################################
# Lazy evaluation example:
#
# > (take 13 all-integers)
# (1 2 3 4 5 6 7 8 9 10 11 12 13)
####################
(import 'imports.lazy)
(function ++ [var]
(+ 1 var))
(var all-integers ([n ->
(join~ n (self (++ n)))]
1))
(function squareduce [n]
(reduce [a b ->
(+ (* a a) (* b b))]
(take n (map~ [x -> (* x x)]
all-integers))))
(function withdraw (balance ammount-stream)
(join~ balance
(self (- balance (first~ ammount-stream))
(rest~ ammount-stream))))
(function make-ammount-stream ()
(join~ (str->num (readln))
(make-ammount-stream)))
(function bank (withdraw-stream)
(do (write (first~ withdraw-stream))
(bank (rest~ withdraw-stream))))
|
programs/oeis/011/A011661.asm
|
jmorken/loda
| 1 |
13372
|
<gh_stars>1-10
; A011661: A binary m-sequence: expansion of reciprocal of x^5+x^3+x^2+x+1.
; 0,0,0,0,1,1,0,0,1,0,0,1,1,1,1,1,0,1,1,1,0,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,1,0,0,1,0,0,1,1,1,1,1,0,1,1,1,0,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,1,0,0,1,0,0,1,1,1,1,1,0,1,1
mul $0,3
mov $5,$0
lpb $0,$5
sub $0,2
cal $0,11749 ; Expansion of 1/(1 + x^3 + x^5) mod 2.
mov $1,$5
lpb $0,2
sub $1,1
mov $4,1
mov $5,$0
lpe
add $1,1
lpe
add $4,$1
mov $1,$4
div $1,2
|
src/boot/pm_utils.asm
|
davidjxu21/pongOS
| 0 |
102029
|
; utility functions in 32-bit protected mode
[bits 32]
VIDEO_MEMORY equ 0xb8000
WHITE_ON_BLACK equ 0x0f
clear_display:
; clears the vga display
pusha ; preserve current register values
mov edx, VIDEO_MEMORY ; set beginning memory address
mov bx, 0x7D0 ; set counter to number of pixels
mov al, 0x00 ; write NULL at each location
mov ah, WHITE_ON_BLACK ; set write mode for each location
.loop:
cmp bx, 0x0 ; if counter is 0, stop and end
je .done ; jump to end of loop
mov [edx], eax ; write to the next address in graphics
add edx, 2 ; increment the address
dec bx ; decrement the counter
jmp .loop ; continue looping
.done:
popa ; restore register values
ret ; return
print_string_pm:
; writes the null terminated string pointed to by ebx to top right of screen
pusha ; store current register values
mov edx, VIDEO_MEMORY ; store video memory address in edx
.loop:
mov al, [ebx] ; move current character to al
mov ah, WHITE_ON_BLACK ; place settings into ah
cmp al, 0x00 ; see if null
je .done ; if so, complete the loop
mov [edx], eax ; place correct value into video memory
add ebx, 1 ; increment pointer in string
add edx, 2 ; increment pointer in video memory
jmp .loop
.done:
popa ; restore register values
ret ; return
|
strcasecmp.asm
|
Antoine340/minilibc-asm
| 0 |
13577
|
<filename>strcasecmp.asm<gh_stars>0
BITS 64
GLOBAL strcasecmp:function
strcasecmp:
PUSH RBP
MOV RBP, RSP
XOR RAX, RAX
XOR RCX, RCX
loop:
CMP BYTE[]
|
asm/text.ext.asm
|
RockmanEXEZone/MMBN45-English-Translation
| 6 |
246242
|
<reponame>RockmanEXEZone/MMBN45-English-Translation
.align 2
text_cmdEuropeBlock:
push r14
ldrb r0,[r4,0x1]
cmp r0,0x0
beq @@skip
cmp r0,(VAR_TEXT_EU ? 0x2 : 0x1)
bne @@loop
@@skip:
add r4,0x2
b @@end
@@loop:
// Loop until 0xFE 0x00
ldrb r0,[r4]
add r4,0x1
cmp r0,0xE4
bne @@checkFE
add r4,0x1
b @@loop
@@checkFE:
cmp r0,0xFE
bne @@loop
ldrb r0,[r4]
add r4,0x1
cmp r0,0x0
bne @@loop
@@end:
mov r0,0x1
pop r15
.align 2
text_loadMailContentsUncompressed:
push r14
// Get Mail Contents for current Navi
ldrb r2,[r5,0x10] // get current Navi
lsl r2,r2,0x2
ldr r0,[r0,r2]
bl 0x804F7B6
pop r15
.align 2
text_multiStringComma:
mov r0,0xA1 // ','
strb r0,[r5]
mov r0,0xE8 // '\n'
strb r0,[r5,0x1]
add r5,0x2
bx r14
.align 2
text_applyStringCapsROM:
push r14
// Read capitalization bit
ldrb r7,[r4,0x1]
// Read string type
ldrb r1,[r4,0x2]
cmp r1,0x80
blt @@next
// Read string type from buffer
sub r1,0x80
lsl r1,r1,0x2
add r1,0x4C
ldr r1,[r5,r1]
@@next:
// Store old script pointer
add r4,0x3
str r4,[r5,0x44]
// Set new script pointer
mov r4,r0
bl @text_doStringCaps
pop r15
.align 2
text_applyStringCapsRAM:
// Read capitalization bit
ldrb r7,[r0,0x1]
// Read string type
ldrb r1,[r0,0x2]
// Store old script pointer
add r0,0x3
str r0,[r3,0x28]
// Set new script pointer
mov r0,r6
bl @text_doStringCaps
pop r1-r7,r15
.align 2
@text_doStringCaps:
// in: r0 = script pointer, r1 = string type, r7 = capitalization flags
// destroys r2
push r14
// Replace with indefinite article
lsr r2,r7,0x6
bcc @@checkCaps
push r1
mov r1,r0
ldr r3,=file_05290C+0x2
@@checkVowel:
ldrb r2,[r1]
lsl r2,r2,0x2
ldrb r2,[r3,r2]
cmp r2,0xB // 'A'
beq @@printN
cmp r2,0xF // 'E'
beq @@printN
cmp r2,0x13 // 'I'
beq @@printN
cmp r2,0x19 // 'O'
beq @@printN
cmp r2,0x1F // 'U'
beq @@printN
cmp r2,0xFF
bne @@printEmpty
add r1,0x1
b @@checkVowel
@@printN:
mov r2,0x33 // 'n'
strb r2,[r0]
mov r2,0xE5
strb r2,[r0,0x1]
b @@printEnd
@@printEmpty:
mov r2,0xE5
strb r2,[r0]
@@printEnd:
pop r1
@@checkCaps:
// Check if capitalization flags
lsr r2,r7,0x7
// Checks capitalizeAll, always capitalized
bcs @@applyCaps
lsr r2,r7,0x8
// Checks capitalize, depends on string type
bcc @@end
@@checkTypes:
// Check if string type should be capitalized
cmp r1,0x1
ble @@end
cmp r1,0x3
blt @@applyCaps
cmp r1,0x7
ble @@end
cmp r1,0xB
blt @@applyCaps
cmp r1,0xD
ble @@end
cmp r1,0x12
blt @@applyCaps
cmp r1,0x1B
ble @@end
cmp r1,0x1F
blt @@applyCaps
cmp r1,0x37
ble @@end
cmp r1,0x45
blt @@applyCaps
cmp r1,0x46
ble @@end
@@applyCaps:
mov r2,0x0
@@loop:
// Load next character of script
ldrb r1,[r0,r2]
cmp r1,0xE5
beq @@end
@@AtoZ:
cmp r1,0x26 // 'a'
blt @@nextChar
cmp r1,0x3F // 'z'
bgt @@special1
// a-z -> A-Z
sub r1,0x1B
b @@storeChar
// I know, I know...
@@special1:
cmp r1,0x40 // 'ÿ'
bne @@special2
mov r1,0x41 // 'Ÿ'
b @@storeChar
@@special2:
cmp r1,0x46 // 'œ'
bne @@special3
mov r1,0x45 // 'Œ'
b @@storeChar
@@special3:
cmp r1,0x62 // 'ý'
bne @@special4
mov r1,0x68 // 'Ý'
b @@storeChar
@@special4:
cmp r1,0x82 // 'þ'
bne @@special5
mov r1,0x69 // 'Þ'
b @@storeChar
@@special5:
cmp r1,0x6B // 'à'
blt @@nextChar
cmp r1,0x87 // 'ü'
bgt @@nextChar
// a-z -> A-Z
sub r1,0x20
@@storeChar:
strb r1,[r0,r2]
@@nextChar:
// Checks capitalizeAll
lsr r1,r7,0x7
bcc @@end
add r2,0x1
b @@loop
@@end:
pop r15
.pool
|
lib/gunzip/src/GzipArchive.asm
|
sharksym/vgmplay-sharksym
| 6 |
94485
|
;
; Gzip archive
;
GzipArchive_SIGNATURE_1: equ 1FH
GzipArchive_SIGNATURE_2: equ 8BH
GzipArchive_DEFLATE_ID: equ 8
GzipArchive_FTEXT: equ 1 << 0;
GzipArchive_FHCRC: equ 1 << 1;
GzipArchive_FEXTRA: equ 1 << 2;
GzipArchive_FNAME: equ 1 << 3;
GzipArchive_FCOMMENT: equ 1 << 4;
GzipArchive_RESERVED: equ 1 << 5 | 1 << 6 | 1 << 7;
GzipArchive: MACRO
reader:
dw 0
inflate:
dw 0
crc32CheckEnabled:
IF GZIP_CRC32
db 0
ENDIF
crc32Checker:
IF GZIP_CRC32
dw 0
ENDIF
flags:
db 0
mtime:
dd 0
xfl:
db 0
os:
db 0
isize:
dd 0
crc32:
IF GZIP_CRC32
dd 0
ENDIF
_size:
ENDM
GzipArchive_class: Class GzipArchive, GzipArchive_template, Heap_main
GzipArchive_template: GzipArchive
; a = -1: CRC32 check enabled, 0: disabled
; de = reader
; ix = this
; ix <- this
; de <- this
GzipArchive_Construct:
ld (ix + GzipArchive.reader),e
ld (ix + GzipArchive.reader + 1),d
IF GZIP_CRC32
ld (ix + GzipArchive.crc32CheckEnabled),a
ENDIF
call GzipArchive_ReadHeader
ld e,ixl
ld d,ixh
ret
; ix = this
; ix <- this
GzipArchive_Destruct:
ret
; ix = this
; de <- file reader
; iy <- file reader
GzipArchive_GetReaderIY:
ld e,(ix + GzipArchive.reader)
ld d,(ix + GzipArchive.reader + 1)
ld iyl,e
ld iyh,d
ret
; ix = this
; de <- Inflate implementation
; ix <- Inflate implementation
GzipArchive_GetInflate:
ld e,(ix + GzipArchive.inflate)
ld d,(ix + GzipArchive.inflate + 1)
ld ixl,e
ld ixh,d
ret
; ix = this
GzipArchive_ReadHeader:
call GzipArchive_GetReaderIY
call Reader_Read_IY
cp GzipArchive_SIGNATURE_1
ld hl,GzipArchive_notGzipError
jp nz,System_ThrowExceptionWithMessage
call Reader_Read_IY
cp GzipArchive_SIGNATURE_2
ld hl,GzipArchive_notGzipError
jp nz,System_ThrowExceptionWithMessage
call Reader_Read_IY
cp GzipArchive_DEFLATE_ID
ld hl,GzipArchive_notDeflateError
jp nz,System_ThrowExceptionWithMessage
call Reader_Read_IY
ld (ix + GzipArchive.flags),a
call Reader_ReadDoubleWord_IY
ld (ix + GzipArchive.mtime),l
ld (ix + GzipArchive.mtime + 1),h
ld (ix + GzipArchive.mtime + 2),e
ld (ix + GzipArchive.mtime + 3),d
call Reader_Read_IY
ld (ix + GzipArchive.xfl),a
call Reader_Read_IY
ld (ix + GzipArchive.os),a
ld a,(ix + GzipArchive.flags)
and GzipArchive_RESERVED
ld hl,GzipArchive_unknownFlagError
jp nz,System_ThrowExceptionWithMessage
ld a,(ix + GzipArchive.flags)
and GzipArchive_FEXTRA
call nz,GzipArchive_SkipExtra
ld a,(ix + GzipArchive.flags)
and GzipArchive_FNAME
call nz,GzipArchive_SkipASCIIZ
ld a,(ix + GzipArchive.flags)
and GzipArchive_FCOMMENT
call nz,GzipArchive_SkipASCIIZ
ld a,(ix + GzipArchive.flags)
and GzipArchive_FHCRC
call nz,GzipArchive_SkipHeaderCRC
ret
; ix = this
GzipArchive_ReadFooter:
call GzipArchive_GetReaderIY
call Reader_ReadDoubleWord_IY
IF GZIP_CRC32
ld (ix + GzipArchive.crc32),l
ld (ix + GzipArchive.crc32 + 1),h
ld (ix + GzipArchive.crc32 + 2),e
ld (ix + GzipArchive.crc32 + 3),d
ENDIF
call Reader_ReadDoubleWord_IY
ld (ix + GzipArchive.isize),l
ld (ix + GzipArchive.isize + 1),h
ld (ix + GzipArchive.isize + 2),e
ld (ix + GzipArchive.isize + 3),d
ret
; de = writer (min 32K)
; ix = this
GzipArchive_Extract:
IF GZIP_CRC32
bit 0,(ix + GzipArchive.crc32CheckEnabled)
call nz,GzipArchive_CreateCRC32Checker
ENDIF
call GzipArchive_CreateInflate
call GzipArchive_Inflate
call GzipArchive_ReadFooter
call GzipArchive_Verify
call GzipArchive_DestroyInflate
IF GZIP_CRC32
bit 0,(ix + GzipArchive.crc32CheckEnabled)
call nz,GzipArchive_DestroyCRC32Checker
ENDIF
ret
; de = writer (min 32K)
; ix = this
GzipArchive_CreateInflate:
ld l,(ix + GzipArchive.reader)
ld h,(ix + GzipArchive.reader + 1)
push ix
call Inflate_class.New
call Inflate_Construct
pop ix
ld (ix + GzipArchive.inflate),e
ld (ix + GzipArchive.inflate + 1),d
ret
; ix = this
GzipArchive_DestroyInflate:
push ix
call GzipArchive_GetInflate
call Inflate_Destruct
call Inflate_class.Delete
pop ix
ld (ix + GzipArchive.inflate),0
ld (ix + GzipArchive.inflate + 1),0
ret
; de = writer (min 32K)
; ix = this
GzipArchive_CreateCRC32Checker:
IF GZIP_CRC32
push de
push ix
call CRC32Checker_class.New
call CRC32Checker_Construct
pop ix
ld (ix + GzipArchive.crc32Checker),e
ld (ix + GzipArchive.crc32Checker + 1),d
pop de
ret
ENDIF
; de = writer (min 32K)
; ix = this
GzipArchive_DestroyCRC32Checker:
IF GZIP_CRC32
ld e,(ix + GzipArchive.crc32Checker)
ld d,(ix + GzipArchive.crc32Checker + 1)
push ix
ld ixl,e
ld ixh,d
call CRC32Checker_Destruct
call CRC32Checker_class.Delete
pop ix
ret
ENDIF
; ix = this
GzipArchive_Inflate:
push ix
call GzipArchive_GetInflate
call Inflate_Inflate
pop ix
ret
; ix = this
GzipArchive_Verify:
call GzipArchive_VerifyISIZE
ld hl,GzipArchive_isizeMismatchError
jp nz,System_ThrowExceptionWithMessage
IF GZIP_CRC32
call GzipArchive_VerifyCRC32
ld hl,GzipArchive_crc32MismatchError
jp nz,System_ThrowExceptionWithMessage
ENDIF
ret
; ix = this
GzipArchive_SkipExtra:
call GzipArchive_GetReaderIY
call Reader_ReadWord_IY
ld c,e
ld b,d
jp Reader_Skip_IY
; ix = this
GzipArchive_SkipASCIIZ: PROC
call GzipArchive_GetReaderIY
Loop:
call Reader_Read_IY
and a
jp nz,Loop
ret
ENDP
; ix = this
GzipArchive_SkipHeaderCRC:
call GzipArchive_GetReaderIY
jp Reader_ReadWord_IY
; ix = this
; f <- nz: mismatch
GzipArchive_VerifyISIZE:
push ix
call GzipArchive_GetInflate
call Inflate_GetWriter
call Writer_GetCount
pop ix
ld a,e
cp (ix + GzipArchive.isize)
ret nz
ld a,d
cp (ix + GzipArchive.isize + 1)
ret nz
ld a,c
cp (ix + GzipArchive.isize + 2)
ret nz
ld a,b
cp (ix + GzipArchive.isize + 3)
ret
; ix = this
; f <- nz: mismatch
GzipArchive_VerifyCRC32:
IF GZIP_CRC32
bit 0,(ix + GzipArchive.crc32CheckEnabled)
ret z
ld e,(ix + GzipArchive.crc32Checker)
ld d,(ix + GzipArchive.crc32Checker + 1)
push de
ld e,(ix + GzipArchive.crc32)
ld d,(ix + GzipArchive.crc32 + 1)
ld c,(ix + GzipArchive.crc32 + 2)
ld b,(ix + GzipArchive.crc32 + 3)
ex (sp),ix
call CRC32Checker_VerifyCRC32
pop ix
ret
ENDIF
;
GzipArchive_notGzipError:
db "Not a GZIP file.",13,10,0
GzipArchive_notDeflateError:
db "Not compressed with DEFLATE.",13,10,0
GzipArchive_unknownFlagError:
db "Unknown flag.",13,10,0
GzipArchive_isizeMismatchError:
db "Inflated size mismatch.",13,10,0
GzipArchive_crc32MismatchError:
IF GZIP_CRC32
db "Inflated CRC32 mismatch.",13,10,0
ENDIF
|
Ada/src/Problem_68.adb
|
Tim-Tom/project-euler
| 0 |
6080
|
<reponame>Tim-Tom/project-euler
with Ada.Text_IO;
package body Problem_68 is
package IO renames Ada.Text_IO;
-- They want 16 digit strings, so we know that every solution will
-- have a 10 on the outside edge of one of the flanges, so we can
-- always start there.
subtype Digit is Positive range 1 .. 10;
subtype Position is Positive range 1 .. 10;
taken : Array (Digit) of Boolean := (10 => True, others => False);
-- 1 + 2 + 3
-- 4 + 3 + 5
-- 6 + 5 + 7
-- 8 + 7 + 9
-- 10 + 9 + 2
values : Array (Position) of Digit;
flanges : constant Array(1 .. 5) of Position := (1, 4, 6, 8, 10);
output_order : constant Array (1 .. 15) of Positive := (1, 2, 3, 4, 3, 5, 6, 5, 7, 8, 7, 9, 10, 9, 2);
result : String(1 .. 16);
sum : Positive;
procedure MakeResult is
min : Position := 1;
flange : Positive := 1;
result_index : Positive := 1;
new_result : String(1 .. 16);
begin
for i in flanges'Range loop
if values(flanges(i)) < values(min) then
flange := i;
min := flanges(i);
end if;
end loop;
flange := flange * 3;
for i in flange .. output_order'Last loop
if values(output_order(i)) = 10 then
new_result(result_index) := '1';
new_result(result_index + 1) := '0';
result_index := result_index + 2;
else
new_result(result_index) := Character'Val(Character'Pos('0') + values(output_order(i)));
result_index := result_index + 1;
end if;
end loop;
for i in 1 .. flange - 1 loop
if values(output_order(i)) = 10 then
new_result(result_index) := '1';
new_result(result_index + 1) := '0';
result_index := result_index + 2;
else
new_result(result_index) := Character'Val(Character'Pos('0') + values(output_order(i)));
result_index := result_index + 1;
end if;
end loop;
if result < new_result then
result := new_result;
end if;
end MakeResult;
procedure SolveTenth is
num : constant Integer := sum - values(9) - values(2);
begin
if (num > 0 and num < 10) and then not taken(num) then
values(10) := num;
taken(num) := True;
MakeResult;
taken(num) := False;
end if;
end SolveTenth;
procedure SolveNinth is
num : constant Integer := sum - values(8) - values(7);
begin
if (num > 0 and num < 10) and then not taken(num) then
values(9) := num;
taken(num) := True;
SolveTenth;
taken(num) := False;
end if;
end SolveNinth;
procedure SolveEighth is
begin
for num in taken'Range loop
if not taken(num) then
values(8) := num;
taken(num) := True;
SolveNinth;
taken(num) := False;
end if;
end loop;
end SolveEighth;
procedure SolveSeventh is
num : constant Integer := sum - values(6) - values(5);
begin
if (num > 0 and num < 10) and then not taken(num) then
values(7) := num;
taken(num) := True;
SolveEighth;
taken(num) := False;
end if;
end SolveSeventh;
procedure SolveSixth is
begin
for num in taken'Range loop
if not taken(num) then
values(6) := num;
taken(num) := True;
SolveSeventh;
taken(num) := False;
end if;
end loop;
end SolveSixth;
procedure SolveFifth is
num : constant Integer := sum - values(3) - values(4);
begin
if (num > 0 and num < 10) and then not taken(num) then
values(5) := num;
taken(num) := True;
SolveSixth;
taken(num) := False;
end if;
end SolveFifth;
procedure SolveFourth is
begin
for num in taken'Range loop
if not taken(num) then
values(4) := num;
taken(num) := True;
SolveFifth;
taken(num) := False;
end if;
end loop;
end SolveFourth;
procedure SolveThird is
begin
for num in taken'Range loop
if not taken(num) then
values(3) := num;
taken(num) := True;
sum := values(1) + values(2) + values(3);
SolveFourth;
taken(num) := False;
end if;
end loop;
end SolveThird;
procedure SolveSecond is
begin
for num in taken'Range loop
if not taken(num) then
values(2) := num;
taken(num) := True;
SolveThird;
taken(num) := False;
end if;
end loop;
end SolveSecond;
procedure Solve is
begin
values(1) := 10;
SolveSecond;
IO.Put_Line(result);
end Solve;
end Problem_68;
|
antlr/grammar/LambdaCalculus.g4
|
supersven/lambda-core
| 0 |
2048
|
grammar LambdaCalculus;
expression: application | lambda | variable | integer;
application: '('expression')' expression;
lambda: '\\' parameters '->' expression;
integer: INT;
variable: VARIABLE;
parameters: parameter*;
parameter: VARIABLE;
VARIABLE: 'A'..'Z' | 'a'..'z';
INT: [0-9]+;
WS : [ \t\r\n]+ -> skip ;
|
_maps/obj4E.asm
|
vladjester2020/Sonic1TMR
| 0 |
10880
|
<filename>_maps/obj4E.asm
; ---------------------------------------------------------------------------
; Sprite mappings - advancing wall of lava (MZ)
; ---------------------------------------------------------------------------
dc.w byte_F538-Map_obj4E
dc.w byte_F566-Map_obj4E
dc.w byte_F594-Map_obj4E
dc.w byte_F5C2-Map_obj4E
dc.w byte_F5F0-Map_obj4E
byte_F538: dc.b 9
dc.b $E0, $F, 0, $60, $20
dc.b 0, $F, 0, $70, $3C
dc.b 0, $F, $FF, $2A, $20
dc.b $E0, $F, $FF, $2A, 0
dc.b 0, $F, $FF, $2A, 0
dc.b $E0, $F, $FF, $2A, $E0
dc.b 0, $F, $FF, $2A, $E0
dc.b $E0, $F, $FF, $2A, $C0
dc.b 0, $F, $FF, $2A, $C0
byte_F566: dc.b 9
dc.b $E0, $F, 0, $70, $20
dc.b 0, $F, 0, $80, $3C
dc.b 0, $F, $FF, $2A, $20
dc.b $E0, $F, $FF, $2A, 0
dc.b 0, $F, $FF, $2A, 0
dc.b $E0, $F, $FF, $2A, $E0
dc.b 0, $F, $FF, $2A, $E0
dc.b $E0, $F, $FF, $2A, $C0
dc.b 0, $F, $FF, $2A, $C0
byte_F594: dc.b 9
dc.b $E0, $F, 0, $80, $20
dc.b 0, $F, 0, $70, $3C
dc.b 0, $F, $FF, $2A, $20
dc.b $E0, $F, $FF, $2A, 0
dc.b 0, $F, $FF, $2A, 0
dc.b $E0, $F, $FF, $2A, $E0
dc.b 0, $F, $FF, $2A, $E0
dc.b $E0, $F, $FF, $2A, $C0
dc.b 0, $F, $FF, $2A, $C0
byte_F5C2: dc.b 9
dc.b $E0, $F, 0, $70, $20
dc.b 0, $F, 0, $60, $3C
dc.b 0, $F, $FF, $2A, $20
dc.b $E0, $F, $FF, $2A, 0
dc.b 0, $F, $FF, $2A, 0
dc.b $E0, $F, $FF, $2A, $E0
dc.b 0, $F, $FF, $2A, $E0
dc.b $E0, $F, $FF, $2A, $C0
dc.b 0, $F, $FF, $2A, $C0
byte_F5F0: dc.b 8
dc.b $E0, $F, $FF, $2A, $20
dc.b 0, $F, $FF, $2A, $20
dc.b $E0, $F, $FF, $2A, 0
dc.b 0, $F, $FF, $2A, 0
dc.b $E0, $F, $FF, $2A, $E0
dc.b 0, $F, $FF, $2A, $E0
dc.b $E0, $F, $FF, $2A, $C0
dc.b 0, $F, $FF, $2A, $C0
even
|
dsl/antlr/Expr/Java.g4
|
y2ghost/study
| 0 |
2079
|
<gh_stars>0
grammar Java;
@lexer::members {
protected boolean enumIsKeyword = true;
protected boolean assertIsKeyword = true;
}
compilationUnit: packageDeclaration? importDeclaration* typeDeclaration* EOF;
packageDeclaration: 'package' qualifiedName ';';
importDeclaration: 'import' 'static'? qualifiedName ('.' '*')? ';';
typeDeclaration: classOrInterfaceModifier*
(classDeclaration
| interfaceDeclaration
| enumDeclaration)
|';'
;
classDeclaration: 'class' Identifier typeParameters? ('extends' type)?
('implements' typeList)?
classBody
;
enumDeclaration: ENUM Identifier ('implements' typeList)? enumBody;
interfaceDeclaration: normalInterfaceDeclaration
| annotationTypeDeclaration
;
classOrInterfaceModifier: annotation
| 'public'
| 'protected'
| 'private'
| 'abstract'
| 'static'
| 'final'
| 'strictfp'
;
modifiers: modifier*;
typeParameters: '<' typeParameter (',' typeParameter)* '>';
typeParameter: Identifier ('extends' typeBound)?;
typeBound: type ('&' type)*;
enumBody: '{' enumConstants? ','? enumBodyDeclarations? '}';
enumConstants: enumConstant (',' enumConstant)*;
enumConstant: annotations? Identifier arguments? classBody?;
enumBodyDeclarations: ';' (classBodyDeclaration)*;
normalInterfaceDeclaration:
'interface' Identifier typeParameters? ('extends' typeList)? interfaceBody
;
typeList: type (',' type)*;
classBody: '{' classBodyDeclaration* '}';
interfaceBody: '{' interfaceBodyDeclaration* '}';
classBodyDeclaration: ';'
| 'static'? block
| modifiers member
;
member: genericMethodDeclaration
| methodDeclaration
| fieldDeclaration
| constructorDeclaration
| interfaceDeclaration
| classDeclaration
;
methodDeclaration:
type Identifier formalParameters ('[' ']')* methodDeclarationRest
| 'void' Identifier formalParameters methodDeclarationRest
;
methodDeclarationRest: ('throws' qualifiedNameList)?
( methodBody
| ';'
)
;
genericMethodDeclaration: typeParameters methodDeclaration;
fieldDeclaration: type variableDeclarators ';';
constructorDeclaration: typeParameters? Identifier formalParameters
('throws' qualifiedNameList)? constructorBody
;
interfaceBodyDeclaration: modifiers interfaceMemberDecl | ';';
interfaceMemberDecl: interfaceMethodOrFieldDecl
| interfaceGenericMethodDecl
| 'void' Identifier voidInterfaceMethodDeclaratorRest
| interfaceDeclaration
| classDeclaration
;
interfaceMethodOrFieldDecl
: type Identifier interfaceMethodOrFieldRest
;
interfaceMethodOrFieldRest
: constantDeclaratorsRest ';'
| interfaceMethodDeclaratorRest
;
voidMethodDeclaratorRest
: formalParameters ('throws' qualifiedNameList)?
( methodBody
| ';'
)
;
interfaceMethodDeclaratorRest
: formalParameters ('[' ']')* ('throws' qualifiedNameList)? ';'
;
interfaceGenericMethodDecl
: typeParameters (type | 'void') Identifier
interfaceMethodDeclaratorRest
;
voidInterfaceMethodDeclaratorRest
: formalParameters ('throws' qualifiedNameList)? ';'
;
constantDeclarator
: Identifier constantDeclaratorRest
;
variableDeclarators
: variableDeclarator (',' variableDeclarator)*
;
variableDeclarator
: variableDeclaratorId ('=' variableInitializer)?
;
constantDeclaratorsRest
: constantDeclaratorRest (',' constantDeclarator)*
;
constantDeclaratorRest
: ('[' ']')* '=' variableInitializer
;
variableDeclaratorId
: Identifier ('[' ']')*
;
variableInitializer
: arrayInitializer
| expression
;
arrayInitializer
: '{' (variableInitializer (',' variableInitializer)* (',')? )? '}'
;
modifier
: annotation
| 'public'
| 'protected'
| 'private'
| 'static'
| 'abstract'
| 'final'
| 'native'
| 'synchronized'
| 'transient'
| 'volatile'
| 'strictfp'
;
packageOrTypeName
: qualifiedName
;
enumConstantName
: Identifier
;
typeName
: qualifiedName
;
type: classOrInterfaceType ('[' ']')*
| primitiveType ('[' ']')*
;
classOrInterfaceType
: Identifier typeArguments? ('.' Identifier typeArguments? )*
;
primitiveType
: 'boolean'
| 'char'
| 'byte'
| 'short'
| 'int'
| 'long'
| 'float'
| 'double'
;
variableModifier
: 'final'
| annotation
;
typeArguments
: '<' typeArgument (',' typeArgument)* '>'
;
typeArgument
: type
| '?' (('extends' | 'super') type)?
;
qualifiedNameList
: qualifiedName (',' qualifiedName)*
;
formalParameters
: '(' formalParameterDecls? ')'
;
formalParameterDecls
: variableModifiers type formalParameterDeclsRest
;
formalParameterDeclsRest
: variableDeclaratorId (',' formalParameterDecls)?
| '...' variableDeclaratorId
;
methodBody
: block
;
constructorBody
: '{' explicitConstructorInvocation? blockStatement* '}'
;
explicitConstructorInvocation
: nonWildcardTypeArguments? ('this' | 'super') arguments ';'
| primary '.' nonWildcardTypeArguments? 'super' arguments ';'
;
qualifiedName
: Identifier ('.' Identifier)*
;
literal
: integerLiteral
| FloatingPointLiteral
| CharacterLiteral
| StringLiteral
| booleanLiteral
| 'null'
;
integerLiteral
: HexLiteral
| OctalLiteral
| DecimalLiteral
;
booleanLiteral
: 'true'
| 'false'
;
annotations
: annotation+
;
annotation
: '@' annotationName ( '(' ( elementValuePairs | elementValue )? ')' )?
;
annotationName
: Identifier ('.' Identifier)*
;
elementValuePairs
: elementValuePair (',' elementValuePair)*
;
elementValuePair
: Identifier '=' elementValue
;
elementValue
: expression
| annotation
| elementValueArrayInitializer
;
elementValueArrayInitializer
: '{' (elementValue (',' elementValue)*)? (',')? '}'
;
annotationTypeDeclaration
: '@' 'interface' Identifier annotationTypeBody
;
annotationTypeBody
: '{' (annotationTypeElementDeclaration)* '}'
;
annotationTypeElementDeclaration
: modifiers annotationTypeElementRest
;
annotationTypeElementRest
: type annotationMethodOrConstantRest ';'
| classDeclaration ';'?
| normalInterfaceDeclaration ';'?
| enumDeclaration ';'?
| annotationTypeDeclaration ';'?
;
annotationMethodOrConstantRest
: annotationMethodRest
| annotationConstantRest
;
annotationMethodRest
: Identifier '(' ')' defaultValue?
;
annotationConstantRest
: variableDeclarators
;
defaultValue
: 'default' elementValue
;
block
: '{' blockStatement* '}'
;
blockStatement
: localVariableDeclarationStatement
| classDeclaration
| interfaceDeclaration
| statement
;
localVariableDeclarationStatement
: localVariableDeclaration ';'
;
localVariableDeclaration
: variableModifiers type variableDeclarators
;
variableModifiers
: variableModifier*
;
statement
: block
| ASSERT expression (':' expression)? ';'
| 'if' parExpression statement ('else' statement)?
| 'for' '(' forControl ')' statement
| 'while' parExpression statement
| 'do' statement 'while' parExpression ';'
| 'try' block
( catches 'finally' block
| catches
| 'finally' block
)
| 'switch' parExpression switchBlock
| 'synchronized' parExpression block
| 'return' expression? ';'
| 'throw' expression ';'
| 'break' Identifier? ';'
| 'continue' Identifier? ';'
| ';'
| statementExpression ';'
| Identifier ':' statement
;
catches
: catchClause (catchClause)*
;
catchClause
: 'catch' '(' formalParameter ')' block
;
formalParameter
: variableModifiers type variableDeclaratorId
;
switchBlock
: '{' switchBlockStatementGroup* switchLabel* '}'
;
switchBlockStatementGroup
: switchLabel+ blockStatement*
;
switchLabel
: 'case' constantExpression ':'
| 'case' enumConstantName ':'
| 'default' ':'
;
forControl
: enhancedForControl
| forInit? ';' expression? ';' forUpdate?
;
forInit
: localVariableDeclaration
| expressionList
;
enhancedForControl
: variableModifiers type Identifier ':' expression
;
forUpdate
: expressionList
;
parExpression
: '(' expression ')'
;
expressionList
: expression (',' expression)*
;
statementExpression
: expression
;
constantExpression
: expression
;
expression
: primary
| expression '.' Identifier
| expression '.' 'this'
| expression '.' 'super' '(' expressionList? ')'
| expression '.' 'new' Identifier '(' expressionList? ')'
| expression '.' 'super' '.' Identifier arguments?
| expression '.' explicitGenericInvocation
| expression '[' expression ']'
| expression '(' expressionList? ')'
| expression ('++' | '--')
| ('+'|'-'|'++'|'--') expression
| ('~'|'!') expression
| '(' type ')' expression
| 'new' creator
| expression ('*'|'/'|'%') expression
| expression ('+'|'-') expression
| expression ('<' '<' | '>' '>' '>' | '>' '>') expression
| expression ('<' '=' | '>' '=' | '>' | '<') expression
| expression 'instanceof' type
| expression ('==' | '!=') expression
| expression '&' expression
| expression '^' expression
| expression '|' expression
| expression '&&' expression
| expression '||' expression
| expression '?' expression ':' expression
| <assoc=right> expression
('^='
|'+='
|'-='
|'*='
|'/='
|'&='
|'|='
|'='
|'>' '>' '='
|'>' '>' '>' '='
|'<' '<' '='
|'%='
)
expression
;
primary
: '(' expression ')'
| 'this'
| 'super'
| literal
| Identifier
| type '.' 'class'
| 'void' '.' 'class'
;
creator
: nonWildcardTypeArguments createdName classCreatorRest
| createdName (arrayCreatorRest | classCreatorRest)
;
createdName
: classOrInterfaceType
| primitiveType
;
innerCreator
: nonWildcardTypeArguments? Identifier classCreatorRest
;
explicitGenericInvocation
: nonWildcardTypeArguments Identifier arguments
;
arrayCreatorRest
: '['
( ']' ('[' ']')* arrayInitializer
| expression ']' ('[' expression ']')* ('[' ']')*
)
;
classCreatorRest
: arguments classBody?
;
nonWildcardTypeArguments
: '<' typeList '>'
;
arguments
: '(' expressionList? ')'
;
HexLiteral: '0' ('x'|'X') HexDigit+ IntegerTypeSuffix?;
DecimalLiteral: ('0' | '1'..'9' '0'..'9'*) IntegerTypeSuffix?;
OctalLiteral: '0' ('0'..'7')+ IntegerTypeSuffix?;
fragment
HexDigit: ('0'..'9'|'a'..'f'|'A'..'F');
fragment
IntegerTypeSuffix: ('l'|'L');
FloatingPointLiteral
: ('0'..'9')+ '.' ('0'..'9')* Exponent? FloatTypeSuffix?
| '.' ('0'..'9')+ Exponent? FloatTypeSuffix?
| ('0'..'9')+ Exponent FloatTypeSuffix?
| ('0'..'9')+ FloatTypeSuffix
| ('0x' | '0X') (HexDigit )*
('.' (HexDigit)*)?
( 'p' | 'P' )
( '+' | '-' )?
( '0' .. '9' )+
FloatTypeSuffix?
;
fragment
Exponent: ('e'|'E') ('+'|'-')? ('0'..'9')+;
fragment
FloatTypeSuffix: ('f'|'F'|'d'|'D');
CharacterLiteral
: '\'' ( EscapeSequence | ~('\''|'\\') ) '\''
;
StringLiteral
: '"' ( EscapeSequence | ~('\\'|'"') )* '"'
;
fragment
EscapeSequence
: '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\')
| UnicodeEscape
| OctalEscape
;
fragment
OctalEscape
: '\\' ('0'..'3') ('0'..'7') ('0'..'7')
| '\\' ('0'..'7') ('0'..'7')
| '\\' ('0'..'7')
;
fragment
UnicodeEscape
: '\\' 'u' HexDigit HexDigit HexDigit HexDigit
;
ENUM: 'enum' {if (!enumIsKeyword) setType(Identifier);}
;
ASSERT
: 'assert' {if (!assertIsKeyword) setType(Identifier);}
;
Identifier
: Letter (Letter|JavaIDDigit)*
;
fragment
Letter
: '\u0024' |
'\u0041'..'\u005a' |
'\u005f' |
'\u0061'..'\u007a' |
'\u00c0'..'\u00d6' |
'\u00d8'..'\u00f6' |
'\u00f8'..'\u00ff' |
'\u0100'..'\u1fff' |
'\u3040'..'\u318f' |
'\u3300'..'\u337f' |
'\u3400'..'\u3d2d' |
'\u4e00'..'\u9fff' |
'\uf900'..'\ufaff'
;
fragment
JavaIDDigit
: '\u0030'..'\u0039' |
'\u0660'..'\u0669' |
'\u06f0'..'\u06f9' |
'\u0966'..'\u096f' |
'\u09e6'..'\u09ef' |
'\u0a66'..'\u0a6f' |
'\u0ae6'..'\u0aef' |
'\u0b66'..'\u0b6f' |
'\u0be7'..'\u0bef' |
'\u0c66'..'\u0c6f' |
'\u0ce6'..'\u0cef' |
'\u0d66'..'\u0d6f' |
'\u0e50'..'\u0e59' |
'\u0ed0'..'\u0ed9' |
'\u1040'..'\u1049'
;
COMMENT
: '/*' .*? '*/' -> channel(HIDDEN)
;
WS:[ \r\t\u000C\n]+ -> channel(HIDDEN);
LINE_COMMENT: '//' ~[\r\n]* '\r'? '\n' -> channel(HIDDEN);
|
oeis/226/A226540.asm
|
neoneye/loda-programs
| 11 |
85762
|
<reponame>neoneye/loda-programs<gh_stars>10-100
; A226540: Maximum of the proper divisors of the triangular numbers.
; Submitted by <NAME>(s2)
; 1,3,5,5,7,14,18,15,11,33,39,13,35,60,68,51,57,95,105,77,23,138,150,65,117,189,203,145,155,248,264,187,119,315,333,37,247,390,410,287,301,473,495,345,47,564,588,245,425,663,689,477,495,770,798,551,59,885,915,61,651,1008,1040,715,737,1139,1173,805,497,1278,1314,73,925,1425,1463,1001,1027,1580,1620,1107,83,1743,1785,731,1247,1914,1958,1335,1365,2093,2139,1457,893,2280,2328,679,1617,2475,2525,1717
add $0,1
seq $0,96 ; a(n) = n*(n+3)/2.
seq $0,32742 ; a(1) = 1; for n > 1, a(n) = largest proper divisor of n.
|
test/Succeed/Issue4784.agda
|
KDr2/agda
| 0 |
5172
|
{-# OPTIONS --cubical-compatible #-}
postulate
A : Set
B : A → Set
@0 T : Set
T = (@0 x : A) → B x
_ : Set₁
_ = (@0 A : Set) → @0 A → (@0 x : A) → Set
data D : Set₁ where
@0 c : (@0 A : Set) → A → (x : A) → D
|
programs/oeis/105/A105348.asm
|
jmorken/loda
| 1 |
4108
|
; A105348: An indicator sequence for the Jacobsthal numbers.
; 1,2,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
mov $2,2
mov $4,$0
lpb $2
mov $0,$4
sub $2,1
add $0,$2
sub $0,1
mul $0,9
add $0,1
mov $3,$5
lpb $0
div $0,2
trn $0,1
add $3,7
lpe
mov $6,$2
lpb $6
mov $1,$3
sub $6,1
lpe
lpe
lpb $4
sub $1,$3
mov $4,0
lpe
div $1,7
|
source/oasis/program-elements-definitions.ads
|
reznikmm/gela
| 0 |
20258
|
<reponame>reznikmm/gela
-- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
package Program.Elements.Definitions is
pragma Pure (Program.Elements.Definitions);
type Definition is limited interface and Program.Elements.Element;
type Definition_Access is access all Definition'Class
with Storage_Size => 0;
end Program.Elements.Definitions;
|
archive/agda-2/Oscar/Data/List.agda
|
m0davis/oscar
| 0 |
5676
|
<filename>archive/agda-2/Oscar/Data/List.agda
module Oscar.Data.List where
open import Agda.Builtin.List public using (List; []; _∷_)
|
programs/oeis/033/A033044.asm
|
neoneye/loda
| 22 |
4208
|
; A033044: Sums of distinct powers of 7.
; 0,1,7,8,49,50,56,57,343,344,350,351,392,393,399,400,2401,2402,2408,2409,2450,2451,2457,2458,2744,2745,2751,2752,2793,2794,2800,2801,16807,16808,16814,16815,16856,16857,16863,16864,17150,17151,17157,17158,17199,17200,17206,17207,19208,19209,19215,19216,19257,19258,19264,19265,19551,19552,19558,19559,19600,19601,19607,19608,117649,117650,117656,117657,117698,117699,117705,117706,117992,117993,117999,118000,118041,118042,118048,118049,120050,120051,120057,120058,120099,120100,120106,120107,120393,120394,120400,120401,120442,120443,120449,120450,134456,134457,134463,134464
add $0,8190
seq $0,32928 ; Numbers whose set of base 7 digits is {1,2}.
sub $0,16148168401
|
programs/oeis/070/A070513.asm
|
neoneye/loda
| 22 |
13809
|
; A070513: a(n) = n^4 mod 9.
; 0,1,7,0,4,4,0,7,1,0,1,7,0,4,4,0,7,1,0,1,7,0,4,4,0,7,1,0,1,7,0,4,4,0,7,1,0,1,7,0,4,4,0,7,1,0,1,7,0,4,4,0,7,1,0,1,7,0,4,4,0,7,1,0,1,7,0,4,4,0,7,1,0,1,7,0,4,4,0,7,1,0,1,7,0,4,4,0,7,1,0,1,7,0,4,4,0,7,1,0
pow $0,4
mod $0,9
|
plugin/tooltip_and_button_asm.asm
|
matanki-saito/vic2dll
| 0 |
88245
|
EXTERN _tooltipAndButtonProc1ReturnAddress: DWORD
EXTERN _tooltipAndButtonProc2ReturnAddress: DWORD
EXTERN _tooltipAndButtonProc3ReturnAddress: DWORD
EXTERN _tooltipAndButtonProc4ReturnAddress: DWORD
EXTERN _tooltipAndButtonProc4CallAddress: DWORD
ESCAPE_SEQ_1 = 10h
ESCAPE_SEQ_2 = 11h
ESCAPE_SEQ_3 = 12h
ESCAPE_SEQ_4 = 13h
LOW_SHIFT = 0Eh
HIGH_SHIFT = 9h
SHIFT_2 = LOW_SHIFT
SHIFT_3 = 900h
SHIFT_4 = 8F2h
NO_FONT = 98Fh
NOT_DEF = 2026h
.MODEL FLAT, C
.DATA
tmp1 DW 0
.CODE
tooltipAndButtonProc1 PROC
cmp byte ptr[eax + ebx], ESCAPE_SEQ_1;
jz JMP_A;
cmp byte ptr[eax + ebx], ESCAPE_SEQ_2;
jz JMP_B;
cmp byte ptr[eax + ebx], ESCAPE_SEQ_3;
jz JMP_C;
cmp byte ptr[eax + ebx], ESCAPE_SEQ_4;
jz JMP_D;
movzx eax, byte ptr [eax + ebx];
jmp JMP_E;
JMP_A:
movzx eax, word ptr[eax + ebx + 1];
jmp JMP_F;
JMP_B:
movzx eax, word ptr[eax + ebx + 1];
sub eax, SHIFT_2;
jmp JMP_F;
JMP_C:
movzx eax, word ptr[eax + ebx + 1];
add eax, SHIFT_3;
jmp JMP_F;
JMP_D:
movzx eax, word ptr[eax + ebx + 1];
add eax, SHIFT_4;
JMP_F:
movzx eax, ax;
mov esi, [esp + 400h - 3DCh]
add esi, 2;
mov [esp + 400h - 3DCh], esi
cmp eax, NO_FONT;
ja JMP_E;
mov eax, NOT_DEF;
JMP_E:
mov esi, [edi+eax*4 + 94h]
test esi, esi
push _tooltipAndButtonProc1ReturnAddress
ret
tooltipAndButtonProc1 ENDP
;------------------------------;
tooltipAndButtonProc2 PROC
cmp byte ptr[eax + esi], ESCAPE_SEQ_1;
jz JMP_A;
cmp byte ptr[eax + esi], ESCAPE_SEQ_2;
jz JMP_B;
cmp byte ptr[eax + esi], ESCAPE_SEQ_3;
jz JMP_C;
cmp byte ptr[eax + esi], ESCAPE_SEQ_4;
jz JMP_D;
movzx eax, byte ptr [eax + esi];
jmp JMP_E;
JMP_A:
movzx eax, word ptr[eax + esi + 1];
jmp JMP_F;
JMP_B:
movzx eax, word ptr[eax + esi + 1];
sub eax, SHIFT_2;
jmp JMP_F;
JMP_C:
movzx eax, word ptr[eax + esi + 1];
add eax, SHIFT_3;
jmp JMP_F;
JMP_D:
movzx eax, word ptr[eax + esi + 1];
add eax, SHIFT_4;
JMP_F:
movzx eax, ax;
add esi, 2;
cmp eax, NO_FONT;
ja JMP_E;
mov eax, NOT_DEF;
JMP_E:
mov edi, [edi+eax*4 + 94h]
test edi, edi
push _tooltipAndButtonProc2ReturnAddress
ret
tooltipAndButtonProc2 ENDP
;------------------------------;
tooltipAndButtonProc3 PROC
cmp byte ptr[eax + esi], ESCAPE_SEQ_1;
jz JMP_A;
cmp byte ptr[eax + esi], ESCAPE_SEQ_2;
jz JMP_B;
cmp byte ptr[eax + esi], ESCAPE_SEQ_3;
jz JMP_C;
cmp byte ptr[eax + esi], ESCAPE_SEQ_4;
jz JMP_D;
movzx eax, byte ptr [eax + esi];
jmp JMP_E;
JMP_A:
movzx eax, word ptr[eax + esi + 1];
jmp JMP_F;
JMP_B:
movzx eax, word ptr[eax + esi + 1];
sub eax, SHIFT_2;
jmp JMP_F;
JMP_C:
movzx eax, word ptr[eax + esi + 1];
add eax, SHIFT_3;
jmp JMP_F;
JMP_D:
movzx eax, word ptr[eax + esi + 1];
add eax, SHIFT_4;
JMP_F:
movzx eax, ax;
add esi, 2;
cmp eax, NO_FONT;
ja JMP_E;
mov eax, NOT_DEF;
JMP_E:
mov eax, [edi+eax*4 + 94h]
test eax, eax
push _tooltipAndButtonProc3ReturnAddress
ret
tooltipAndButtonProc3 ENDP
;------------------------------;
tooltipAndButtonProc4 PROC
mov cl, [eax+esi]
mov byte ptr [esp + 400h - 370h], cl
mov dword ptr [esp + 400h - 33Ch], 0Fh
mov dword ptr [esp + 400h - 340h], 0
mov byte ptr [esp + 400h - 350h], 0
mov edx, [esp + 400h - 370h]
push edx
cmp cl, ESCAPE_SEQ_1;
jz JMP_A;
cmp cl, ESCAPE_SEQ_2;
jz JMP_A;
cmp cl, ESCAPE_SEQ_3;
jz JMP_A;
cmp cl, ESCAPE_SEQ_4;
jz JMP_A;
jmp JMP_B;
JMP_A:
push 3
mov ax, word ptr [eax+esi+1]
mov tmp1, ax
jmp JMP_C
JMP_B:
mov tmp1, 0
push 1
JMP_C:
lea ecx, [esp + 408h - 350h]
mov byte ptr [esp + 408h - 4h], 3
call _tooltipAndButtonProc4CallAddress
cmp tmp1, 0
jz JMP_D
mov cx, tmp1
mov word ptr [esp + 400h - 350h + 1], cx
lea ecx, [esp + 400h - 350h]
JMP_D:
push _tooltipAndButtonProc4ReturnAddress
ret
tooltipAndButtonProc4 ENDP
END
|
beafix_benchmarks/BEAFIX_ALL_D3/cv_inv1_2_repair.als
|
Kaixi26/org.alloytools.alloy
| 0 |
3966
|
<reponame>Kaixi26/org.alloytools.alloy
//Line and OP: Line 5 <SSS>
//ORIGINAL: visible
//MUTATION: (visible - profile)
open util/integer as integer
abstract sig Source {
}
sig User extends Source {
profile : set Work,
visible : set Work
}
sig Institution extends Source {
}
sig Id {
}
sig Work {
ids : some Id,
source : one Source
}
pred inv1 []{
all w : Work | (some (visible - profile . w)) => (some (w . profile))
}
pred inv2 []{
all u : User, w : Work | (w in (u . profile)) => ((u in (w . source)) || (some i : Institution | i in (w . source)))
}
pred inv3 []{
all w1, w2 : Work, u : User | ({
w1 != w2
(w1 + w2) in (u . profile)
(w1 . source) = (w2 . source)
}) => (no ((w1 . ids) & (w2 . ids)))
}
pred inv1_OK []{
all u : User | (u . visible) in (u . profile)
}
pred inv2_OK []{
all u : User, w : Work | (w in (u . profile)) => ((u in (w . source)) || (some i : Institution | i in (w . source)))
}
pred inv3_OK []{
all w1, w2 : Work, u : User | ({
w1 != w2
(w1 + w2) in (u . profile)
(w1 . source) = (w2 . source)
}) => (no ((w1 . ids) & (w2 . ids)))
}
assert inv1_Repaired {
inv1[] <=> inv1_OK[]
}
assert inv2_Repaired {
inv2[] <=> inv2_OK[]
}
assert inv3_Repaired {
inv3[] <=> inv3_OK[]
}
check inv1_Repaired expect 0
check inv2_Repaired expect 0
check inv3_Repaired expect 0
|
source/web/servlet/http/matreshka-rfc2616_dates.adb
|
svn2github/matreshka
| 24 |
28496
|
<filename>source/web/servlet/http/matreshka-rfc2616_dates.adb
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2015-2016, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Calendars.ISO_8601;
with League.String_Vectors;
package body Matreshka.RFC2616_Dates is
procedure Parse_Time
(Text : League.Strings.Universal_String;
Hour : out League.Calendars.ISO_8601.Hour_Number;
Minute : out League.Calendars.ISO_8601.Minute_Number;
Second : out League.Calendars.ISO_8601.Second_Number);
procedure Parse_ANSI_Date
(Self : Format'Class;
Text : League.Strings.Universal_String;
Value : out League.Calendars.Date_Time;
Success : out Boolean);
procedure Parse_RFC_1123_Date
(Self : Format'Class;
Text : League.Strings.Universal_String;
Value : out League.Calendars.Date_Time;
Success : out Boolean);
procedure Parse_RFC_850_Date
(Self : Format'Class;
Text : League.Strings.Universal_String;
Value : out League.Calendars.Date_Time;
Success : out Boolean);
-----------------
-- From_String --
-----------------
procedure From_String
(Self : Format;
Text : League.Strings.Universal_String;
Value : out League.Calendars.Date_Time;
Success : out Boolean)
is
Char_4 : constant Wide_Wide_Character
:= Text.Element (4).To_Wide_Wide_Character;
begin
if Char_4 = ',' then
Self.Parse_RFC_1123_Date (Text, Value, Success);
elsif Char_4 = ' ' then
Self.Parse_ANSI_Date (Text, Value, Success);
else
Self.Parse_RFC_850_Date (Text, Value, Success);
end if;
end From_String;
---------------------
-- Parse_ANSI_Date --
---------------------
procedure Parse_ANSI_Date
(Self : Format'Class;
Text : League.Strings.Universal_String;
Value : out League.Calendars.Date_Time;
Success : out Boolean)
is
use League.Calendars.ISO_8601;
List : constant League.String_Vectors.Universal_String_Vector :=
Text.Split (' ', League.Strings.Skip_Empty);
Year : Year_Number;
Month : Month_Number;
Day : Day_Number;
Hour : Hour_Number;
Minute : Minute_Number;
Second : Second_Number;
begin
-- Text example: Sun Nov 6 08:49:37 1994
Year := Year_Number'Wide_Wide_Value
(List.Element (5).To_Wide_Wide_String);
Month := Month_Number
(Self.Month_List.Index (List.Element (2)) / 3);
Day := Day_Number'Wide_Wide_Value
(List.Element (3).To_Wide_Wide_String);
Parse_Time (List.Element (4), Hour, Minute, Second);
Value := Create (Year, Month, Day, Hour, Minute, Second, 0);
Success := True;
exception
when Constraint_Error =>
Success := False;
end Parse_ANSI_Date;
-------------------------
-- Parse_RFC_1123_Date --
-------------------------
procedure Parse_RFC_1123_Date
(Self : Format'Class;
Text : League.Strings.Universal_String;
Value : out League.Calendars.Date_Time;
Success : out Boolean)
is
use League.Calendars.ISO_8601;
use type League.Strings.Universal_String;
List : constant League.String_Vectors.Universal_String_Vector :=
Text.Split (' ');
Year : Year_Number;
Month : Month_Number;
Day : Day_Number;
Hour : Hour_Number;
Minute : Minute_Number;
Second : Second_Number;
begin
-- Text example: Sun, 06 Nov 1994 08:49:37 GMT
Year := Year_Number'Wide_Wide_Value
(List.Element (4).To_Wide_Wide_String);
Month := Month_Number
(Self.Month_List.Index (List.Element (3)) / 3);
Day := Day_Number'Wide_Wide_Value
(List.Element (2).To_Wide_Wide_String);
Success := List.Element (6) = Self.GMT;
Parse_Time (List.Element (5), Hour, Minute, Second);
Value := Create (Year, Month, Day, Hour, Minute, Second, 0);
exception
when Constraint_Error =>
Success := False;
end Parse_RFC_1123_Date;
------------------------
-- Parse_RFC_850_Date --
------------------------
procedure Parse_RFC_850_Date
(Self : Format'Class;
Text : League.Strings.Universal_String;
Value : out League.Calendars.Date_Time;
Success : out Boolean)
is
use League.Calendars.ISO_8601;
use type League.Strings.Universal_String;
List : constant League.String_Vectors.Universal_String_Vector :=
Text.Split (' ');
Date : League.Strings.Universal_String;
Year : Year_Number;
Month : Month_Number;
Day : Day_Number;
Hour : Hour_Number;
Minute : Minute_Number;
Second : Second_Number;
begin
-- Text example: Sunday, 06-Nov-94 08:49:37 GMT
Date := List.Element (2);
Year := Year_Number'Wide_Wide_Value
(Date.Tail_From (8).To_Wide_Wide_String);
if Year in 0 .. 49 then
Year := Year + 2000;
else
Year := Year + 1900;
end if;
Month := Month_Number
(Self.Month_List.Index (Date.Slice (4, 6)) / 3);
Day := Day_Number'Wide_Wide_Value
(Date.Head_To (2).To_Wide_Wide_String);
Success := List.Element (4) = Self.GMT;
Parse_Time (List.Element (3), Hour, Minute, Second);
Value := Create (Year, Month, Day, Hour, Minute, Second, 0);
exception
when Constraint_Error =>
Success := False;
end Parse_RFC_850_Date;
----------------
-- Parse_Time --
----------------
procedure Parse_Time
(Text : League.Strings.Universal_String;
Hour : out League.Calendars.ISO_8601.Hour_Number;
Minute : out League.Calendars.ISO_8601.Minute_Number;
Second : out League.Calendars.ISO_8601.Second_Number)
is
use League.Calendars.ISO_8601;
Time : constant League.String_Vectors.Universal_String_Vector
:= Text.Split (':');
begin
Hour := Hour_Number'Wide_Wide_Value
(Time.Element (1).To_Wide_Wide_String);
Minute := Minute_Number'Wide_Wide_Value
(Time.Element (2).To_Wide_Wide_String);
Second := Second_Number'Wide_Wide_Value
(Time.Element (3).To_Wide_Wide_String);
end Parse_Time;
---------------
-- To_String --
---------------
function To_String
(Self : Format;
Value : League.Calendars.Date_Time)
return League.Strings.Universal_String
is
Result : League.Strings.Universal_String;
begin
Result := League.Calendars.ISO_8601.Image (Self.Pattern, Value);
Result.Append (Self.GMT);
return Result;
end To_String;
end Matreshka.RFC2616_Dates;
|
Task/Hello-world-Newline-omission/Ada/hello-world-newline-omission-1.ada
|
LaudateCorpus1/RosettaCodeData
| 1 |
29436
|
with Ada.Text_IO;
procedure Goodbye_World is
begin
Ada.Text_IO.Put("Goodbye, World!");
end Goodbye_World;
|
src/new_canary_window.applescript
|
caiogondim/alfred-chrome-window-workflow
| 31 |
3299
|
#!/usr/bin/osascript
tell application "Google Chrome Canary"
make new window
tell application "System Events" to set frontmost of process "Google Chrome Canary" to true
activate
end tell
|
drivers/drivers-ntc.ads
|
ekoeppen/MSP430_Generic_Ada_Drivers
| 0 |
19270
|
<reponame>ekoeppen/MSP430_Generic_Ada_Drivers<filename>drivers/drivers-ntc.ads
with Interfaces;
generic
Resistor_Value : Unsigned_32 := 10_000;
NTC_Is_Upper : Boolean := True;
Beta : Positive := 3976;
V_In_Max : Unsigned_32 := 2 ** 10 - 1;
package Drivers.NTC is
pragma Preelaborate;
function Value (V : Positive) return Unsigned_32;
function Temperature (V : Positive) return Integer;
end Drivers.NTC;
|
x86/bootloader.asm
|
encse/bootloader
| 16 |
89142
|
;; Boot sector load address
%assign BootLoader.Begin 0x7c00
;; Sector size in bytes
%assign BootLoader.SectorSize 512
;; Words in 16 bit x86 are 2 bytes
%assign BootLoader.WordSize 2
;; Number of sectors used by main program
%assign BootLoader.MainSectorCount (Main.CodeSize / BootLoader.SectorSize - 1)
[bits 16]
[org BootLoader.Begin]
BootLoader:
xor ax, ax
mov ds, ax
mov es, ax
; set stack pointer just below bootloader
mov ss, ax
mov sp, BootLoader.Begin
; far jmp to set CS = 0
jmp 0x0000:.setCs
.setCs:
; read & start main program
; ah = 2 for reading
mov ah, 0x02
; drive head number; BIOS sets dl contains to the boot drive number
mov dh, 0x00
; cylinder of drive
mov ch, 0x00
; number of sectors to read
mov al, BootLoader.MainSectorCount
; start sector to read from
mov cl, 0x02
; es:bx: the target address
mov bx, Main.LoadAddress
int 0x13
jc .diskReadError
cmp al, BootLoader.MainSectorCount
jne .diskReadError
jmp Main.LoadAddress
.diskReadError:
mov si, BootLoader.stDiskReadError
call BootLoader.printString
call BootLoader.abort
;; Function:
;; Print a string to the terminal
;; Parameters
;; * ds:si points to zero terminated string
BootLoader.printString:
push ax
push si
; teletype output
mov ah, 0x0e
.loop:
; until [si] != 0
cmp byte [si], 0
je .ret
mov al, [si]
int 0x10
; next character
inc si
jmp .loop
.ret:
pop si
pop ax
ret
;; Function:
;; abort exection
BootLoader.abort: jmp $
BootLoader.stDiskReadError:
db `Disk read error...\r\n`, 0
%assign BootLoader.CodeSize $ - $$
; Pad to size of boot sector, minus the size of a word for the boot sector
; magic value. If the code is too big to fit in a boot sector, the `times`
; directive uses a negative value, causing a build error.
times (BootLoader.SectorSize - BootLoader.WordSize) - BootLoader.CodeSize db 0
; Add boot signature at the end of boot sector
dw 0xAA55
|
alloy4fun_models/trashltl/models/17/F8TNYSSWhYDYbb5Bz.als
|
Kaixi26/org.alloytools.alloy
| 0 |
127
|
open main
pred idF8TNYSSWhYDYbb5Bz_prop18 {
always (all f : File | f in Trash triggered f in Protected)
}
pred __repair { idF8TNYSSWhYDYbb5Bz_prop18 }
check __repair { idF8TNYSSWhYDYbb5Bz_prop18 <=> prop18o }
|
src/tests/bintoasc_suite-misc_tests.ads
|
jhumphry/Ada_BinToAsc
| 0 |
4386
|
<reponame>jhumphry/Ada_BinToAsc<filename>src/tests/bintoasc_suite-misc_tests.ads<gh_stars>0
-- BinToAsc_Suite.Misc_Tests
-- Unit tests for BinToAsc
-- Copyright (c) 2015, <NAME> - see LICENSE file for details
with AUnit; use AUnit;
with AUnit.Test_Cases; use AUnit.Test_Cases;
package BinToAsc_Suite.Misc_Tests is
type Misc_Test is new Test_Cases.Test_Case with null record;
procedure Register_Tests (T: in out Misc_Test);
function Name (T : Misc_Test) return Test_String;
procedure Set_Up (T : in out Misc_Test);
procedure Check_Valid_Alphabet (T : in out Test_Cases.Test_Case'Class);
procedure Check_Make_Reverse_Alphabet (T : in out Test_Cases.Test_Case'Class);
end BinToAsc_Suite.Misc_Tests;
|
alloy/spirv.als
|
raphlinus/Vulkan-MemoryModel
| 82 |
2209
|
<filename>alloy/spirv.als
// Copyright (c) 2017-2019 Khronos Group. This work is licensed under a
// Creative Commons Attribution 4.0 International License; see
// http://creativecommons.org/licenses/by/4.0/
// Vulkan + SPIR-V Memory Model
// Inspired by: Wickerson et al, Automatically Comparing Memory Consistency Models, POPL`17
// https://johnwickerson.github.io/papers/memalloy.pdf
// https://github.com/johnwickerson/memalloy
open util/relation
pred is_acyclic[r : E -> E] {
acyclic[r, E]
}
pred strict_partial_order[r : E -> E] {
is_acyclic[r]
transitive[r]
}
pred is_equivalence[r : E -> E, s : set E] {
equivalence[r,s]
r in s->s
}
// stor = "set to relation", (s,s) for all s in E
// lift a set to a relation (the [_] operator in Herd)
fun stor[s : set E] : E -> E {
s <: iden
}
// reduce a transitive relation to those immediately related
fun imm[r : E -> E] : E -> E{
r - (r.^r)
}
// reflexive closure (the ?-operator in Herd)
fun rc[r : E -> E] : E -> E {
r + (E <: iden)
}
// Relation-And-Inverse
fun rai[r : E -> E] : E -> E {
r + ~r
}
// An "event" (instruction)
sig E {}
// An execution
sig Exec {
EV : set E, // everything
W, R, F : set E, // write, read, fence
A, ACQ, REL: set E, // atomic, acquire, release
SC0, SC1 : set E, // storage classes 0 and 1
SEMSC0, SEMSC1, SEMSC01 : set E, // storage class semantics 0, 1, 0 and 1
SCOPESG, SCOPEWG, SCOPEQF, SCOPEDEV : set E, // subgroup/workgroup/queuefamily/device scopes
CBAR : set E, // control barrier
RFINIT : set E, // reads that read-from the initial value
AV, VIS : set E, // per-instruction availability/visibility operations
AVSHADER, VISSHADER : set E, // availability/visibility op to shader domain
AVQF, VISQF : set E, // availability/visibility op to queuefamily instance domain
AVWG, VISWG : set E, // availability/visibility op to workgroup instance domain
AVSG, VISSG : set E, // availability/visibility op to subgroup instance domain
SEMAV, SEMVIS : set E, // memory semantics for availability/visibility operations
AVDEVICE, VISDEVICE : set E, // availability/visibility op to device domain
NONPRIV, PRIV : set E, // non-private (participates in inter-thread ordering) vs private
// relations statically defined by a "program"
sthd : E->E, // same thread
immpo: E->E, // program order, only immediate neighbors
pgmsloc : E->E, // same location specified in program source (see also sloc)
ssg : E->E, // same subgroup
swg : E->E, // same workgroup
sqf : E->E, // same queuefamily
ssw : E->E, // system-synchronizes-with
scbarinst : E->E, // same control barrier dynamic instance
pgmsref : E->E, // same reference specified in program source (see also sref)
chains : E->E, // What availability/visibility chains are supported based on device state.
// chains is either EV->EV (if chains are supported) or stor[EV] (if not)
// derived static relations
po : E->E, // program order (^immpo)
posctosem : E->E, // program order & (SC->SEM)
posemtosc : E->E, // program order & (SEM->SC)
inscope : E->E, // are a,b in each other's memory scope instance
mutordatom : E->E, // mututally ordered atomics (same loc, inscope)
sloc : E->E, // same location (roughly, transitive closure of pgmsloc)
sref : E->E, // same reference (roughly, transitive closure of pgmsref + stor[R+W])
avvisinc : E->E, // relates av/vis ops with those operations they may include
// dynamic relations established at runtime
rf : E->E, // reads-from
asmo: E->E, // A's scoped modification order
rs : E->E, // release sequence
hypors : E->E, // hypothetical release sequence
fr: E->E, // from-read
sw: E->E, // synchronizes-with
ithbsemsc0 : E->E, // inter-thread-happens-before (templated by storage class mask)
ithbsemsc1 : E->E,
ithbsemsc01 : E->E,
hb: E->E, // happens-before
avsg: E->E, // chain of instructions producing subgroup availability
avwg: E->E, // chain of instructions producing workgroup availability
avqf: E->E, // chain of instructions producing queue family availability
avsh: E->E, // chain of instructions producing shader availability
avdv: E->E, // device availability
vissg: E->E, // chain of instructions producing subgroup visibility
viswg: E->E, // chain of instructions producing workgroup visibility
visqf: E->E, // chain of instructions producing queue family visibility
vissh: E->E, // chain of instructions producing shader visibility
visdv: E->E, // device visibility
locord: E->E, // location-ordered
dr: E->E, // data-race
visto: E->E, // visible-to
} {
// reads, writes, fences, barriers, and av/vis ops are the entire set of events
R+W+F+CBAR+AVDEVICE+VISDEVICE = EV
// memory accesses are disjoint from barriers
// NOTE: Some CBARs are fences
no ((R+W)&(F+CBAR))
// program order is a subset of same-thread
po in sthd
// immpo is only "immediate" program order links, to reduce noise when visualizing
// and to make it easier to specify. po is its transitive closure
po = ^immpo
// program order is a strict partial order
strict_partial_order[po]
// po relates everything in a thread
(sthd - iden) = rai[po]
// sthd is an equivalence relation
is_equivalence[sthd, EV]
// sloc is the transitive closure of all slocs specified in pgmsloc (and its
// inverse) and add the identity over R+W
sloc = ^(rai[pgmsloc]) + stor[R+W]
// sloc is an equivalence relation over R+W
is_equivalence[sloc, R+W]
// sref is the transitive closure of all srefs specified in pgmsref (and its
// inverse) and add the identity over R+W
sref = ^(rai[pgmsref]) + stor[R+W]
// Currently, all av/vis ops to device domain are assumed to include all references.
// Semav/vis ops with SEMSCi apply to all ops in SCi, except themselves (e.g. atomic
// write doesn't make itself available because the av op happens before the atomic write,
// hence the "- iden").
// AV+VIS ops (per-instruction) are avvisinc with themselves (av/vis op happens in the right order)
// and with those operations on the same reference.
// Note that this complexity exists in part because we don't split out implicit av/vis
// ops as distinct instructions.
avvisinc = (rai[((SC0+SC1)->(AVDEVICE+VISDEVICE)) +
(SC0->((SEMAV+SEMVIS)&SEMSC0)) +
(SC1->((SEMAV+SEMVIS)&SEMSC1))]) - iden +
(rai[stor[AV+VIS] . (sref & sloc)])
// same thread is a subset of same subgroup which is a subset of same workgroup
sthd in ssg
ssg in swg
swg in sqf
// same subgroup/workgroup/queuefamily are equivalence relationships
is_equivalence[ssg, EV]
is_equivalence[swg, EV]
is_equivalence[sqf, EV]
// reads-from maps writes to reads (that don't read-from init)
// at the same location.
rf in (W->(R-RFINIT)) & (sloc-iden)
// reads-from is one-to-one
rf . ~rf in iden
// reads may read from the initial value
RFINIT in R
// All reads must read from some write or from init (the size of rf and
// RFINIT must equal the size of R)
#(rf + (stor[RFINIT])) = #R
// RMW atomics in A
(R&W) in A
// Atomics are reads and writes, not fences
A in R+W
// acquire can be used on atomic reads or fences
ACQ in ((R&A)+F)
// releases can be used on atomic writes or fences
REL in ((W&A)+F)
// Fences must release or acquire
F in (ACQ+REL)
// Only writes/reads can have explicit availability/visibility ops, respectively
AV in W
VIS in R
// nonpriv is only meaningful for memory accesses
NONPRIV in R+W
// PRIV is the complement of NONPRIV
PRIV = R+W-NONPRIV
// Atomic operations are always considered non-private
A in NONPRIV
// Atomic operations implicitly have availability/visibility operations
(W&A) in AV
(R&A) in VIS
// availability/visibility semantics in REL/ACQ only, respectively
SEMAV in REL
SEMVIS in ACQ
// All coherent ops have implicit availability/visibility ops (AV, VIS).
// Barriers/atomics can also include availability/visibility ops via their semantics (SEMAV, SEMVIS).
AVSHADER = (AV+SEMAV) & SCOPEDEV
VISSHADER = (VIS+SEMVIS) & SCOPEDEV
AVQF = (AV+SEMAV) & (SCOPEDEV + SCOPEQF)
VISQF = (VIS+SEMVIS) & (SCOPEDEV + SCOPEQF)
AVWG = (AV+SEMAV) & (SCOPEDEV + SCOPEQF + SCOPEWG)
VISWG = (VIS+SEMVIS) & (SCOPEDEV + SCOPEQF + SCOPEWG)
AVSG = AV+SEMAV
VISSG = VIS+SEMVIS
// AV/VISDEVICE are not reads/writes, don't have storage classes, etc. They are
// special operation invoked outside of a shader.
no (R+W+F+CBAR+AV+VIS+RFINIT+ACQ+REL+SC0+SC1+SEMSC0+SEMSC1)&(AVDEVICE+VISDEVICE)
no AVDEVICE&VISDEVICE
// scbarinst relates pairs of control barriers
is_equivalence[scbarinst, CBAR]
// no pair of the same control barrier instance can be in the same thread
no scbarinst & rai[po]
// can't have two cbars where one comes first in po in one thread and
// second in po in another thread
no (po.scbarinst.po & scbarinst)
// the same instance of a control barrier must have same scope, acq/rel, semantics
no scbarinst & (SCOPEDEV -> (EV-SCOPEDEV))
no scbarinst & (SCOPEQF -> (EV-SCOPEQF))
no scbarinst & (SCOPEWG -> (EV-SCOPEWG))
no scbarinst & (SCOPESG -> (EV-SCOPESG))
no scbarinst & (ACQ -> (EV-ACQ))
no scbarinst & (REL -> (EV-REL))
no scbarinst & (SEMSC0 -> (EV-SEMSC0))
no scbarinst & (SEMSC1 -> (EV-SEMSC1))
// There is a unique storage class for each memory access.
SC0+SC1 = R+W
no SC0&SC1
// All acquire/release ops have one or more semantics storage classes
ACQ+REL = SEMSC0+SEMSC1
SEMSC01 = SEMSC0&SEMSC1
// All atomics and fences have a single scope
A+F+CBAR in SCOPESG+SCOPEWG+SCOPEQF+SCOPEDEV
no SCOPEQF&SCOPEDEV
no SCOPEWG&SCOPEDEV
no SCOPESG&SCOPEDEV
no SCOPEWG&SCOPEQF
no SCOPESG&SCOPEQF
no SCOPESG&SCOPEWG
// two ops are in scope with each other if they are both scope device or are
// in the "same group" and have "group or greater" scope.
inscope = (SCOPEDEV -> SCOPEDEV) +
(sqf & ((SCOPEDEV+SCOPEQF) -> (SCOPEDEV+SCOPEQF))) +
(swg & ((SCOPEDEV+SCOPEQF+SCOPEWG) -> (SCOPEDEV+SCOPEQF+SCOPEWG))) +
(ssg & ((SCOPEDEV+SCOPEQF+SCOPEWG+SCOPESG) -> (SCOPEDEV+SCOPEQF+SCOPEWG+SCOPESG)))
// mutually ordered atomics are to the same location and same reference and in scope
mutordatom = (sloc & sref & (A -> A) & inscope) - iden
posctosem = po & ((SC0 -> SEMSC0) + (SC1 -> SEMSC1))
posemtosc = po & ((SEMSC0 -> SC0) + (SEMSC1 -> SC1))
// A's scoped modification order:
// - must be a strict partial order
// - must relate all mutually ordered atomic writes at the same location
strict_partial_order[asmo]
rai[asmo] = ((A&W) -> (A&W)) & mutordatom
// Release sequence starts with an atomic release followed by the reflexive
// transitive closure of immediate asmo limited to RMWs. Leaving out C++'s
// same-thread-atomic-write aspect of release sequences. hypors is the same
// for "hypothetical release sequences" where the release happens in a fence
// earlier in the same invocation.
rs = (stor[REL&A]) . *((imm[asmo]) . (stor[R&W]))
hypors = (stor[W&A]) . *((imm[asmo]) . (stor[R&W]))
// From-read (aka reads-before) are (read,write) pairs where the read reads a
// value before the write in atomic modification order (i.e. the inverse of
// reads-from joined with asmo). For reads that read-from init, they
// from-read all writes at the same location.
fr = (~rf . asmo) + ((stor[RFINIT]) . sloc . (stor[W])) - iden
// synchronizes-with is similar to C++, with an additional case for fence->cbar->cbar->fence
sw = inscope & (
// atomic->atomic
((stor[REL&A]) . rs . (rf & mutordatom) . (stor[ACQ&A])) +
// fence->atomic
((stor[REL&F]) . posemtosc . (stor[A&W]) . hypors . (rf & mutordatom) . (stor[ACQ&A])) +
// atomic->fence
((stor[REL&A]) . rs . (rf & mutordatom) . (stor[A&R]) . posctosem . (stor[ACQ&F])) +
// fence->fence
((stor[REL&F]) . posemtosc . (stor[A&W]) . hypors . (rf & mutordatom) . (stor[A&R]) . posctosem . (stor[ACQ&F])) +
// fence->cbar->cbar->fence
// (stor[CBAR]) terms are redundant because scbarinst is an equivalence relation on scbarinst,
// but they make the sequence of instructions more clear.
((stor[REL&F]) . (rc[po]) . (stor[CBAR]) . (scbarinst & inscope - iden) . (stor[CBAR]) . (rc[po]) . (stor[ACQ&F])))
// inter-thread-happens-before =
// system-synchronizes-with
// synchronizes-with where both sides have SC in semantics
// SC||SEMSC -> programorder -> release<SEMSC>
// acquire<SEMSC> -> programorder -> SC||SEMSC
ithbsemsc0 = ^(ssw +
(stor[SEMSC0]).sw.(stor[SEMSC0]) +
(stor[SC0+SEMSC0]).po.(stor[REL&SEMSC0]) +
(stor[ACQ&SEMSC0]).po.(stor[SC0+SEMSC0]))
ithbsemsc1 = ^(ssw +
(stor[SEMSC1]).sw.(stor[SEMSC1]) +
(stor[SC1+SEMSC1]).po.(stor[REL&SEMSC1]) +
(stor[ACQ&SEMSC1]).po.(stor[SC1+SEMSC1]))
ithbsemsc01 = ^(ssw +
(stor[SEMSC01]).sw.(stor[SEMSC01]) +
(stor[SC0+SC1+SEMSC01]).po.(stor[REL&SEMSC01]) +
(stor[ACQ&SEMSC01]).po.(stor[SC0+SC1+SEMSC01]))
// happens-before = ithb<SC> or program order
hb = ithbsemsc0 + ithbsemsc1 + ithbsemsc01 + po
// Chains of instructions that produce the desired availability/visibility.
// Example: An AVWG that happens before an AVSH in the same workgroup is
// enough to make the original write available to the shader domain.
// "chains & ..." effectively "turns off" nontrivial chains when the feature
// is not supported by ANDing with the identity relation.
avsg = stor[AVSG]
avwg = (chains & (rc[avsg . (hb & ssg & avvisinc)])) . (stor[AVWG])
avqf = (chains & (rc[avsg . (hb & ssg & avvisinc)]) . (rc[avwg . (hb & swg & avvisinc)])) . (stor[AVQF])
avsh = (chains & (rc[avsg . (hb & ssg & avvisinc)]) . (rc[avwg . (hb & swg & avvisinc)]) . (rc[avqf . (hb & sqf & avvisinc)])) . (stor[AVSHADER])
avdv = stor[AVDEVICE]
vissg = stor[VISSG]
viswg = (stor[VISWG]) . (chains & (rc[(hb & ssg & avvisinc) . vissg]))
visqf = (stor[VISQF]) . (chains & (rc[(hb & swg & avvisinc) . viswg]) . (rc[(hb & ssg & avvisinc) . vissg]))
vissh = (stor[VISSHADER]) . (chains & (rc[(hb & sqf & avvisinc) . visqf]) . (rc[(hb & swg & avvisinc) . viswg]) . (rc[(hb & ssg & avvisinc) . vissg]))
visdv = stor[VISDEVICE]
locord = sloc & // relates memory accesses to the same location
((hb & sthd & sref) + // single-thread case
((stor[R-PRIV]) . hb . (stor[R+W-PRIV])) + // RaR, WaR (non-private)
((stor[R]) . ^ssw . (stor[R+W])) + // RaR, WaR (any)
(sref & ((stor[W-PRIV]) . (rc[po] & avvisinc) . avsg . (hb & ssg) . (stor[W-PRIV]))) + // WaW (via subgroup instance domain)
(sref & ((stor[W-PRIV]) . (rc[po] & avvisinc) . avsg . (hb & ssg) . vissg . (rc[po] & avvisinc) . (stor[R-PRIV]))) + // RaW (via subgroup instance domain)
(sref & ((stor[W-PRIV]) . (rc[po] & avvisinc) . avwg . (hb & swg) . (stor[W-PRIV]))) + // WaW (via workgroup instance domain)
(sref & ((stor[W-PRIV]) . (rc[po] & avvisinc) . avwg . (hb & swg) . viswg . (rc[po] & avvisinc) . (stor[R-PRIV]))) + // RaW (via workgroup instance domain)
(sref & ((stor[W-PRIV]) . (rc[po] & avvisinc) . avqf . (hb & sqf) . (stor[W-PRIV]))) + // WaW (via queue family instance domain)
(sref & ((stor[W-PRIV]) . (rc[po] & avvisinc) . avqf . (hb & sqf) . visqf . (rc[po] & avvisinc) . (stor[R-PRIV]))) + // RaW (via queue family instance domain)
(sref & ((stor[W-PRIV]) . (rc[po] & avvisinc) . avsh . (hb ) . (stor[W-PRIV]))) + // WaW (via shader domain)
(sref & ((stor[W-PRIV]) . (rc[po] & avvisinc) . avsh . (hb ) . vissh . (rc[po] & avvisinc) . (stor[R-PRIV]))) + // RaW (via shader domain)
( (stor[W]) . (hb & avvisinc) . avdv . (hb ) . (stor[W])) + // WaW (via device domain)
( (stor[W]) . (hb & avvisinc) . avdv . (hb ) . visdv . (hb & avvisinc) . (stor[R]))) // RaW (via device domain)
// data race = same location, at least one is a write, not equal,
// not mutually ordered atomics, not location ordered either direction
dr = sloc & ((W -> W) + (W -> R) + (R -> W) - mutordatom - iden - rai[locord])
// visible to = location ordered W->R with no intervening write (W->W->R)
visto = imm[(stor[W]) . locord] . (stor[R])
}
pred consistent[X:Exec] {
// consistency: locord, rf, fr, asmo must not form cycles
is_acyclic[X.locord + X.rf + X.fr + X.asmo]
// consistency: non-atomic reads must read-from a value that is still visible
X.rf . (stor[X.R-X.A]) in imm[(stor[X.W]) . (X.locord)]
}
pred racefree[X:Exec] {
no X.dr
}
pred locordcomplete[X:Exec] {
// In a race-free program, any reads and writes at the same location must
// be ordered by locord and/or mutordatom
rai[X.locord]+X.mutordatom-((X.R-X.W)->(X.R-X.W)) = X.sloc-iden-((X.R-X.W)->(X.R-X.W))
}
// Asserts that should be true for all executions:
// locord only relates operations at the same location
assert AssertLocordSameLoc { all X : Exec | X.locord in X.sloc }
// locord is acyclic
assert AssertLocordAcyclic { all X : Exec | !consistent[X] || is_acyclic[X.locord] }
// if (consistent && racefree) locordcomplete
assert AssertLocordComplete1 { all X : Exec | !(racefree[X] && consistent[X]) || locordcomplete[X] }
// if (locordcomplete && consistent) racefree
assert AssertLocordComplete2 { all X : Exec | !(locordcomplete[X] && consistent[X]) || racefree[X] }
// can't synchronize-with yourself
// (too slow to run, in practice)
assert AssertNoSwSelf { all X : Exec | !consistent[X] || no ((X.sw) & iden) }
// no (W->W->R) in visto
assert AssertVisTo { all X : Exec | no ((X.visto) & ((stor[X.W]) . (X.locord) . (stor[X.W]) . (X.locord) . (stor[X.R]))) }
|
programs/oeis/008/A008766.asm
|
jmorken/loda
| 1 |
84968
|
; A008766: Expansion of (1+x^5)/((1-x)*(1-x^2)*(1-x^3)*(1-x^4)).
; 1,1,2,3,5,7,10,13,18,23,29,36,45,54,65,77,91,106,123,141,162,184,208,234,263,293,326,361,399,439,482,527,576,627,681,738,799,862,929,999,1073,1150,1231,1315,1404,1496,1592,1692,1797,1905,2018,2135,2257,2383,2514,2649,2790,2935,3085,3240,3401,3566,3737,3913,4095,4282,4475,4673,4878,5088,5304,5526,5755,5989,6230,6477,6731,6991,7258,7531,7812,8099,8393,8694,9003,9318,9641,9971,10309,10654,11007,11367,11736,12112,12496,12888,13289,13697,14114,14539,14973,15415,15866,16325,16794,17271,17757,18252,18757,19270,19793,20325,20867,21418,21979,22549,23130,23720,24320,24930,25551,26181,26822,27473,28135,28807,29490,30183,30888,31603,32329,33066,33815,34574,35345,36127,36921,37726,38543,39371,40212,41064,41928,42804,43693,44593,45506,46431,47369,48319,49282,50257,51246,52247,53261,54288,55329,56382,57449,58529,59623,60730,61851,62985,64134,65296,66472,67662,68867,70085,71318,72565,73827,75103,76394,77699,79020,80355,81705,83070,84451,85846,87257,88683,90125,91582,93055,94543,96048,97568,99104,100656,102225,103809,105410,107027,108661,110311,111978,113661,115362,117079,118813,120564,122333,124118,125921,127741,129579,131434,133307,135197,137106,139032,140976,142938,144919,146917,148934,150969,153023,155095,157186,159295,161424,163571,165737,167922,170127,172350,174593,176855,179137,181438,183759,186099,188460,190840,193240,195660,198101,200561,203042,205543,208065,210607,213170,215753,218358,220983
mov $3,$0
add $3,1
mov $7,$0
lpb $3
mov $0,$7
sub $3,1
sub $0,$3
add $0,2
lpb $0
pow $0,2
mul $6,$0
mov $2,$6
div $2,4
add $2,2
mov $4,10
add $4,$2
sub $6,$0
mov $0,1
sub $6,$2
div $6,2
add $6,2
sub $4,$6
lpe
sub $6,$6
add $6,3
div $4,$6
mov $5,$4
sub $5,3
add $1,$5
lpe
|
alloy4fun_models/trashltl/models/13/RkNcvzWa43vtQz688.als
|
Kaixi26/org.alloytools.alloy
| 0 |
5185
|
open main
pred idRkNcvzWa43vtQz688_prop14 {
no Protected' & Trash
}
pred __repair { idRkNcvzWa43vtQz688_prop14 }
check __repair { idRkNcvzWa43vtQz688_prop14 <=> prop14o }
|
oeis/343/A343260.asm
|
neoneye/loda-programs
| 11 |
162162
|
; A343260: a(n) = 2 * T(n,(n+1)/2) where T(n,x) is a Chebyshev polynomial of the first kind.
; Submitted by <NAME>
; 2,2,7,52,527,6726,103682,1874888,38925119,912670090,23855111399,687808321212,21687295069442,742397047217294,27420344506901023,1086932029484351248,46027034321342899967,2073668380220713167378,99042070146811639444802,4998769811911302229479620,265841431808295737112668399,14858476209024650314042180822,870762196420087938911001288527,53391436278370588375877994494424,3418559416093920655237913756160002,228158554376401972325397631079625626,15846620556854123471885117471660657527
mov $3,$0
sub $3,1
mov $4,1
lpb $0
sub $0,1
add $1,1
add $2,$3
mul $2,$1
add $4,$2
add $1,$4
mov $2,0
lpe
mov $0,$4
add $0,1
|
lib/types/FundamentalGroupoid.agda
|
UlrikBuchholtz/HoTT-Agda
| 1 |
15189
|
{-# OPTIONS --without-K #-}
open import lib.Basics
open import lib.types.Truncation
open import lib.types.Groupoid
open import lib.types.PathSet
module lib.types.FundamentalGroupoid {i} (A : Type i) where
fundamental-groupoid : Groupoid
fundamental-groupoid = record
{ El = A
; Arr = _=₀_ {A = A}
; Arr-level = λ _ _ → Trunc-level
; groupoid-struct = record
{ id = idp₀
; inv = !₀
; comp = _∙₀_
; unit-l = ∙₀-unit-l
; unit-r = ∙₀-unit-r
; assoc = ∙₀-assoc
; inv-l = !₀-inv-l
; inv-r = !₀-inv-r
}
}
|
oeis/185/A185010.asm
|
neoneye/loda-programs
| 11 |
14609
|
; A185010: a(n) = A000108(n)*A015518(n+1), where A000108 are the Catalan numbers and A015518(n) = 2*A015518(n-1) + 3*A015518(n-2).
; Submitted by <NAME>
; 1,2,14,100,854,7644,72204,703560,7037030,71772844,743844452,7810307960,82909630972,888316731800,9593823377880,104332819539600,1141523825614470,12556761952114380,138785264158902900,1540516430396559000,17165754516697206420,191944345934966132040,2153114837101102653480,24222541917044345238000,273230272825550118431964,3089603854253281700483064,35015510348222226625213544,397676153240454325978294960,4525280364460606078049589560,51588196154849907047548669616,589103917381193076110122384048
mov $2,$0
add $0,1
seq $0,15518 ; a(n) = 2*a(n-1) + 3*a(n-2), with a(0)=0, a(1)=1.
seq $2,108 ; Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!).
mul $0,$2
|
Ouroboros/External/libjpegTurbo/simd/jcgrass2-64.asm
|
jiangzhu1212/oooii
| 0 |
166297
|
<gh_stars>0
;
; jcgrass2-64.asm - grayscale colorspace conversion (64-bit SSE2)
;
; x86 SIMD extension for IJG JPEG library
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; Copyright (C) 2011, <NAME>.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
;
; [TAB8]
%include "jsimdext.inc"
; --------------------------------------------------------------------------
%define SCALEBITS 16
F_0_114 equ 7471 ; FIX(0.11400)
F_0_250 equ 16384 ; FIX(0.25000)
F_0_299 equ 19595 ; FIX(0.29900)
F_0_587 equ 38470 ; FIX(0.58700)
F_0_337 equ (F_0_587 - F_0_250) ; FIX(0.58700) - FIX(0.25000)
; --------------------------------------------------------------------------
SECTION SEG_CONST
alignz 16
global EXTN(jconst_rgb_gray_convert_sse2)
EXTN(jconst_rgb_gray_convert_sse2):
PW_F0299_F0337 times 4 dw F_0_299, F_0_337
PW_F0114_F0250 times 4 dw F_0_114, F_0_250
PD_ONEHALF times 4 dd (1 << (SCALEBITS-1))
alignz 16
; --------------------------------------------------------------------------
SECTION SEG_TEXT
BITS 64
%include "jcgryss2-64.asm"
%undef RGB_RED
%undef RGB_GREEN
%undef RGB_BLUE
%undef RGB_PIXELSIZE
%define RGB_RED EXT_RGB_RED
%define RGB_GREEN EXT_RGB_GREEN
%define RGB_BLUE EXT_RGB_BLUE
%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
%define jsimd_rgb_gray_convert_sse2 jsimd_extrgb_gray_convert_sse2
%include "jcgryss2-64.asm"
%undef RGB_RED
%undef RGB_GREEN
%undef RGB_BLUE
%undef RGB_PIXELSIZE
%define RGB_RED EXT_RGBX_RED
%define RGB_GREEN EXT_RGBX_GREEN
%define RGB_BLUE EXT_RGBX_BLUE
%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
%define jsimd_rgb_gray_convert_sse2 jsimd_extrgbx_gray_convert_sse2
%include "jcgryss2-64.asm"
%undef RGB_RED
%undef RGB_GREEN
%undef RGB_BLUE
%undef RGB_PIXELSIZE
%define RGB_RED EXT_BGR_RED
%define RGB_GREEN EXT_BGR_GREEN
%define RGB_BLUE EXT_BGR_BLUE
%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
%define jsimd_rgb_gray_convert_sse2 jsimd_extbgr_gray_convert_sse2
%include "jcgryss2-64.asm"
%undef RGB_RED
%undef RGB_GREEN
%undef RGB_BLUE
%undef RGB_PIXELSIZE
%define RGB_RED EXT_BGRX_RED
%define RGB_GREEN EXT_BGRX_GREEN
%define RGB_BLUE EXT_BGRX_BLUE
%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
%define jsimd_rgb_gray_convert_sse2 jsimd_extbgrx_gray_convert_sse2
%include "jcgryss2-64.asm"
%undef RGB_RED
%undef RGB_GREEN
%undef RGB_BLUE
%undef RGB_PIXELSIZE
%define RGB_RED EXT_XBGR_RED
%define RGB_GREEN EXT_XBGR_GREEN
%define RGB_BLUE EXT_XBGR_BLUE
%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
%define jsimd_rgb_gray_convert_sse2 jsimd_extxbgr_gray_convert_sse2
%include "jcgryss2-64.asm"
%undef RGB_RED
%undef RGB_GREEN
%undef RGB_BLUE
%undef RGB_PIXELSIZE
%define RGB_RED EXT_XRGB_RED
%define RGB_GREEN EXT_XRGB_GREEN
%define RGB_BLUE EXT_XRGB_BLUE
%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
%define jsimd_rgb_gray_convert_sse2 jsimd_extxrgb_gray_convert_sse2
%include "jcgryss2-64.asm"
|
programs/oeis/262/A262855.asm
|
neoneye/loda
| 22 |
22114
|
<reponame>neoneye/loda
; A262855: Triangle read by rows giving successive states of cellular automaton generated by "Rule 153" initiated with a single ON (black) cell.
; 1,0,0,1,0,1,0,1,1,0,0,0,0,1,1,1,0,1,1,1,0,1,1,1,1,0,0,1,1,0,0,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1
max $1,$0
min $0,1
seq $1,75439 ; Triangle read by rows giving successive iterations of the Rule 102 elementary cellular automaton starting with a single ON cell where row n is of length 2n+1.
sub $1,$0
add $1,2
mod $1,2
mov $0,$1
|
test-resources/CombinedTypesAndVariables.Main.adb
|
hergin/ada2fuml
| 0 |
1312
|
with SomeClass;
procedure Main is
begin
null;
end Main;
|
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca_notsx.log_21829_1971.asm
|
ljhsiun2/medusa
| 9 |
8340
|
<reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r8
push %rbx
push %rdx
lea addresses_normal_ht+0x15435, %rbx
nop
and $57155, %rdx
movw $0x6162, (%rbx)
nop
nop
nop
nop
nop
add %r13, %r13
pop %rdx
pop %rbx
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r15
push %r9
push %rax
push %rdi
// Faulty Load
mov $0x37fc770000000c35, %r13
nop
nop
nop
nop
nop
sub $24877, %r12
movb (%r13), %r11b
lea oracles, %r15
and $0xff, %r11
shlq $12, %r11
mov (%r15,%r11,1), %r11
pop %rdi
pop %rax
pop %r9
pop %r15
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
test/Fail/Issue2044.agda
|
cruhland/agda
| 1,989 |
9315
|
postulate
T C D : Set
instance I : {{_ : C}} → D
d : {{_ : D}} → T
t : T
t = d
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_669.asm
|
ljhsiun2/medusa
| 9 |
169821
|
<filename>Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_669.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r15
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x10956, %rdi
nop
sub %rsi, %rsi
mov $0x6162636465666768, %rdx
movq %rdx, (%rdi)
sub $3257, %r15
lea addresses_D_ht+0x1bd56, %r15
add %rcx, %rcx
mov $0x6162636465666768, %r11
movq %r11, %xmm1
movups %xmm1, (%r15)
nop
nop
nop
sub %rdx, %rdx
lea addresses_WC_ht+0x2d76, %r15
nop
nop
nop
nop
nop
and $61724, %rcx
and $0xffffffffffffffc0, %r15
vmovaps (%r15), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $1, %xmm2, %rsi
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_D_ht+0xd1a6, %r11
nop
dec %rbp
vmovups (%r11), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %rdi
nop
nop
nop
add %rsi, %rsi
lea addresses_WT_ht+0x16a26, %rsi
lea addresses_WC_ht+0x1cdde, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
nop
add $55445, %r11
mov $19, %rcx
rep movsq
nop
nop
nop
nop
xor %r15, %r15
lea addresses_D_ht+0x15e8e, %rsi
lea addresses_WT_ht+0x162a6, %rdi
clflush (%rdi)
nop
xor %r14, %r14
mov $90, %rcx
rep movsl
sub $44572, %rdi
lea addresses_WT_ht+0x11076, %rbp
nop
nop
nop
nop
nop
add $53004, %r14
mov $0x6162636465666768, %rdx
movq %rdx, (%rbp)
nop
nop
nop
nop
nop
inc %r11
lea addresses_A_ht+0x1b56, %r11
nop
nop
nop
nop
nop
sub $3573, %rcx
mov $0x6162636465666768, %r15
movq %r15, %xmm7
and $0xffffffffffffffc0, %r11
vmovaps %ymm7, (%r11)
nop
nop
sub $40539, %rcx
lea addresses_UC_ht+0x156, %r14
nop
nop
sub $10107, %r15
movw $0x6162, (%r14)
nop
nop
xor %rdi, %rdi
lea addresses_normal_ht+0x2d56, %rsi
lea addresses_UC_ht+0xf56, %rdi
nop
sub %r15, %r15
mov $105, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %rax
push %rbp
push %rdi
push %rsi
// Store
lea addresses_RW+0x4656, %r14
clflush (%r14)
nop
nop
nop
cmp $28840, %rbp
mov $0x5152535455565758, %rax
movq %rax, (%r14)
nop
nop
nop
nop
nop
dec %rax
// Load
lea addresses_WT+0x15556, %rdi
nop
nop
add %rax, %rax
mov (%rdi), %si
nop
sub %r10, %r10
// Store
lea addresses_UC+0x7036, %r14
nop
nop
cmp $23425, %r11
movl $0x51525354, (%r14)
nop
nop
nop
nop
xor %r14, %r14
// Store
lea addresses_A+0x1904a, %rbp
nop
nop
add %rax, %rax
mov $0x5152535455565758, %r10
movq %r10, %xmm1
vmovups %ymm1, (%rbp)
nop
nop
add $55958, %rbp
// Faulty Load
lea addresses_WT+0x15556, %r11
clflush (%r11)
nop
nop
nop
nop
and %r14, %r14
mov (%r11), %di
lea oracles, %r11
and $0xff, %rdi
shlq $12, %rdi
mov (%r11,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rbp
pop %rax
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_RW', 'same': False, 'AVXalign': True, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 2}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 8, 'NT': True, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': True, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_D_ht', 'same': True, 'AVXalign': False, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 2}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': True, 'AVXalign': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': True, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': True, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': True, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 8}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
src/stars/tests/instructions.asm
|
kevintmcdonnell/stars
| 4 |
245263
|
.data
ascii: .ascii "hello"
asciiz: .asciiz "hello"
bytes: .byte 1 2 0xff 0x3ff 'a'
.align 3
double: .double 420.10
float: .float 18.0
.align 1
half: .half 0xffff 1 3
space: .space 8
.align 2
word: .word 1 2 3 4
.text
main:
target:
label:
abs $t1,$t2 # a comment
abs.d $f2,$f4
abs.s $f0,$f1
add $t1,$t2,$t3
add.d $f2,$f4,$f6
add.s $f0,$f1,$f3
random_label: addi $t1,$t2,-100
addi $t1,$t2,100000
addiu $t1,$t2,-100
addiu $t1,$t2,100000
addu $t1,$t2,$t3
and $t1,$t2,$t3
andi $t1,$t2,100
andi $t1,$t2,100000
b label
bc1f 1,label
bc1f label
bc1t 1,label
bc1t label
beq $t1,$t2,label
beqz $t1,label
bge $t1,$t2,label
bgeu $t1,$t2,label
bgez $t1,label
bgezal $t1,label
bgt $t1,$t2,label
bgtu $t1,$t2,label
bgtz $t1,label
ble $t1,$t2,label
bleu $t1,$t2,label
blez $t1,label
blt $t1,$t2,label
bltu $t1,$t2,label
bltz $t1,label
bltzal $t1,label
bne $t1,$t2,label
bnez $t1,label
break
c.eq.d $f2,$f4
c.eq.d 1,$f2,$f4
c.eq.s $f0,$f1
c.eq.s 1,$f0,$f1
c.le.d $f2,$f4
c.le.d 1,$f2,$f4
c.le.s $f0,$f1
c.le.s 1,$f0,$f1
c.lt.d $f2,$f4
c.lt.d 1,$f2,$f4
c.lt.s $f0,$f1
c.lt.s 1,$f0,$f1
ceil.w.d $f1,$f2
ceil.w.s $f0,$f1
clo $t1,$t2
clz $t1,$t2
cvt.d.s $f2,$f1
cvt.d.w $f2,$f1
cvt.s.d $f1,$f2
cvt.s.w $f0,$f1
cvt.w.d $f1,$f2
cvt.w.s $f0,$f1
div $t1,$t2
div.d $f2,$f4,$f6
div.s $f0,$f1,$f3
divu $t1,$t2
floor.w.d $f1,$f2
floor.w.s $f0,$f1
j target
jal target
jalr $t1
jalr $t1,$t2
jr $t1
l.d $f2,($t2)
l.d $f2,100000($t2)
l.s $f1,($t2)
l.s $f1,100000($t2)
la $t1,label
lb $t1,($t2)
lbu $t1,($t2)
lh $t1,($t2)
lhu $t1,($t2)
li $t1,-100
lui $t1,100
lw $t1,($t2)
lwl $t1,($t2)
lwr $t1,($t2)
madd $t1,$t2
maddu $t1,$t2
mfc1 $t1,$f1
mfhi $t1
mflo $t1
mov.d $f2,$f4
mov.s $f0,$f1
move $t1,$t2
movf $t1,$t2
movf $t1,$t2,1
movf.d $f2,$f4
movf.d $f2,$f4,1
movf.s $f0,$f1
movf.s $f0,$f1,1
movn $t1,$t2,$t3
movn.d $f2,$f4,$t3
movn.s $f0,$f1,$t3
movt $t1,$t2
movt $t1,$t2,1
movt.d $f2,$f4
movt.d $f2,$f4,1
movt.s $f0,$f1
movt.s $f0,$f1,1
movz $t1,$t2,$t3
movz.d $f2,$f4,$t3
movz.s $f0,$f1,$t3
msub $t1,$t2
msubu $t1,$t2
mtc1 $t1,$f1
mthi $t1
mtlo $t1
mul $t1,$t2,$t3
mul.d $f2,$f4,$f6
mul.s $f0,$f1,$f3
mult $t1, $t2
multu $t1, $t2
neg $t1,$t2
neg.d $f2,$f4
neg.s $f0,$f1
nop
nor $t1,$t2,$t3
not $t1,$t2
or $t1,$t2,$t3
ori $t1,$t2,100
ori $t1,$t2,100000
rol $t1,$t2,10
ror $t1,$t2,10
round.w.d $f1,$f2
round.w.s $f0,$f1
s.d $f2,($t2)
s.d $f2,100000($t2)
s.s $f1,($t2)
s.s $f1,100000($t2)
sb $t1,($t2)
seq $t1,$t2,$t3
sge $t1,$t2,$t3
sgeu $t1,$t2,$t3
sgt $t1,$t2,$t3
sgtu $t1,$t2,$t3
sh $t1,($t2)
sle $t1,$t2,$t3
sleu $t1,$t2,$t3
sll $t1,$t2,10
sllv $t1,$t2,$t3
slt $t1,$t2,$t3
slti $t1,$t2,-100
sltiu $t1,$t2,-100
sltu $t1,$t2,$t3
sne $t1,$t2,$t3
sqrt.d $f2,$f4
sqrt.s $f0,$f1
sra $t1,$t2,10
srav $t1,$t2,$t3
srl $t1,$t2,10
srlv $t1,$t2,$t3
sub $t1,$t2,$t3
sub.d $f2,$f4,$f6
sub.s $f0,$f1,$f3
subu $t1,$t2,$t3
sw $t1,($t2)
swl $t1,($t2)
swr $t1,($t2)
syscall
trunc.w.d $f1,$f2
trunc.w.s $f0,$f1
xor $t1,$t2,$t3
xori $t1,$t2,100
xori $t1,$t2,100000
|
programs/oeis/157/A157739.asm
|
karttu/loda
| 1 |
163037
|
; A157739: a(n) = 388962*n^2 - 1764*n + 1.
; 387199,1552321,3495367,6216337,9715231,13992049,19046791,24879457,31490047,38878561,47044999,55989361,65711647,76211857,87489991,99546049,112380031,125991937,140381767,155549521,171495199,188218801,205720327,223999777,243057151,262892449,283505671,304896817,327065887,350012881,373737799,398240641,423521407,449580097,476416711,504031249,532423711,561594097,591542407,622268641,653772799,686054881,719114887,752952817,787568671,822962449,859134151,896083777,933811327,972316801,1011600199,1051661521,1092500767,1134117937,1176513031,1219686049,1263636991,1308365857,1353872647,1400157361,1447219999,1495060561,1543679047,1593075457,1643249791,1694202049,1745932231,1798440337,1851726367,1905790321,1960632199,2016252001,2072649727,2129825377,2187778951,2246510449,2306019871,2366307217,2427372487,2489215681,2551836799,2615235841,2679412807,2744367697,2810100511,2876611249,2943899911,3011966497,3080811007,3150433441,3220833799,3292012081,3363968287,3436702417,3510214471,3584504449,3659572351,3735418177,3812041927,3889443601,3967623199,4046580721,4126316167,4206829537,4288120831,4370190049,4453037191,4536662257,4621065247,4706246161,4792204999,4878941761,4966456447,5054749057,5143819591,5233668049,5324294431,5415698737,5507880967,5600841121,5694579199,5789095201,5884389127,5980460977,6077310751,6174938449,6273344071,6372527617,6472489087,6573228481,6674745799,6777041041,6880114207,6983965297,7088594311,7194001249,7300186111,7407148897,7514889607,7623408241,7732704799,7842779281,7953631687,8065262017,8177670271,8290856449,8404820551,8519562577,8635082527,8751380401,8868456199,8986309921,9104941567,9224351137,9344538631,9465504049,9587247391,9709768657,9833067847,9957144961,10081999999,10207632961,10334043847,10461232657,10589199391,10717944049,10847466631,10977767137,11108845567,11240701921,11373336199,11506748401,11640938527,11775906577,11911652551,12048176449,12185478271,12323558017,12462415687,12602051281,12742464799,12883656241,13025625607,13168372897,13311898111,13456201249,13601282311,13747141297,13893778207,14041193041,14189385799,14338356481,14488105087,14638631617,14789936071,14942018449,15094878751,15248516977,15402933127,15558127201,15714099199,15870849121,16028376967,16186682737,16345766431,16505628049,16666267591,16827685057,16989880447,17152853761,17316604999,17481134161,17646441247,17812526257,17979389191,18147030049,18315448831,18484645537,18654620167,18825372721,18996903199,19169211601,19342297927,19516162177,19690804351,19866224449,20042422471,20219398417,20397152287,20575684081,20754993799,20935081441,21115947007,21297590497,21480011911,21663211249,21847188511,22031943697,22217476807,22403787841,22590876799,22778743681,22967388487,23156811217,23347011871,23537990449,23729746951,23922281377,24115593727,24309684001
add $0,1
mov $1,$0
add $1,$0
mul $0,21
pow $0,2
add $1,23
mov $2,6
add $2,$1
sub $0,$2
mov $1,$0
sub $1,410
mul $1,882
add $1,387199
|
source/lli_release.asm
|
mateuszstompor/Linked-List-x86-64-ASM
| 5 |
245119
|
<reponame>mateuszstompor/Linked-List-x86-64-ASM
;
; Created by <NAME> on 21/06/2019.
;
%include "source/sizes.asm"
%include "source/iterator.asm"
%include "source/memory_management.asm"
global LLI_RELEASE
section .text
LLI_RELEASE:
; address sits in rdi register
sub rsp, 8
mov rsi, LL_ITERATOR_SIZE
call ll_mem_release
add rsp, 8
ret
|
src/cupcake-colors.ads
|
skordal/cupcake
| 2 |
30733
|
-- The Cupcake GUI Toolkit
-- (c) <NAME> 2012 <<EMAIL>>
-- Report bugs and issues on <http://github.com/skordal/cupcake/issues>
-- vim:ts=3:sw=3:et:si:sta
package Cupcake.Colors is
-- Color component type:
subtype Color_Component_Type is Float range 0.0 .. 1.0;
-- Color type:
type Color is record
R, G, B : Color_Component_Type;
end record;
-- Multiplies all color components of a Color with a constant:
function "*" (Left : in Color; Right : in Float) return Color;
function "*" (Left : in Float; Right : in Color) return Color with Inline;
-- Predefined color constants:
BLACK : constant Color := (0.0, 0.0, 0.0);
WHITE : constant Color := (1.0, 1.0, 1.0);
RED : constant Color := (1.0, 0.0, 0.0);
GREEN : constant Color := (0.0, 1.0, 0.0);
BLUE : constant Color := (0.0, 0.0, 1.0);
DEFAULT_BACKGROUND_COLOR : constant Color := (0.85, 0.85, 0.85);
DEFAULT_FOREGROUND_COLOR : constant Color := BLACK;
end Cupcake.Colors;
|
programs/oeis/257/A257063.asm
|
neoneye/loda
| 22 |
243173
|
<reponame>neoneye/loda<gh_stars>10-100
; A257063: Number of length 1 1..(n+1) arrays with every leading partial sum divisible by 2 or 3.
; 1,2,3,3,4,4,5,6,7,7,8,8,9,10,11,11,12,12,13,14,15,15,16,16,17,18,19,19,20,20,21,22,23,23,24,24,25,26,27,27,28,28,29,30,31,31,32,32,33,34,35,35,36,36,37,38,39,39,40,40,41,42,43,43,44,44,45,46,47,47,48,48,49,50,51,51,52,52,53,54,55,55,56,56,57,58,59,59,60,60,61,62,63,63,64,64,65,66,67,67
add $0,4
mov $1,2
add $1,$0
gcd $0,2
mul $1,2
add $1,$0
div $1,3
sub $1,3
mov $0,$1
|
programs/oeis/309/A309097.asm
|
karttu/loda
| 0 |
12952
|
<filename>programs/oeis/309/A309097.asm
; A309097: Number of partitions of n avoiding the partition (4,2,1).
; 1,1,2,3,5,7,11,14,20,25,32,39,49,56,68,79,91,103,119,132,150,165,183,202,224,241,264,287,311,334,362,385,415,442,472,503,535,563,599,634,670,703,743,778,820,859,899,942,988,1027,1074,1119,1167,1214,1266
mov $27,$0
mov $29,$0
add $29,1
lpb $29,1
clr $0,27
mov $0,$27
sub $29,1
sub $0,$29
add $4,$0
trn $0,2
add $4,1
cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
mul $0,2
mov $1,$0
mul $4,$0
add $3,$4
div $0,$3
mul $0,$3
mul $0,2
mov $2,$4
add $2,$0
div $2,$1
mul $2,2
sub $2,$1
mov $1,$2
sub $1,2
div $1,2
add $28,$1
lpe
mov $1,$28
|
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca.log_11_1125.asm
|
ljhsiun2/medusa
| 9 |
6178
|
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r8
push %rax
push %rbp
push %rbx
// Store
lea addresses_normal+0x1a645, %rax
nop
add $50763, %r11
movw $0x5152, (%rax)
nop
nop
and %r11, %r11
// Store
lea addresses_RW+0x9d35, %r8
nop
nop
nop
nop
dec %r12
movb $0x51, (%r8)
nop
and $48696, %rax
// Load
lea addresses_D+0x98f9, %rax
nop
nop
xor $37856, %r15
mov (%rax), %r8w
and %rbp, %rbp
// Store
lea addresses_UC+0x1c521, %rax
xor $22623, %rbp
mov $0x5152535455565758, %rbx
movq %rbx, %xmm1
vmovups %ymm1, (%rax)
nop
nop
nop
nop
inc %r12
// Load
mov $0x8a4fd0000000321, %r11
add %r12, %r12
mov (%r11), %ax
nop
nop
sub $10029, %r12
// Store
lea addresses_PSE+0x19d21, %r11
clflush (%r11)
nop
nop
nop
cmp $40052, %rbx
mov $0x5152535455565758, %r8
movq %r8, %xmm0
vmovups %ymm0, (%r11)
nop
nop
nop
nop
nop
add $14014, %rax
// Load
lea addresses_UC+0x1c521, %rbp
nop
nop
nop
nop
add %r11, %r11
vmovups (%rbp), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %r8
nop
nop
and $10683, %r12
// Faulty Load
lea addresses_UC+0x1c521, %rbx
and $23554, %r12
mov (%rbx), %rax
lea oracles, %r15
and $0xff, %rax
shlq $12, %rax
mov (%r15,%rax,1), %rax
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_RW', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'58': 11}
58 58 58 58 58 58 58 58 58 58 58
*/
|
Working Disassembly/General/Sprites/Tails/Tails tails pattern load cues.asm
|
TeamASM-Blur/Sonic-3-Blue-Balls-Edition
| 5 |
174766
|
PLC_344D74: dc.w Frame_344DCE-PLC_344D74 ; ...
dc.w Frame_344DD0-PLC_344D74
dc.w Frame_344DD4-PLC_344D74
dc.w Frame_344DD8-PLC_344D74
dc.w Frame_344DDC-PLC_344D74
dc.w Frame_344DE0-PLC_344D74
dc.w Frame_344DE4-PLC_344D74
dc.w Frame_344DE8-PLC_344D74
dc.w Frame_344DEC-PLC_344D74
dc.w Frame_344DF0-PLC_344D74
dc.w Frame_344DF4-PLC_344D74
dc.w Frame_344DF8-PLC_344D74
dc.w Frame_344DFC-PLC_344D74
dc.w Frame_344E00-PLC_344D74
dc.w Frame_344E04-PLC_344D74
dc.w Frame_344E08-PLC_344D74
dc.w Frame_344E0C-PLC_344D74
dc.w Frame_344E10-PLC_344D74
dc.w Frame_344E14-PLC_344D74
dc.w Frame_344E18-PLC_344D74
dc.w Frame_344E1C-PLC_344D74
dc.w Frame_344E20-PLC_344D74
dc.w Frame_344E24-PLC_344D74
dc.w Frame_344E28-PLC_344D74
dc.w Frame_344E2C-PLC_344D74
dc.w Frame_344E30-PLC_344D74
dc.w Frame_344E34-PLC_344D74
dc.w Frame_344E38-PLC_344D74
dc.w Frame_344E3C-PLC_344D74
dc.w Frame_344E40-PLC_344D74
dc.w Frame_344E44-PLC_344D74
dc.w Frame_344E48-PLC_344D74
dc.w Frame_344E4C-PLC_344D74
dc.w Frame_344E50-PLC_344D74
dc.w Frame_344E54-PLC_344D74
dc.w Frame_344E58-PLC_344D74
dc.w Frame_344E5C-PLC_344D74
dc.w Frame_344E60-PLC_344D74
dc.w Frame_344E64-PLC_344D74
dc.w Frame_344E68-PLC_344D74
dc.w Frame_344E6C-PLC_344D74
dc.w Frame_344E70-PLC_344D74
dc.w Frame_344E74-PLC_344D74
dc.w Frame_344E78-PLC_344D74
dc.w Frame_344E7C-PLC_344D74
Frame_344DCE: dc.w 0
Frame_344DD0: dc.w 1
dc.w $5000
Frame_344DD4: dc.w 1
dc.w $5006
Frame_344DD8: dc.w 1
dc.w $500C
Frame_344DDC: dc.w 1
dc.w $5012
Frame_344DE0: dc.w 1
dc.w $5000
Frame_344DE4: dc.w 1
dc.w $5006
Frame_344DE8: dc.w 1
dc.w $500C
Frame_344DEC: dc.w 1
dc.w $5012
Frame_344DF0: dc.w 1
dc.w $5030
Frame_344DF4: dc.w 1
dc.w $5036
Frame_344DF8: dc.w 1
dc.w $503C
Frame_344DFC: dc.w 1
dc.w $5042
Frame_344E00: dc.w 1
dc.w $5018
Frame_344E04: dc.w 1
dc.w $501E
Frame_344E08: dc.w 1
dc.w $5024
Frame_344E0C: dc.w 1
dc.w $502A
Frame_344E10: dc.w 1
dc.w $5048
Frame_344E14: dc.w 1
dc.w $504E
Frame_344E18: dc.w 1
dc.w $5054
Frame_344E1C: dc.w 1
dc.w $505A
Frame_344E20: dc.w 1
dc.w $5060
Frame_344E24: dc.w 1
dc.w $8066
Frame_344E28: dc.w 1
dc.w $806F
Frame_344E2C: dc.w 1
dc.w $5078
Frame_344E30: dc.w 1
dc.w $807E
Frame_344E34: dc.w 1
dc.w $5000
Frame_344E38: dc.w 1
dc.w $5006
Frame_344E3C: dc.w 1
dc.w $500C
Frame_344E40: dc.w 1
dc.w $5012
Frame_344E44: dc.w 1
dc.w $5000
Frame_344E48: dc.w 1
dc.w $5006
Frame_344E4C: dc.w 1
dc.w $500C
Frame_344E50: dc.w 1
dc.w $5012
Frame_344E54: dc.w 1
dc.w $5060
Frame_344E58: dc.w 1
dc.w $8066
Frame_344E5C: dc.w 1
dc.w $806F
Frame_344E60: dc.w 1
dc.w $5078
Frame_344E64: dc.w 1
dc.w $807E
Frame_344E68: dc.w 1
dc.w $3087
Frame_344E6C: dc.w 1
dc.w $3087
Frame_344E70: dc.w 1
dc.w $5000
Frame_344E74: dc.w 1
dc.w $5006
Frame_344E78: dc.w 1
dc.w $500C
Frame_344E7C: dc.w 1
dc.w $5012
|
oeis/270/A270715.asm
|
neoneye/loda-programs
| 11 |
243657
|
<gh_stars>10-100
; A270715: a(n) = ((n+2)/2)*Sum_{k=0..n/2}(Sum_{i=0..n-2*k}(binomial(k+1,n-2*k-i)*binomial(k+i,k))/(k+1).
; Submitted by <NAME>
; 1,3,5,10,19,35,65,120,221,407,749,1378,2535,4663,8577,15776,29017,53371,98165,180554,332091,610811,1123457,2066360,3800629,6990447,12857437,23648514,43496399,80002351,147147265
mov $1,1
mov $2,1
lpb $0
sub $0,1
mov $4,$2
mov $2,$3
add $2,$1
mov $3,$1
add $1,1
add $1,$4
lpe
mov $0,$1
|
testcases/driver_connections/pgsql/connect.ads
|
jrmarino/AdaBase
| 30 |
27816
|
-- Used for all testcases for MySQL driver
with AdaBase.Driver.Base.PostgreSQL;
with AdaBase.Statement.Base.PostgreSQL;
package Connect is
-- All specific drivers renamed to "Database_Driver"
subtype Database_Driver is AdaBase.Driver.Base.PostgreSQL.PostgreSQL_Driver;
subtype Stmt_Type is AdaBase.Statement.Base.PostgreSQL.PostgreSQL_statement;
subtype Stmt_Type_access is
AdaBase.Statement.Base.PostgreSQL.PostgreSQL_statement_access;
DR : Database_Driver;
procedure connect_database;
end Connect;
|
programs/oeis/088/A088955.asm
|
neoneye/loda
| 22 |
13062
|
<filename>programs/oeis/088/A088955.asm
; A088955: Primes of the form 60*n + 1.
; 61,181,241,421,541,601,661,1021,1201,1321,1381,1621,1741,1801,1861,2161,2221,2281,2341,2521,3001,3061,3121,3181,3301,3361,3541,4021,4201,4261,4441,4561,4621,4801,4861,5101,5281,5521,5581,5641,5701,5821,5881
mov $2,$0
pow $2,2
add $2,3
lpb $2
sub $2,1
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,60
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
sub $1,59
mov $0,$1
|
Typinator/typinator/Includes/Scripts/IP.applescript
|
mbroski/config
| 2 |
2244
|
<filename>Typinator/typinator/Includes/Scripts/IP.applescript<gh_stars>1-10
-- Version 1.0, (C) E<NAME>, 2012-01-19
-- Feel free to modify the script for your own use, but leave the copyright notice intact.
return IPv4 address of (system info)
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_3080.asm
|
ljhsiun2/medusa
| 9 |
176813
|
<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r15
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x193e6, %rsi
lea addresses_normal_ht+0xf4c6, %rdi
nop
nop
nop
add %r9, %r9
mov $69, %rcx
rep movsw
nop
nop
sub %r12, %r12
lea addresses_WT_ht+0x1a2b6, %r15
nop
nop
cmp %rcx, %rcx
mov $0x6162636465666768, %r9
movq %r9, %xmm7
and $0xffffffffffffffc0, %r15
movntdq %xmm7, (%r15)
nop
nop
nop
nop
nop
inc %r12
lea addresses_D_ht+0x32de, %rsi
lea addresses_D_ht+0x1726c, %rdi
nop
and $40194, %r11
mov $78, %rcx
rep movsq
nop
nop
nop
inc %r9
lea addresses_A_ht+0xbd7c, %rcx
mfence
vmovups (%rcx), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rdi
nop
nop
nop
xor %r15, %r15
lea addresses_D_ht+0x111e6, %rsi
lea addresses_A_ht+0x1d1e6, %rdi
nop
nop
nop
nop
nop
inc %rbx
mov $125, %rcx
rep movsq
nop
xor %r11, %r11
lea addresses_WT_ht+0x186d3, %r12
nop
sub $2690, %rcx
movl $0x61626364, (%r12)
nop
nop
nop
nop
nop
xor %rcx, %rcx
lea addresses_normal_ht+0xc052, %rsi
lea addresses_normal_ht+0x1d98, %rdi
nop
mfence
mov $3, %rcx
rep movsb
nop
nop
nop
nop
add %r12, %r12
lea addresses_normal_ht+0x4067, %rbx
nop
nop
and %r9, %r9
mov (%rbx), %r15w
cmp $57838, %rbx
lea addresses_UC_ht+0xfca2, %rbx
nop
nop
nop
nop
nop
and %rsi, %rsi
and $0xffffffffffffffc0, %rbx
vmovntdqa (%rbx), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %r9
cmp %rbx, %rbx
lea addresses_D_ht+0x14a66, %rsi
lea addresses_D_ht+0x1e378, %rdi
nop
xor %rbx, %rbx
mov $108, %rcx
rep movsb
nop
nop
nop
nop
nop
sub $18595, %rcx
lea addresses_D_ht+0x83e6, %rbx
nop
nop
nop
nop
dec %r9
mov $0x6162636465666768, %r11
movq %r11, %xmm1
movups %xmm1, (%rbx)
nop
nop
add %r9, %r9
lea addresses_D_ht+0x13a6, %rsi
lea addresses_UC_ht+0x28c6, %rdi
nop
nop
xor %rbx, %rbx
mov $74, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %rbx, %rbx
lea addresses_A_ht+0x5226, %rsi
lea addresses_WT_ht+0x11066, %rdi
sub $25205, %r9
mov $35, %rcx
rep movsl
nop
nop
sub %rbx, %rbx
lea addresses_WC_ht+0x1c666, %rsi
lea addresses_normal_ht+0xd5e6, %rdi
clflush (%rsi)
xor %rbx, %rbx
mov $123, %rcx
rep movsw
nop
and %rbx, %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %r8
push %rax
push %rcx
// Store
lea addresses_PSE+0x96a6, %r15
nop
nop
xor $34359, %r10
movb $0x51, (%r15)
nop
nop
xor $50664, %r10
// Store
lea addresses_WC+0x37e6, %r15
add %rcx, %rcx
movb $0x51, (%r15)
nop
nop
xor %r10, %r10
// Faulty Load
lea addresses_WT+0xbe6, %r10
nop
nop
nop
nop
xor $47967, %rax
vmovups (%r10), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r14
lea oracles, %rcx
and $0xff, %r14
shlq $12, %r14
mov (%rcx,%r14,1), %r14
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WT', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 1, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_WT', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'same': True, 'size': 32, 'congruent': 2, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 16, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': True}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
|
src/generator-rssfeed.ads
|
bracke/websitegenerator
| 1 |
17041
|
with Ada.Streams;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Wide_Wide_Text_IO; use Ada.Wide_Wide_Text_IO;
with DOM.Core.Documents; use DOM.Core.Documents;
with DOM.Core; use DOM.Core;
with DOM.Core.Elements; use DOM.Core.Elements;
with DOM.Core.Nodes; use DOM.Core.Nodes;
with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;
with Ada.Characters.Conversions;
with Ada.Directories;
with DOM.Readers;
with Globals;
with Version;
package Generator.Rssfeed is
function Create (
Posts : Document_Container.List;
Targetpath : String;
Site_Set : Translate_Set)
return String;
end Generator.Rssfeed;
|
oeis/008/A008420.asm
|
neoneye/loda-programs
| 11 |
23651
|
; A008420: Coordination sequence for 10-dimensional cubic lattice.
; Submitted by <NAME>
; 1,20,200,1340,6800,28004,97880,299660,822560,2060980,4780008,10377180,21278640,41517060,77548920,139380012,242080320,407782740,668274440,1068305020,1669752016,2556801700,3842321560,5675620300,8251811680,11823020020,16711687720,23326268700,32179616240,43910399300,59307908024,79340636780,105189061760,138283059860,180344446280,233435140028,300011499280,382985402340,485792684760,612469579020,767737840032,957099277620,1186940456040,1464648360540,1798737871920,2198991932036,2676615326200
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
trn $0,1
seq $0,8421 ; Crystal ball sequence for 10-dimensional cubic lattice.
mov $2,$3
mul $2,$0
add $4,$2
lpe
min $5,1
mul $5,$0
mov $0,$4
sub $0,$5
|
programs/oeis/265/A265542.asm
|
neoneye/loda
| 22 |
7340
|
; A265542: Largest base-9 palindrome m <= n, written in base 9.
; 0,1,2,3,4,5,6,7,8,8,11,11,11,11,11,11,11,11,11,11,22,22,22,22,22,22,22,22,22,22,33,33,33,33,33,33,33,33,33,33,44,44,44,44,44,44,44,44,44,44,55,55,55,55,55,55,55,55,55,55,66,66,66,66,66,66,66,66,66,66,77,77,77,77,77,77,77,77,77,77,88,88
seq $0,265541 ; Largest base-9 palindrome m <= n, written in base 10.
lpb $0
add $1,$0
div $0,10
lpe
mov $0,$1
|
fileManagement/seek.asm
|
slowy07/learnAsm
| 1 |
4923
|
section .text
global _start
section .data
fileName db 'impFile.txt', 0h
contentFile db 'make magic! --res--', 0h
_start:
mov ecx, 1
mov ebx, fileName
mov eax, 5
int 80h
mov edx, 2
mov ecx, 0
mov ebx, eax
mov eax, 19
int 80h
mov edx, 9
mov ecx, contentFile
mov eax, 4
int 80h
call quit
|
oeis/022/A022408.asm
|
neoneye/loda-programs
| 11 |
160991
|
<gh_stars>10-100
; A022408: a(n) = a(n-1) + a(n-2) + 1, with a(0)=3, a(1)=9.
; 3,9,13,23,37,61,99,161,261,423,685,1109,1795,2905,4701,7607,12309,19917,32227,52145,84373,136519,220893,357413,578307,935721,1514029,2449751,3963781,6413533,10377315,16790849,27168165,43959015,71127181,115086197,186213379,301299577,487512957,788812535,1276325493,2065138029,3341463523,5406601553,8748065077,14154666631,22902731709,37057398341,59960130051,97017528393,156977658445,253995186839,410972845285,664968032125,1075940877411,1740908909537,2816849786949,4557758696487,7374608483437
mov $1,3
mov $2,2
lpb $0
sub $0,2
add $1,$2
add $2,$1
lpe
lpb $0
div $0,4
add $2,$1
lpe
mov $0,$2
mul $0,2
sub $0,1
|
programs/oeis/140/A140163.asm
|
karttu/loda
| 0 |
275
|
<filename>programs/oeis/140/A140163.asm<gh_stars>0
; A140163: a(1)=1, a(n) = a(n-1) + n^5 if n odd, a(n) = a(n-1) + n if n is even.
; 1,3,246,250,3375,3381,20188,20196,79245,79255,240306,240318,611611,611625,1371000,1371016,2790873,2790891,5266990,5267010,9351111,9351133,15787476,15787500,25553125,25553151,39902058,39902086,60413235,60413265,89042416,89042448,128177841,128177875,180699750,180699786,250043743,250043781,340267980,340268020,456124221,456124263,603132706,603132750,787660875,787660921,1017005928,1017005976,1299481225,1299481275,1644506526,1644506578,2062702071,2062702125,2565986500,2565986556,3167678613,3167678671,3882602970,3882603030,4727199331,4727199393,5719635936,5719636000,6879926625,6879926691,8230051798,8230051866,9794083215,9794083285,11598312636,11598312708,13671384301,13671384375,16044431250,16044431326,18751215483,18751215561,21828271960,21828272040,25315056441,25315056523,29254097166,29254097250,33691150375,33691150461,38675359668,38675359756,44259419205,44259419295,50499740746,50499740838,57456624531,57456624625,65194434000,65194434096,73781774353,73781774451,83291674950,83291675050,93801775551,93801775653,105394516396,105394516500,118157332125,118157332231,132182849538,132182849646,147569089195,147569089305,164419670856,164419670968,182844022761,182844022875,202957594750,202957594866,224882075223,224882075341,248745611940,248745612060,274683036661,274683036783,302836093626,302836093750,333353671875,333353672001,366392041408,366392041536,402115093185,402115093315,440694582966,440694583098,482310378991,482310379125,527150713500,527150713636,575412438093,575412438231,627301282930,627301283070,683032119771,683032119913,742829228856,742829229000,806926569625,806926569771,875568055278,875568055426,949007831175,949007831325,1027510557076,1027510557228,1111351693221,1111351693375,1200817790250,1200817790406,1296206782963,1296206783121,1397828287920,1397828288080,1506003904881,1506003905043,1621067522086,1621067522250,1743365625375,1743365625541,1873257611148,1873257611316,2011116103165,2011116103335,2157327273186,2157327273358,2312291165451,2312291165625,2476422025000,2476422025176,2650148629833,2650148630011,2833914626910,2833914627090,3028178871991,3028178872173,3233415773316,3233415773500,3450115639125,3450115639311,3678785029018,3678785029206,3919947109155,3919947109345,4174142011296,4174142011488,4441927195681,4441927195875,4723877817750,4723877817946,5020587098703,5020587098901,5332666699900,5332666700100,5660747101101,5660747101303,6005477982546,6005477982750,6367528610875,6367528611081,6747588228888,6747588229096,7146366449145,7146366449355,7564593651406,7564593651618,8003021383911,8003021384125,8462422768500,8462422768716,8943592909573,8943592909791,9447349306890,9447349307110,9974532272211,9974532272433,10526005349776,10526005350000,11102655740625,11102655740851,11705394730758,11705394730986,12335158123135,12335158123365,12992906673516,12992906673748,13679626530141,13679626530375,14396329677250,14396329677486,15144054382443,15144054382681,15923865647880,15923865648120,16736855665321,16736855665563,17584144275006,17584144275250,18466879428375,18466879428621,19386237654628,19386237654876,20343424531125,20343424531375
mov $2,$0
add $2,1
mov $7,$0
lpb $2,1
mov $0,$7
sub $2,1
sub $0,$2
mov $3,1
add $3,$0
mov $0,1
mov $5,$3
add $5,$4
sub $5,$4
mov $4,$5
lpb $0,1
sub $3,$0
mov $0,4
sub $3,$6
add $0,$3
mod $0,2
mov $3,1
sub $4,1
mov $5,$4
add $5,1
lpe
pow $3,4
mul $3,$5
add $1,$3
mov $6,1
lpe
|
src/unprotected.asm
|
hirohito-protagonist/hla-learn-adventure
| 0 |
179956
|
; Assembly code emitted by HLA compiler
; Version 2.16 build 4413 (prototype)
; HLA compiler written by <NAME>
; NASM compatible output
bits 32
%define ExceptionPtr__hla_ [dword fs:0]
global QuitMain__hla_
global DfltExHndlr__hla_
global _HLAMain
global HWexcept__hla_
global start
section .text code align=16
extern STDOUT_PUTI32
extern STDOUT_NEWLN
extern DefaultExceptionHandler__hla_
extern abstract__hla_
extern HardwareException__hla_
extern BuildExcepts__hla_
extern STDOUT_PUTS
extern STDIN_GETI32
extern Raise__hla_
extern shortDfltExcept__hla_
%define exception__hla_1905 Raise__hla_
section .text
;/* HWexcept__hla_ gets called when Windows raises the exception. */
; procedure HWexcept__hla_
HWexcept__hla_:
jmp HardwareException__hla_
;HWexcept__hla_ endp
; procedure DfltExHndlr__hla_
DfltExHndlr__hla_:
jmp DefaultExceptionHandler__hla_
;DfltExHndlr__hla_ endp
; procedure _HLAMain
_HLAMain:
nop
; procedure start
start:
;start endp
call BuildExcepts__hla_
; push dword 0
db 06ah ;
db 00h ;
; push ebp
db 055h ;
; push ebp
db 055h ;
; lea ebp, [esp+4]
db 08dh ;
db 06ch ;
db 024h ;
db 04h ;
forever__hla_1890:
continue__hla_1889:
; push strict dword exception__hla_1892
db 068h ;
dd exception__hla_1892
; push ebp
db 055h ;
;/* fs: */
db 064h ;
; mov ebp, [0]
db 08bh ;
db 02dh ;
dd 00h
; push dword [ebp+8]
db 0ffh ;
db 075h ;
db 08h ;
; mov ebp, [esp+4]
db 08bh ;
db 06ch ;
db 024h ;
db 04h ;
; push strict dword HWexcept__hla_
db 068h ;
dd HWexcept__hla_
;/* fs: */
db 064h ;
; push dword [0]
db 0ffh ;
db 035h ;
dd 00h
;/* fs: */
db 064h ;
; mov [0], esp
db 089h ;
db 025h ;
dd 00h
; push strict dword str__hla_1893
db 068h ;
dd str__hla_1893
call STDOUT_PUTS
; push eax
db 050h ;
call STDIN_GETI32
; mov [input__hla_1885], eax
db 0a3h ;
dd (input__hla_1885+0)
; pop eax
db 058h ;
; push strict dword str__hla_1902
db 068h ;
dd str__hla_1902
call STDOUT_PUTS
; push dword [input__hla_1885]
db 0ffh ;
db 035h ;
dd input__hla_1885
call STDOUT_PUTI32
call STDOUT_NEWLN
;/* fs: */
db 064h ;
; mov esp, [0]
db 08bh ;
db 025h ;
dd 00h
;/* fs: */
db 064h ;
; pop dword [0]
db 08fh ;
db 05h ;
dd 00h
; add esp, 8
db 083h ;
db 0c4h ;
db 08h ;
; pop ebp
db 05dh ;
; add esp, 4
db 083h ;
db 0c4h ;
db 04h ;
jmp exitloop__hla_1889
jmp endtry__hla_1891
exception__hla_1892:
; cmp eax, 8
db 083h ;
db 0f8h ;
db 08h ;
jne exception__hla_1903
; push strict dword str__hla_1904
db 068h ;
dd str__hla_1904
call STDOUT_PUTS
call STDOUT_NEWLN
jmp endtry__hla_1891
exception__hla_1903:
; cmp eax, 20
db 083h ;
db 0f8h ;
db 014h ;
jne exception__hla_1905
; push strict dword str__hla_1906
db 068h ;
dd str__hla_1906
call STDOUT_PUTS
call STDOUT_NEWLN
endtry__hla_1891:
jmp forever__hla_1890
exitloop__hla_1889:
; push strict dword str__hla_1907
db 068h ;
dd str__hla_1907
call STDOUT_PUTS
; push eax
db 050h ;
call STDIN_GETI32
; mov [input__hla_1885], eax
db 0a3h ;
dd (input__hla_1885+0)
; pop eax
db 058h ;
; push strict dword str__hla_1902
db 068h ;
dd str__hla_1902
call STDOUT_PUTS
; push dword [input__hla_1885]
db 0ffh ;
db 035h ;
dd input__hla_1885
call STDOUT_PUTI32
call STDOUT_NEWLN
QuitMain__hla_:
; push dword 0
db 06ah ;
db 00h ;
; call [__imp__ExitProcess@4]
db 0ffh ;
db 015h ;
dd __imp__ExitProcess@4
;_HLAMain endp
section .text
align (4)
len__hla_1893 dd 0bh
dd 0bh
str__hla_1893:
db "write int: "
db 0
align (4)
len__hla_1902 dd 05h
dd 05h
str__hla_1902:
db "int: "
db 0
db 0
db 0
align (4)
len__hla_1904 dd 010h
dd 010h
str__hla_1904:
db "number is to big"
db 0
db 0
db 0
db 0
align (4)
len__hla_1906 dd 010h
dd 010h
str__hla_1906:
db "incorrect number"
db 0
db 0
db 0
db 0
align (4)
len__hla_1907 dd 016h
dd 016h
str__hla_1907:
db "write int once again: "
db 0
db 0
section .data data align=16
extern MainPgmCoroutine__hla_
extern __imp__MessageBoxA@16
extern __imp__ExitProcess@4
align (4)
input__hla_1885 times 4 db 0
|
alloy4fun_models/trashltl/models/9/W5PESCnEkCrPooSge.als
|
Kaixi26/org.alloytools.alloy
| 0 |
5176
|
<reponame>Kaixi26/org.alloytools.alloy
open main
pred idW5PESCnEkCrPooSge_prop10 {
all f : File | always f in Protected since f in Protected
}
pred __repair { idW5PESCnEkCrPooSge_prop10 }
check __repair { idW5PESCnEkCrPooSge_prop10 <=> prop10o }
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_326.asm
|
ljhsiun2/medusa
| 9 |
25421
|
<filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_326.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r8
push %rax
push %rdx
lea addresses_WT_ht+0x1a186, %r8
sub $24543, %rdx
mov (%r8), %eax
cmp %r8, %r8
pop %rdx
pop %rax
pop %r8
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r15
push %rax
push %rdi
push %rdx
// Store
lea addresses_PSE+0x1c516, %rax
nop
nop
nop
nop
nop
add $21831, %r12
mov $0x5152535455565758, %r11
movq %r11, %xmm6
vmovups %ymm6, (%rax)
// Exception!!!
nop
nop
mov (0), %r12
nop
nop
nop
nop
nop
sub %r15, %r15
// Load
lea addresses_US+0xe986, %rdi
nop
nop
nop
cmp $64785, %rdx
mov (%rdi), %r12
nop
nop
nop
nop
nop
dec %r15
// Faulty Load
lea addresses_WT+0xc986, %r11
add $17388, %rax
mov (%r11), %rdx
lea oracles, %r12
and $0xff, %rdx
shlq $12, %rdx
mov (%r12,%rdx,1), %rdx
pop %rdx
pop %rdi
pop %rax
pop %r15
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_PSE', 'congruent': 4}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_US', 'congruent': 11}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 10}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
|
4/4-2b.asm
|
winderica/GoodbyeASM
| 0 |
242179
|
<reponame>winderica/GoodbyeASM
.386
stack segment use16 stack
db 500 dup(0)
stack ends
code segment use16
start:
cli
xor ax, ax
mov ds, ax
mov ax, fs:[200h * 4]
cmp ax, 0
je exit
mov ds:[16h * 4], ax
mov ax, fs:[200h * 4 + 2]
mov ds:[16h * 4 + 2], ax
sti
exit:
mov ah, 4ch
int 21h
code ends
end start
|
LectureNotes/MetAndTop/Chapter1.agda
|
Smaug123/agdaproofs
| 4 |
17437
|
<reponame>Smaug123/agdaproofs
{-# OPTIONS --safe --warning=error --without-K #-}
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_; Setω)
open import Boolean.Definition
open import Setoids.Setoids
open import Setoids.Subset
open import Setoids.Functions.Definition
open import LogicalFormulae
open import Functions.Definition
open import Lists.Lists
module LectureNotes.MetAndTop.Chapter1 where
PowerSet : {a : _} (A : Set a) → {b : _} → Set (a ⊔ lsuc b)
PowerSet A {b} = A → Set b
equality : {a b c : _} (A : Set a) → PowerSet A {b} → PowerSet A {c} → Set (a ⊔ b ⊔ c)
equality A x y = (z : A) → (x z → y z) && (y z → x z)
trans : {a b c d : _} {A : Set a} → {x : PowerSet A {b}} {y : PowerSet A {c}} {z : PowerSet A {d}} → equality A x y → equality A y z → equality A x z
trans {x} {y} {z} x=y y=z i with x=y i
... | r ,, s with y=z i
... | t ,, u = (λ z → t (r z)) ,, λ z → s (r (_&&_.snd (x=y i) (u z)))
symm : {a b c : _} {A : Set a} → {x : PowerSet A {b}} {y : PowerSet A {c}} → equality A x y → equality A y x
symm x=y i with x=y i
... | r ,, s = s ,, r
reflex : {a b : _} {A : Set a} → (x : PowerSet A {b}) → equality A x x
reflex x i = (λ z → z) ,, λ z → z
mapPower : {a b c : _} {A : Set a} {B : Set b} (f : A → B) → PowerSet B {c} → PowerSet A {c}
mapPower f p a = p (f a)
mapF : {a b c : _} {A : Set a} {B : Set b} (f : A → B) → PowerSet A {c} → PowerSet B {_}
mapF {A = A} f p b = Sg A (λ a → (p a) && (f a ≡ b))
singleton : {a b : _} {A : Set a} → (decidableEquality : (x y : A) → (x ≡ y) || ((x ≡ y) → False)) → A → PowerSet A {b}
singleton decidable a n with decidable a n
singleton decidable a n | inl x = True'
singleton decidable a n | inr x = False'
intersection : {a b c : _} {A : Set a} {B : Set b} (sets : A → PowerSet B {c}) → PowerSet B {a ⊔ c}
intersection {A = A} sets x = (a : A) → (sets a) x
union : {a b c : _} {A : Set a} {B : Set b} (sets : A → PowerSet B {c}) → PowerSet B {a ⊔ c}
union {A = A} sets x = Sg A λ i → sets i x
complement : {a b : _} {A : Set a} → (x : PowerSet A {b}) → PowerSet A
complement x t = x t → False
emptySet : {a b : _} (A : Set a) → PowerSet A {b}
emptySet A x = False'
decideIt : {a b : _} {A : Set a} → {f : A → Set b} → ((x : A) → (f x) || ((f x) → False)) → A → Set _
decideIt decide a with decide a
decideIt decide a | inl x = True
decideIt decide a | inr x = False
fromExtension : {a : _} {A : Set a} → ((x y : A) → (x ≡ y) || ((x ≡ y) → False)) → List A → PowerSet A
fromExtension decideEquality l = decideIt {f = contains l} (containsDecidable decideEquality l)
private
data !1234 : Set where
!1 : !1234
!2 : !1234
!3 : !1234
!4 : !1234
decidable1234 : (x y : !1234) → (x ≡ y) || ((x ≡ y) → False)
decidable1234 !1 !1 = inl refl
decidable1234 !1 !2 = inr (λ ())
decidable1234 !1 !3 = inr (λ ())
decidable1234 !1 !4 = inr (λ ())
decidable1234 !2 !1 = inr (λ ())
decidable1234 !2 !2 = inl refl
decidable1234 !2 !3 = inr (λ ())
decidable1234 !2 !4 = inr (λ ())
decidable1234 !3 !1 = inr (λ ())
decidable1234 !3 !2 = inr (λ ())
decidable1234 !3 !3 = inl refl
decidable1234 !3 !4 = inr (λ ())
decidable1234 !4 !1 = inr (λ ())
decidable1234 !4 !2 = inr (λ ())
decidable1234 !4 !3 = inr (λ ())
decidable1234 !4 !4 = inl refl
f : !1234 → !1234
f !1 = !1
f !2 = !1
f !3 = !4
f !4 = !3
exercise1'1i1 : {b : _} → equality {b = b} !1234 (mapPower f (singleton decidable1234 !1)) (fromExtension decidable1234 (!1 :: !2 :: []))
exercise1'1i1 !1 = (λ x → record {}) ,, (λ x → record {})
exercise1'1i1 !2 = (λ x → record {}) ,, (λ x → record {})
exercise1'1i1 !3 = (λ ()) ,, (λ ())
exercise1'1i1 !4 = (λ ()) ,, λ ()
exercise1'1i2 : {b : _} → equality {b = b} !1234 (mapPower f (singleton decidable1234 !2)) (λ _ → False)
exercise1'1i2 !1 = (λ ()) ,, λ ()
exercise1'1i2 !2 = (λ ()) ,, (λ ())
exercise1'1i2 !3 = (λ ()) ,, (λ ())
exercise1'1i2 !4 = (λ ()) ,, (λ ())
exercise1'1i3 : equality !1234 (mapPower f (fromExtension decidable1234 (!3 :: !4 :: []))) (fromExtension decidable1234 (!3 :: !4 :: []))
exercise1'1i3 !1 = (λ x → x) ,, (λ x → x)
exercise1'1i3 !2 = (λ x → x) ,, (λ x → x)
exercise1'1i3 !3 = (λ x → record {}) ,, (λ x → record {})
exercise1'1i3 !4 = (λ x → record {}) ,, (λ x → record {})
exercise1'1ii1 : {a b c t : _} {A : Set a} {B : Set b} {T : Set t} → (f : A → B) → (sets : T → PowerSet B {c}) → equality A (mapPower f (union sets)) (union λ x → mapPower f (sets x))
exercise1'1ii1 f sets i = (λ x → x) ,, (λ x → x)
exercise1'1ii2 : {a b c t : _} {A : Set a} {B : Set b} {T : Set t} → (f : A → B) → (sets : T → PowerSet B {c}) → equality A (mapPower f (intersection sets)) (intersection λ x → mapPower f (sets x))
exercise1'1ii2 f sets i = (λ x → x) ,, (λ x → x)
exercise1'1ii3 : {a b : _} {A : Set a} {B : Set b} → (f : A → B) → equality A (mapPower f (λ i → True)) (λ i → True)
exercise1'1ii3 f = λ z → (λ x → record {}) ,, (λ x → record {})
exercise1'1ii4 : {a b c : _} {A : Set a} {B : Set b} → (f : A → B) → equality A (mapPower f (emptySet {b = c} B)) (emptySet A)
exercise1'1ii4 f = λ z → (λ x → x) ,, (λ x → x)
exercise1'1ii5 : {a b c : _} {A : Set a} {B : Set b} → (f : A → B) → (u : PowerSet B {c}) → equality A (mapPower f (complement u)) (complement (mapPower f u))
exercise1'1ii5 f u z = (λ x → x) ,, (λ x → x)
exercise1'1iii1 : {a b c t : _} {A : Set a} {B : Set b} {T : Set t} → (f : A → B) (sets : T → PowerSet A {c}) → equality B (mapF f (union sets)) (union λ t → mapF f (sets t))
exercise1'1iii1 {A = A} {T = T} f sets z = x ,, y
where
x : mapF f (union sets) z → union (λ t → mapF f (sets t)) z
x (a , ((t , isIn) ,, snd)) = t , (a , (isIn ,, snd))
y : union (λ t → mapF f (sets t)) z → mapF f (union sets) z
y (t , (r , s)) = r , ((t , _&&_.fst s) ,, _&&_.snd s)
exercise1'1iii2 : {a b c d : _} {A : Set a} {B : Set b} → (f : A → B) → equality B (mapF f (emptySet {b = c} A)) (emptySet {b = d} B)
exercise1'1iii2 {A = A} {B = B} f z = x ,, λ ()
where
x : mapF f (emptySet A) z → emptySet B z
x (a , ())
ex4F : !1234 → !1234
ex4F !1 = !1
ex4F !2 = !2
ex4F !3 = !1
ex4F !4 = !4
v1 : PowerSet !1234
v1 !1 = True
v1 !2 = True
v1 !3 = False
v1 !4 = False
v2 : PowerSet !1234
v2 !1 = False
v2 !2 = True
v2 !3 = True
v2 !4 = False
v1AndV2 : Bool → !1234 → Set
v1AndV2 BoolTrue = v1
v1AndV2 BoolFalse = v2
lhs : equality {c = lzero} !1234 (mapF ex4F (intersection v1AndV2)) (singleton decidable1234 !2)
lhs !1 = ans ,, λ ()
where
ans : mapF ex4F (intersection v1AndV2) !1 → False'
ans (!1 , (fst ,, refl)) with fst BoolFalse
ans (!1 , (fst ,, refl)) | ()
ans (!3 , (fst ,, refl)) with fst BoolTrue
ans (!3 , (fst ,, refl)) | ()
lhs !2 = (λ _ → record {}) ,, ans
where
u : intersection v1AndV2 !2
u BoolTrue = record {}
u BoolFalse = record {}
ans : singleton decidable1234 !2 !2 → mapF ex4F (intersection v1AndV2) !2
ans _ = !2 , (u ,, refl)
lhs !3 = ans ,, λ ()
where
ans : mapF ex4F (intersection v1AndV2) !3 → False'
ans (!3 , (fst ,, ()))
lhs !4 = ans ,, λ ()
where
ans : mapF ex4F (intersection v1AndV2) !4 → False'
ans (!4 , (fst ,, refl)) with fst BoolTrue
ans (!4 , (fst ,, refl)) | ()
fv1AndV2 : Bool → !1234 → Set
fv1AndV2 BoolTrue = mapF ex4F v1
fv1AndV2 BoolFalse = mapF ex4F v2
rhs : equality {c = lzero} !1234 (intersection fv1AndV2) (fromExtension decidable1234 (!2 :: !1 :: []))
rhs !1 = (λ _ → record {}) ,, λ _ → a
where
a : intersection fv1AndV2 !1
a BoolTrue = !1 , (record {} ,, refl)
a BoolFalse = !3 , (record {} ,, refl)
rhs !2 = (λ _ → record {}) ,, λ _ → a
where
a : intersection fv1AndV2 !2
a BoolTrue = !2 , (record {} ,, refl)
a BoolFalse = !2 , (record {} ,, refl)
rhs !3 = a ,, λ ()
where
a : intersection fv1AndV2 !3 → fromExtension decidable1234 (!2 :: !1 :: []) !4
a pr with pr BoolTrue
a pr | !1 , (fst ,, ())
a pr | !2 , (fst ,, ())
a pr | !3 , (fst ,, snd) = fst
a pr | !4 , (fst ,, snd) = fst
rhs !4 = a ,, λ ()
where
a : intersection fv1AndV2 !4 → fromExtension decidable1234 (!2 :: !1 :: []) !4
a pr with pr BoolTrue
a pr | !1 , (x ,, ())
a pr | !2 , (x ,, ())
a pr | !3 , (x ,, ())
a pr | !4 , (x ,, _) = x
exercise1'1iv1 : (equality !1234 (mapF ex4F (intersection v1AndV2)) (intersection fv1AndV2)) → False
exercise1'1iv1 pr = ohno
where
bad : equality !1234 (fromExtension decidable1234 (!2 :: !1 :: [])) (singleton decidable1234 !2)
bad = trans (symm rhs) (trans (symm pr) lhs)
ohno : False
ohno with bad !1
ohno | fst ,, snd with fst record {}
... | ()
exercise1'1iv2 : (equality !1234 (mapF ex4F (λ _ → True)) (λ _ → True)) → False
exercise1'1iv2 pr with pr !3
exercise1'1iv2 pr | fst ,, snd with snd _
exercise1'1iv2 pr | fst ,, snd | !1 , ()
exercise1'1iv2 pr | fst ,, snd | !2 , ()
exercise1'1iv2 pr | fst ,, snd | !3 , ()
exercise1'1iv2 pr | fst ,, snd | !4 , ()
exercise1'1iv3 : equality !1234 (mapF ex4F (complement v1)) (complement v1) → False
exercise1'1iv3 pr with pr !1
exercise1'1iv3 pr | fst ,, snd with fst (!3 , ((λ i → i) ,, refl)) (record {})
... | ()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.