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
src/drivers/adabase-driver-base-firebird.adb
jrmarino/AdaBase
30
4561
<filename>src/drivers/adabase-driver-base-firebird.adb -- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../../License.txt with Ada.Strings.Fixed; package body AdaBase.Driver.Base.Firebird is package ASF renames Ada.Strings.Fixed; --------------- -- execute -- --------------- overriding function execute (driver : Firebird_Driver; sql : String) return AD.AffectedRows is result : AD.AffectedRows := 0; begin return result; -- TODO end execute; ------------------------- -- query_clear_table -- ------------------------- overriding procedure query_clear_table (driver : Firebird_Driver; table : String) is -- Firebird has no "truncate" commands sql : constant String := "DELETE FROM " & table; AR : ACB.AD.AffectedRows; begin AR := driver.execute (sql => sql); end query_clear_table; ------------------------ -- query_drop_table -- ------------------------ overriding procedure query_drop_table (driver : Firebird_Driver; tables : String; when_exists : Boolean := False; cascade : Boolean := False) is sql : AD.textual; AR : AD.AffectedRows; begin if ASF.Index (Source => tables, Pattern => ",", From => 1) /= 0 then driver.log_problem (category => AD.execution, message => SUS ("Multiple tables detected -- Firebird can only drop " & "one table at a time : " & tables)); return; end if; if cascade then driver.log_nominal (category => AD.execution, message => SUS ("Note that requested CASCADE has no effect on Firebird")); end if; case when_exists is when False => sql := SUS ("DROP TABLE " & tables); when True => sql := SUS ("EXECUTE BLOCK AS BEGIN " & "if (exists(select 1 from rdb$relations where " & "rdb$relation_name = '" & tables & "')) then " & "execute statement 'drop table " & tables & ";'; END"); end case; AR := driver.execute (sql => USS (sql)); end query_drop_table; ---------------------- -- last_insert_id -- ---------------------- overriding function last_insert_id (driver : Firebird_Driver) return AD.TraxID is begin return 0; -- TODO end last_insert_id; ---------------------- -- last_sql_state -- ---------------------- overriding function last_sql_state (driver : Firebird_Driver) return AD.TSqlState is begin return AD.stateless; -- TODO end last_sql_state; ----------------------- -- last_error_info -- ----------------------- overriding function last_error_info (driver : Firebird_Driver) return AD.Error_Info is result : AD.Error_Info; begin return result; -- TODO end last_error_info; ------------- -- query -- ------------- overriding function query (driver : Firebird_Driver; sql : String) return AS.Base'Class is result : AS.Base; begin return result; -- TODO end query; ------------------------------------------------------------------------ -- PRIVATE ROUTINES NOT COVERED BY INTERFACES -- ------------------------------------------------------------------------ end AdaBase.Driver.Base.Firebird;
Transynther/x86/_processed/NONE/_zr_xt_/i3-7100_9_0x84_notsx.log_21829_992.asm
ljhsiun2/medusa
9
174594
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r14 push %r15 push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0x5c8c, %r11 nop nop nop nop sub $28132, %r15 movb (%r11), %r14b nop nop nop nop nop inc %r13 lea addresses_UC_ht+0x16354, %r14 nop nop and $23614, %r15 movb (%r14), %cl sub %r14, %r14 lea addresses_UC_ht+0x1eb14, %rbx nop nop nop cmp %rsi, %rsi movups (%rbx), %xmm2 vpextrq $0, %xmm2, %r13 cmp $46926, %rbx lea addresses_WC_ht+0xfd94, %r15 nop nop nop nop cmp %r14, %r14 movw $0x6162, (%r15) dec %r15 lea addresses_normal_ht+0x123c, %rsi lea addresses_D_ht+0x1d7d4, %rdi nop nop nop sub $10933, %rbx mov $91, %rcx rep movsq nop nop cmp $38196, %rcx lea addresses_WC_ht+0x18d28, %rdi nop cmp %r14, %r14 movl $0x61626364, (%rdi) nop nop nop nop inc %rbx lea addresses_normal_ht+0x1c17f, %rsi lea addresses_D_ht+0x13736, %rdi nop nop nop nop mfence mov $124, %rcx rep movsl add %rsi, %rsi lea addresses_D_ht+0xa214, %rsi lea addresses_WT_ht+0xa14, %rdi nop nop nop nop nop cmp %r14, %r14 mov $15, %rcx rep movsq nop xor %rdi, %rdi lea addresses_D_ht+0x1d190, %r14 clflush (%r14) nop nop cmp $28404, %r11 movups (%r14), %xmm2 vpextrq $1, %xmm2, %rcx nop add %r14, %r14 lea addresses_UC_ht+0x1094, %rsi lea addresses_D_ht+0x9c44, %rdi clflush (%rdi) nop nop nop nop xor $10584, %rbx mov $27, %rcx rep movsb nop nop nop add $47746, %r14 lea addresses_normal_ht+0x18134, %rcx nop xor $24269, %rdi movb $0x61, (%rcx) nop nop cmp %r13, %r13 lea addresses_WT_ht+0x214, %r15 nop nop nop and $11241, %rbx movb (%r15), %r13b nop add %rsi, %rsi lea addresses_UC_ht+0x1a04, %rbx clflush (%rbx) sub %rsi, %rsi mov $0x6162636465666768, %r15 movq %r15, %xmm1 and $0xffffffffffffffc0, %rbx movntdq %xmm1, (%rbx) and $14256, %r14 lea addresses_D_ht+0xaccc, %rsi lea addresses_UC_ht+0xca24, %rdi clflush (%rsi) nop nop nop sub $61389, %r13 mov $30, %rcx rep movsl sub $14838, %rdi pop %rsi pop %rdi pop %rcx pop %rbx pop %r15 pop %r14 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r14 push %r15 push %rbp push %rcx push %rsi // Store lea addresses_WC+0x19e14, %r13 nop nop and $4826, %rsi mov $0x5152535455565758, %r15 movq %r15, (%r13) nop xor $55878, %r11 // Load lea addresses_normal+0x1e9b4, %r14 nop nop and $27502, %rcx mov (%r14), %ebp nop nop nop nop nop add $7021, %r11 // Faulty Load lea addresses_A+0xc214, %rcx nop nop nop sub $16702, %rsi vmovups (%rcx), %ymm6 vextracti128 $0, %ymm6, %xmm6 vpextrq $0, %xmm6, %r14 lea oracles, %rsi and $0xff, %r14 shlq $12, %r14 mov (%rsi,%r14,1), %r14 pop %rsi pop %rcx pop %rbp pop %r15 pop %r14 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WC', 'same': False, 'size': 8, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_A', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'same': True, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'same': True, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_normal_ht', 'same': True, 'size': 1, 'congruent': 2, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 4, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'00': 1, '35': 21828} 00 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 */
firmware/coreboot/3rdparty/libgfxinit/common/g45/hw-gfx-gma-gmch-hdmi.adb
fabiojna02/OpenCellular
1
17106
-- -- Copyright (C) 2015-2016 secunet Security Networks AG -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- with HW.GFX.GMA.Registers; with HW.Debug; with GNAT.Source_Info; package body HW.GFX.GMA.GMCH.HDMI is GMCH_HDMI_ENABLE : constant := 1 * 2 ** 31; GMCH_HDMI_COLOR_FORMAT_8BPC : constant := 0 * 2 ** 26; GMCH_HDMI_COLOR_FORMAT_12BPC : constant := 3 * 2 ** 26; GMCH_HDMI_COLOR_FORMAT_MASK : constant := 7 * 2 ** 26; GMCH_HDMI_SDVO_ENCODING_SDVO : constant := 0 * 2 ** 10; GMCH_HDMI_SDVO_ENCODING_HDMI : constant := 2 * 2 ** 10; GMCH_HDMI_SDVO_ENCODING_MASK : constant := 3 * 2 ** 10; GMCH_HDMI_MODE_SELECT_HDMI : constant := 1 * 2 ** 9; GMCH_HDMI_MODE_SELECT_DVI : constant := 0 * 2 ** 9; GMCH_HDMI_VSYNC_ACTIVE_HIGH : constant := 1 * 2 ** 4; GMCH_HDMI_HSYNC_ACTIVE_HIGH : constant := 1 * 2 ** 3; GMCH_HDMI_PORT_DETECT : constant := 1 * 2 ** 2; GMCH_HDMI_MASK : constant Word32 := GMCH_PORT_PIPE_SELECT_MASK or GMCH_HDMI_ENABLE or GMCH_HDMI_COLOR_FORMAT_MASK or GMCH_HDMI_SDVO_ENCODING_MASK or GMCH_HDMI_MODE_SELECT_HDMI or GMCH_HDMI_HSYNC_ACTIVE_HIGH or GMCH_HDMI_VSYNC_ACTIVE_HIGH; type GMCH_HDMI_Array is array (GMCH_HDMI_Port) of Registers.Registers_Index; GMCH_HDMI : constant GMCH_HDMI_Array := GMCH_HDMI_Array' (DIGI_B => Registers.GMCH_HDMIB, DIGI_C => Registers.GMCH_HDMIC); ---------------------------------------------------------------------------- procedure On (Port_Cfg : in Port_Config; Pipe : in Pipe_Index) is Polarity : constant Word32 := (if Port_Cfg.Mode.H_Sync_Active_High then GMCH_HDMI_HSYNC_ACTIVE_HIGH else 0) or (if Port_Cfg.Mode.V_Sync_Active_High then GMCH_HDMI_VSYNC_ACTIVE_HIGH else 0); begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); Registers.Unset_And_Set_Mask (Register => GMCH_HDMI (Port_Cfg.Port), Mask_Unset => GMCH_HDMI_MASK, Mask_Set => GMCH_HDMI_ENABLE or GMCH_PORT_PIPE_SELECT (Pipe) or GMCH_HDMI_SDVO_ENCODING_HDMI or GMCH_HDMI_MODE_SELECT_DVI or Polarity); end On; ---------------------------------------------------------------------------- procedure Off (Port : GMCH_HDMI_Port) is begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); Registers.Unset_And_Set_Mask (Register => GMCH_HDMI (Port), Mask_Unset => GMCH_HDMI_MASK, Mask_Set => GMCH_HDMI_HSYNC_ACTIVE_HIGH or GMCH_HDMI_VSYNC_ACTIVE_HIGH); end Off; procedure All_Off is begin pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity)); for Port in GMCH_HDMI_Port loop Off (Port); end loop; end All_Off; end HW.GFX.GMA.GMCH.HDMI;
Definition/LogicalRelation/Properties/Symmetry.agda
loic-p/logrel-mltt
0
16128
<reponame>loic-p/logrel-mltt<filename>Definition/LogicalRelation/Properties/Symmetry.agda {-# OPTIONS --without-K --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Properties.Symmetry {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped open import Definition.Typed open import Definition.Typed.Properties open import Definition.LogicalRelation open import Definition.LogicalRelation.ShapeView open import Definition.LogicalRelation.Irrelevance open import Definition.LogicalRelation.Properties.Conversion open import Tools.Embedding open import Tools.Product import Tools.PropositionalEquality as PE mutual -- Helper function for symmetry of type equality using shape views. symEqT : ∀ {Γ A B l l′} {[A] : Γ ⊩⟨ l ⟩ A} {[B] : Γ ⊩⟨ l′ ⟩ B} → ShapeView Γ l l′ A B [A] [B] → Γ ⊩⟨ l ⟩ A ≡ B / [A] → Γ ⊩⟨ l′ ⟩ B ≡ A / [B] symEqT (ℕᵥ D D′) A≡B = ιx (ℕ₌ (red D)) symEqT (ne (ne K D neK K≡K) (ne K₁ D₁ neK₁ K≡K₁)) (ιx (ne₌ M D′ neM K≡M)) rewrite whrDet* (red D′ , ne neM) (red D₁ , ne neK₁) = ιx (ne₌ _ D neK (~-sym K≡M)) symEqT {Γ = Γ} (Πᵥ (Πᵣ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πᵣ F₁ G₁ D₁ ⊢F₁ ⊢G₁ A≡A₁ [F]₁ [G]₁ G-ext₁)) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) = let ΠF₁G₁≡ΠF′G′ = whrDet* (red D₁ , Πₙ) (D′ , Πₙ) F₁≡F′ , G₁≡G′ = Π-PE-injectivity ΠF₁G₁≡ΠF′G′ [F₁≡F] : ∀ {Δ} {ρ} [ρ] ⊢Δ → _ [F₁≡F] {Δ} {ρ} [ρ] ⊢Δ = let ρF′≡ρF₁ ρ = PE.cong (wk ρ) (PE.sym F₁≡F′) [ρF′] {ρ} [ρ] ⊢Δ = PE.subst (λ x → Δ ⊩⟨ _ ⟩ wk ρ x) F₁≡F′ ([F]₁ [ρ] ⊢Δ) in irrelevanceEq′ {Δ} (ρF′≡ρF₁ ρ) ([ρF′] [ρ] ⊢Δ) ([F]₁ [ρ] ⊢Δ) (symEq ([F] [ρ] ⊢Δ) ([ρF′] [ρ] ⊢Δ) ([F≡F′] [ρ] ⊢Δ)) in Π₌ _ _ (red D) (≅-sym (PE.subst (λ x → Γ ⊢ Π F ▹ G ≅ x) (PE.sym ΠF₁G₁≡ΠF′G′) A≡B)) [F₁≡F] (λ {ρ} [ρ] ⊢Δ [a] → let ρG′a≡ρG₁′a = PE.cong (λ x → wk (lift ρ) x [ _ ]) (PE.sym G₁≡G′) [ρG′a] = PE.subst (λ x → _ ⊩⟨ _ ⟩ wk (lift ρ) x [ _ ]) G₁≡G′ ([G]₁ [ρ] ⊢Δ [a]) [a]₁ = convTerm₁ ([F]₁ [ρ] ⊢Δ) ([F] [ρ] ⊢Δ) ([F₁≡F] [ρ] ⊢Δ) [a] in irrelevanceEq′ ρG′a≡ρG₁′a [ρG′a] ([G]₁ [ρ] ⊢Δ [a]) (symEq ([G] [ρ] ⊢Δ [a]₁) [ρG′a] ([G≡G′] [ρ] ⊢Δ [a]₁))) symEqT (Uᵥ _ _ _ _ _ _) A≡B = U₌ PE.refl symEqT (emb⁰¹ PE.refl x) (ιx A≡B) = symEqT x A≡B symEqT (emb¹⁰ PE.refl x) A≡B = ιx (symEqT x A≡B) -- Symmetry of type equality. symEq : ∀ {Γ A B l l′} ([A] : Γ ⊩⟨ l ⟩ A) ([B] : Γ ⊩⟨ l′ ⟩ B) → Γ ⊩⟨ l ⟩ A ≡ B / [A] → Γ ⊩⟨ l′ ⟩ B ≡ A / [B] symEq [A] [B] A≡B = symEqT (goodCases [A] [B] A≡B) A≡B symNeutralTerm : ∀ {t u A Γ} → Γ ⊩neNf t ≡ u ∷ A → Γ ⊩neNf u ≡ t ∷ A symNeutralTerm (neNfₜ₌ neK neM k≡m) = neNfₜ₌ neM neK (~-sym k≡m) symNatural-prop : ∀ {Γ k k′} → [Natural]-prop Γ k k′ → [Natural]-prop Γ k′ k symNatural-prop (sucᵣ (ℕₜ₌ k k′ d d′ t≡u prop)) = sucᵣ (ℕₜ₌ k′ k d′ d (≅ₜ-sym t≡u) (symNatural-prop prop)) symNatural-prop zeroᵣ = zeroᵣ symNatural-prop (ne prop) = ne (symNeutralTerm prop) -- Symmetry of term equality. symEqTerm : ∀ {l Γ A t u} ([A] : Γ ⊩⟨ l ⟩ A) → Γ ⊩⟨ l ⟩ t ≡ u ∷ A / [A] → Γ ⊩⟨ l ⟩ u ≡ t ∷ A / [A] symEqTerm (Uᵣ′ .⁰ 0<1 ⊢Γ) (Uₜ₌ A B d d′ typeA typeB A≡B [A] [B] [A≡B]) = Uₜ₌ B A d′ d typeB typeA (≅ₜ-sym A≡B) [B] [A] (symEq [A] [B] [A≡B]) symEqTerm (ℕᵣ D) (ιx (ℕₜ₌ k k′ d d′ t≡u prop)) = ιx (ℕₜ₌ k′ k d′ d (≅ₜ-sym t≡u) (symNatural-prop prop)) symEqTerm (ne′ K D neK K≡K) (ιx (neₜ₌ k m d d′ nf)) = ιx (neₜ₌ m k d′ d (symNeutralTerm nf)) symEqTerm (Πᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πₜ₌ f g d d′ funcF funcG f≡g [f] [g] [f≡g]) = Πₜ₌ g f d′ d funcG funcF (≅ₜ-sym f≡g) [g] [f] (λ ρ ⊢Δ [a] → symEqTerm ([G] ρ ⊢Δ [a]) ([f≡g] ρ ⊢Δ [a])) symEqTerm (emb′ 0<1 x) (ιx t≡u) = ιx (symEqTerm x t≡u)
data/pokemon/dex_entries/snubbull.asm
AtmaBuster/pokeplat-gen2
6
338
<reponame>AtmaBuster/pokeplat-gen2 db "FAIRY@" ; species name db "In truth, it is a" next "cowardly #MON." next "It growls eagerly" page "in order to hide" next "its fear from its" next "opponent.@"
software/modules/controller.adb
TUM-EI-RCS/StratoX
12
27017
with PX4IO.Driver; with Servo; with Generic_PID_Controller; with Logger; with Profiler; with Config.Software; use Config.Software; --with Units.Numerics; use Units.Numerics; with Ada.Numerics.Elementary_Functions; with Bounded_Image; use Bounded_Image; with Interfaces; use Interfaces; with ULog; with Types; use Types; with Ada.Real_Time; use Ada.Real_Time; pragma Elaborate_All(Ada.Real_Time); with Helper; package body Controller with SPARK_Mode is -------------------- -- TYPES -------------------- type Logger_Call_Type is mod Config.Software.CFG_LOGGER_CALL_SKIP with Default_Value => 0; type Control_Mode_T is (MODE_UNKNOWN, MODE_POSHOLD, -- impossible to perform homing...holding position MODE_HOMING, -- currently steering towards home MODE_COURSEHOLD, -- temporarily lost navigation; hold last known course MODE_ARRIVED); -- close enough to home type State_Type is record -- logging info logger_calls : Logger_Call_Type; logger_console_calls : Logger_Call_Type; control_profiler : Profiler.Profile_Tag; detach_animation_time : Time_Type := 0.0 * Second; -- homimg information: once_had_my_pos : Boolean := False; distance_to_home : Length_Type := 0.0 * Meter; course_to_home : Yaw_Type := 0.0 * Degree; controller_mode : Control_Mode_T := MODE_UNKNOWN; end record; -------------------- -- STATES -------------------- package Pitch_PID_Controller is new Generic_PID_Controller(Angle_Type, Elevator_Angle_Type, Unit_Type, -50.0*Degree, 50.0*Degree, Elevator_Angle_Type'First, Elevator_Angle_Type'Last); PID_Pitch : Pitch_PID_Controller.Pid_Object; package Roll_PID_Controller is new Generic_PID_Controller(Angle_Type, Aileron_Angle_Type, Unit_Type, -50.0*Degree, 50.0*Degree, Aileron_Angle_Type'First, Aileron_Angle_Type'Last); PID_Roll : Roll_PID_Controller.Pid_Object; package Yaw_PID_Controller is new Generic_PID_Controller( Angle_Type, Roll_Type, Unit_Type, -50.0*Degree, 50.0*Degree, -Config.MAX_ROLL, Config.MAX_ROLL); PID_Yaw : Yaw_PID_Controller.Pid_Object; G_Object_Orientation : Orientation_Type := (0.0 * Degree, 0.0 * Degree, 0.0 * Degree); G_Object_Position : GPS_Loacation_Type := (0.0 * Degree, 0.0 * Degree, 0.0 * Meter); G_Target_Position : GPS_Loacation_Type := (0.0 * Degree, 0.0 * Degree, 0.0 * Meter); G_Target_Orientation : Orientation_Type := (0.0 * Degree, Config.TARGET_PITCH, 0.0 * Degree); G_Target_Orientation_Prev : Orientation_Type := G_Target_Orientation; G_state : State_Type; G_Last_Pitch_Control : Ada.Real_Time.Time := Ada.Real_Time.Clock; G_Last_Roll_Control : Ada.Real_Time.Time := Ada.Real_Time.Clock; G_Last_Yaw_Control : Ada.Real_Time.Time := Ada.Real_Time.Clock; G_Plane_Control : Plane_Control_Type := (others => 0.0 * Degree); G_Elevon_Angles : Elevon_Angle_Array := (others => 0.0 * Degree); -------------------- -- PROTOTYPES -------------------- procedure Limit_Target_Attitude with Inline, Global => (In_Out => (G_Target_Orientation)); function Have_My_Position return Boolean with Global => (Input => G_Object_Position); function Have_Home_Position return Boolean with Global => (Input => G_Target_Position); function Have_Course return Boolean is ( Have_Home_Position and (G_state.once_had_my_pos or Have_My_Position) ); function FR_poshold_iff_no_course return Boolean is ( (Have_Course and G_state.controller_mode /= MODE_POSHOLD) or (not Have_Course and G_state.controller_mode = MODE_POSHOLD) ) with Ghost; --Contract_Cases => ((Have_Course and G_state.controller_mode /= MODE_POSHOLD) => FR_poshold_iff_no_course'Result, -- (not Have_Course and G_state.controller_mode = MODE_POSHOLD) => FR_poshold_iff_no_course'Result); function FR_arrive_iff_near_target return Boolean is ( if (Have_Home_Position and Have_My_Position) then (G_state.distance_to_home < Config.TARGET_AREA_RADIUS and G_state.controller_mode = MODE_ARRIVED) or (G_state.distance_to_home >= Config.TARGET_AREA_RADIUS and G_state.distance_to_home <= 2.0*Config.TARGET_AREA_RADIUS) or (G_state.distance_to_home > 2.0*Config.TARGET_AREA_RADIUS and G_state.controller_mode /= MODE_ARRIVED) else True ) with Ghost; -- Contract_Cases => ((Have_Home_Position and Have_My_Position and G_state.distance_to_home < Config.TARGET_AREA_RADIUS and G_state.controller_mode = MODE_ARRIVED) => FR_arrive_iff_near_target'Result, -- (Have_Home_Position and Have_My_Position and G_state.distance_to_home >= Config.TARGET_AREA_RADIUS and G_state.distance_to_home <= 2.0*Config.TARGET_AREA_RADIUS) => FR_arrive_iff_near_target'Result, -- (Have_Home_Position and Have_My_Position and G_state.distance_to_home > 2.0*Config.TARGET_AREA_RADIUS and G_state.controller_mode /= MODE_ARRIVED) => FR_arrive_iff_near_target'Result, -- others => FR_arrive_iff_near_target'Result ); -- Pre => G_state.distance_to_home >= 0.1*Meter and G_state.distance_to_home < 100.0*Kilo*Meter; procedure Update_Homing with Global => (Input => (G_Object_Position, G_Target_Position), In_Out => (G_state)), Depends => (G_state => (G_state, G_Object_Position, G_Target_Position)), Contract_Cases => ( --Have_Course => G_state.controller_mode /= MODE_POSHOLD, not Have_Course => G_state.controller_mode = MODE_POSHOLD, (Have_Home_Position and Have_My_Position and Distance (G_Object_Position, G_Target_Position) < Config.TARGET_AREA_RADIUS) => G_state.controller_mode = MODE_ARRIVED, (Have_Home_Position and Have_My_Position and Distance (G_Object_Position, G_Target_Position) > 2.0*Config.TARGET_AREA_RADIUS) => G_state.controller_mode = MODE_HOMING, (Have_Home_Position and not Have_My_Position and G_state.once_had_my_pos) => G_state.controller_mode = MODE_COURSEHOLD ), Post => G_state.controller_mode /= MODE_UNKNOWN and FR_arrive_iff_near_target and FR_poshold_iff_no_course; -- update distance and bearing to home coordinate, and decide what to do procedure Compute_Target_Attitude with Global => (Input => (G_state, G_Object_Orientation, Ada.Real_Time.Clock_Time, G_Target_Position), In_Out => (G_Last_Yaw_Control, PID_Yaw, G_Target_Orientation_Prev, G_Target_Orientation), Output => null ), -- Depends => (G_Last_Yaw_Control => (G_Last_Yaw_Control, G_state, Ada.Real_Time.Clock_Time), -- G_Target_Orientation => (G_state, PID_Yaw, G_Object_Orientation, G_Target_Orientation_Prev, -- G_Last_Yaw_Control, Ada.Real_Time.Clock_Time), -- PID_Yaw => (PID_Yaw, G_Object_Orientation, G_Last_Yaw_Control, G_Target_Orientation_Prev, -- G_state, Ada.Real_Time.Clock_Time), -- G_Target_Orientation_Prev => (G_Target_Orientation_Prev, G_state, PID_Yaw, -- Ada.Real_Time.Clock_Time, G_Object_Orientation, G_Last_Yaw_Control)), Contract_Cases => ((G_state.controller_mode = MODE_COURSEHOLD) => G_Target_Orientation.Yaw = G_Target_Orientation_Prev.Yaw, (G_state.controller_mode = MODE_HOMING) => G_Target_Orientation.Yaw = G_state.course_to_home, (G_state.controller_mode not in MODE_HOMING | MODE_COURSEHOLD) => G_Target_Orientation.Yaw = G_Object_Orientation.Yaw, others => True), Post => G_Target_Orientation_Prev = G_Target_Orientation; -- decide vehicle attitude depending on mode -- contract seems extensive, but it enforces that the attitude is always updated, and that -- homing works. ---------------- -- initialize ---------------- procedure initialize is begin Servo.initialize; Pitch_PID_Controller.initialize(PID_Pitch, Unit_Type( Config.Software.CFG_PID_PITCH_P ), Unit_Type( Config.Software.CFG_PID_PITCH_I ), Unit_Type( Config.Software.CFG_PID_PITCH_D )); Roll_PID_Controller.initialize(PID_Roll, Unit_Type( Config.Software.CFG_PID_ROLL_P ), Unit_Type( Config.Software.CFG_PID_ROLL_I ), Unit_Type( Config.Software.CFG_PID_ROLL_D )); Yaw_PID_Controller.initialize(PID_Yaw, Unit_Type( Config.Software.CFG_PID_YAW_P ), Unit_Type( Config.Software.CFG_PID_YAW_I ), Unit_Type( Config.Software.CFG_PID_YAW_D )); G_state.control_profiler.init("Control"); Logger.log_console(Logger.DEBUG, "Controller initialized"); end initialize; -------------- -- activate -------------- procedure activate is begin Servo.activate; end activate; ---------------- -- deactivate ---------------- procedure deactivate is begin Servo.deactivate; end deactivate; -------------------------- -- set_Current_Position -------------------------- procedure set_Current_Position(location : GPS_Loacation_Type) is begin G_Object_Position := location; end set_Current_Position; ------------------------- -- set_Target_Position ------------------------- procedure set_Target_Position (location : GPS_Loacation_Type) is begin G_Target_Position := location; Logger.log (Logger.SENSOR, "Home=" & Integer_Img ( Integer (100000.0 * To_Degree (G_Target_Position.Latitude))) & ", " & Integer_Img ( Integer (100000.0 * To_Degree (G_Target_Position.Longitude))) & ", " & Integer_Img ( Sat_Cast_Int ( Float (G_Target_Position.Altitude)))); end set_Target_Position; ----------------------------- -- set_Current_Orientation ----------------------------- procedure set_Current_Orientation (orientation : Orientation_Type) is begin G_Object_Orientation := orientation; end set_Current_Orientation; -------------- -- log_Info -------------- procedure log_Info is controller_msg : ULog.Message (Typ => ULog.CONTROLLER); nav_msg : ULog.Message (Typ => ULog.NAV); now : constant Ada.Real_Time.Time := Ada.Real_Time.Clock; function Sat_Sub_Alt is new Saturated_Subtraction (Altitude_Type); begin G_state.logger_console_calls := Logger_Call_Type'Succ( G_state.logger_console_calls ); if G_state.logger_console_calls = 0 then Logger.log_console(Logger.DEBUG, "Pos " & AImage( G_Object_Position.Longitude ) & ", " & AImage( G_Object_Position.Latitude ) & ", " & Image( G_Object_Position.Altitude ) & ", d=" & Integer_Img (Sat_Cast_Int ( Float (G_state.distance_to_home))) & ", crs=" & AImage (G_state.course_to_home)); Logger.log_console(Logger.DEBUG, "TY: " & AImage( G_Target_Orientation.Yaw ) & ", TR: " & AImage( G_Target_Orientation.Roll ) & " Elev: " & AImage( G_Elevon_Angles(LEFT) ) & ", " & AImage( G_Elevon_Angles(RIGHT) ) ); end if; -- log to SD controller_msg := ( Typ => ULog.CONTROLLER, t => now, target_yaw => Float (G_Target_Orientation.Yaw), target_roll => Float (G_Target_Orientation.Roll), target_pitch => Float (G_Target_Orientation.Pitch), elevon_left => Float (G_Elevon_Angles(LEFT)), elevon_right => Float (G_Elevon_Angles(RIGHT)), ctrl_mode => Unsigned_8 (Control_Mode_T'Pos (G_state.controller_mode))); nav_msg := ( Typ => ULog.NAV, t=> now, home_dist => Float (G_state.distance_to_home), home_course => Float (G_state.course_to_home), home_altdiff => Float (Sat_Sub_Alt (G_Object_Position.Altitude, G_Target_Position.Altitude))); Logger.log_sd (Logger.INFO, controller_msg); Logger.log_sd (Logger.SENSOR, nav_msg); end log_Info; -------------- -- set_hold -------------- procedure set_hold is begin -- hold glider in position Servo.Set_Critical_Angle (Servo.LEFT_ELEVON, 38.0 * Degree ); Servo.Set_Critical_Angle (Servo.RIGHT_ELEVON, 38.0 * Degree ); end set_hold; ---------------- -- set_detach ---------------- procedure set_detach is begin Servo.Set_Critical_Angle (Servo.LEFT_ELEVON, -40.0 * Degree ); Servo.Set_Critical_Angle (Servo.RIGHT_ELEVON, -40.0 * Degree ); end set_detach; ---------- -- sync ---------- procedure sync is begin PX4IO.Driver.sync_Outputs; end sync; ---------- -- bark ---------- procedure bark is angle : constant Servo.Servo_Angle_Type := 35.0 * Degree; begin for k in Integer range 1 .. 20 loop Servo.set_Angle(Servo.LEFT_ELEVON, angle); Servo.set_Angle(Servo.RIGHT_ELEVON, angle); PX4IO.Driver.sync_Outputs; Helper.delay_ms( 10 ); end loop; for k in Integer range 1 .. 20 loop Servo.set_Angle(Servo.LEFT_ELEVON, angle+3.0*Degree); Servo.set_Angle(Servo.RIGHT_ELEVON, angle+3.0*Degree); PX4IO.Driver.sync_Outputs; Helper.delay_ms( 10 ); end loop; end bark; ------------------ -- control_Roll ------------------ procedure control_Roll is error : constant Angle_Type := (G_Target_Orientation.Roll - G_Object_Orientation.Roll); now : constant Ada.Real_Time.Time := Ada.Real_Time.Clock; dt : constant Time_Type := Time_Type (Float((now - G_Last_Roll_Control) / Ada.Real_Time.Milliseconds(1)) * 1.0e-3); begin G_Last_Roll_Control := now; Roll_PID_Controller.step (PID_Roll, error, dt, G_Plane_Control.Aileron); end control_Roll; ------------------- -- control_Pitch ------------------- procedure control_Pitch is error : constant Angle_Type := (G_Target_Orientation.Pitch - G_Object_Orientation.Pitch); now : constant Ada.Real_Time.Time := Ada.Real_Time.Clock; dt : constant Time_Type := Time_Type (Float((now - G_Last_Pitch_Control) / Ada.Real_Time.Milliseconds(1)) * 1.0e-3); begin G_Last_Pitch_Control := now; Pitch_PID_Controller.step (PID_Pitch, error, dt, G_Plane_Control.Elevator); end control_Pitch; ------------------------ -- Have_Home_Position ------------------------ function Have_Home_Position return Boolean is begin return G_Target_Position.Longitude /= 0.0 * Degree and G_Target_Position.Latitude /= 0.0 * Degree; end Have_Home_Position; ---------------------- -- Have_My_Position ---------------------- function Have_My_Position return Boolean is begin return G_Object_Position.Longitude /= 0.0 * Degree and G_Object_Position.Latitude /= 0.0 * Degree; end Have_My_Position; ------------------- -- Update_Homing ------------------- procedure Update_Homing is have_my_pos : constant Boolean := Have_My_Position; have_home_pos : constant Boolean := Have_Home_Position; begin G_state.once_had_my_pos := G_state.once_had_my_pos or have_my_pos; if have_my_pos and then have_home_pos then -- compute relative location to target G_state.distance_to_home := Distance (G_Object_Position, G_Target_Position); G_state.course_to_home := Yaw_Type (Bearing (G_Object_Position, G_Target_Position)); -- pos hold or homing, depending on distance if G_state.distance_to_home < Config.TARGET_AREA_RADIUS then -- we are at home G_state.controller_mode := MODE_ARRIVED; else -- some distance to target if G_state.controller_mode = MODE_ARRIVED then -- hysteresis if we already had arrived if G_state.distance_to_home > 2.0*Config.TARGET_AREA_RADIUS then G_state.controller_mode := MODE_HOMING; else G_state.controller_mode := MODE_ARRIVED; end if; else -- otherwise immediate homing G_state.controller_mode := MODE_HOMING; end if; end if; elsif have_home_pos and then (not have_my_pos and G_state.once_had_my_pos) then -- temporarily don't have my position => keep old bearing G_state.controller_mode := MODE_COURSEHOLD; else pragma Assert (not have_home_pos or not G_state.once_had_my_pos); -- don't know where to go => hold position G_state.controller_mode := MODE_POSHOLD; end if; end Update_Homing; ----------------------------- -- Compute_Target_Attitude ----------------------------- procedure Compute_Target_Attitude is error : Angle_Type; now : constant Ada.Real_Time.Time := Ada.Real_Time.Clock; dt : constant Time_Type := Time_Type (Float ((now - G_Last_Yaw_Control) / Ada.Real_Time.Milliseconds(1)) * 1.0e-3); begin ------------ -- Pitch ------------ -- we cannot afford a (fail-safe) airspeed sensor, thus we rely on the polar: -- assuming that a certain pitch angle results in stable flight G_Target_Orientation.Pitch := Config.TARGET_PITCH; pragma Assert (G_Target_Orientation.Pitch < 0.0 * Degree); -- as long as this is constant, assert nose down --------------- -- Roll, Yaw --------------- case G_state.controller_mode is when MODE_UNKNOWN | MODE_POSHOLD => -- circle right when we have no target G_Target_Orientation.Roll := -Config.CIRCLE_TRAJECTORY_ROLL; G_Target_Orientation.Yaw := G_Object_Orientation.Yaw; when MODE_HOMING | MODE_COURSEHOLD => -- control yaw by setting roll if G_state.controller_mode = MODE_HOMING then G_Target_Orientation.Yaw := G_state.course_to_home; else G_Target_Orientation.Yaw := G_Target_Orientation_Prev.Yaw; end if; error := delta_Angle (G_Object_Orientation.Yaw, G_Target_Orientation.Yaw); Yaw_PID_Controller.step (PID_Yaw, error, dt, G_Target_Orientation.Roll); G_Last_Yaw_Control := now; when MODE_ARRIVED => -- circle left when we are there G_Target_Orientation.Roll := Config.CIRCLE_TRAJECTORY_ROLL; G_Target_Orientation.Yaw := G_Object_Orientation.Yaw; end case; G_Target_Orientation_Prev := G_Target_Orientation; end Compute_Target_Attitude; ------------------ -- Elevon_Angles ------------------ function Elevon_Angles( elevator : Elevator_Angle_Type; aileron : Aileron_Angle_Type; priority : Control_Priority_Type ) return Elevon_Angle_Array is balance : Float range 0.0 .. 2.0;-- := 1.0; scale : Float range 0.0 .. 1.0 := 1.0; balanced_elevator : Elevator_Angle_Type; balanced_aileron : Aileron_Angle_Type; begin -- dynamic sharing of rudder angles between elevator and ailerons case (priority) is when EQUAL => balance := 1.0; when PITCH_FIRST => balance := 1.3; when ROLL_FIRST => balance := 0.7; end case; balanced_elevator := Elevator_Angle_Type( Helper.Saturate( Float(elevator) * balance, Float(Elevator_Angle_Type'First), Float(Elevator_Angle_Type'Last)) ); balanced_aileron := Aileron_Angle_Type( Helper.Saturate( Float(aileron) * (2.0 - balance), Float(Aileron_Angle_Type'First), Float(Aileron_Angle_Type'Last)) ); -- scaling (only if necessary) if abs(balanced_elevator) + abs(balanced_aileron) > Elevon_Angle_Type'Last then scale := 0.95 * Float(Elevon_Angle_Type'Last) / ( abs(Float(balanced_elevator)) + abs(Float(balanced_aileron)) ); end if; -- mixing return (LEFT => (balanced_elevator - balanced_aileron) * Unit_Type(scale), RIGHT => (balanced_elevator + balanced_aileron) * Unit_Type(scale)); end Elevon_Angles; --------------------------- -- Limit_Target_Attitude --------------------------- procedure Limit_Target_Attitude is function Sat_Pitch is new Saturate (Pitch_Type); function Sat_Roll is new Saturate (Roll_Type); begin G_Target_Orientation.Roll := Sat_Roll (val => G_Target_Orientation.Roll, min => -Config.MAX_ROLL, max => Config.MAX_ROLL); G_Target_Orientation.Pitch := Sat_Pitch (val => G_Target_Orientation.Pitch, min => -Config.MAX_PITCH, max => Config.MAX_PITCH); end Limit_Target_Attitude; ----------------- -- runOneCycle ----------------- procedure runOneCycle is Control_Priority : Control_Priority_Type := EQUAL; oldmode : constant Control_Mode_T := G_state.controller_mode; begin Update_Homing; if G_state.controller_mode /= oldmode then Logger.log_console (Logger.DEBUG, "Homing mode=" & Unsigned8_Img (Control_Mode_T'Pos (G_state.controller_mode))); end if; Compute_Target_Attitude; -- TEST: overwrite roll with a fixed value -- G_Target_Orientation.Roll := Config.CIRCLE_TRAJECTORY_ROLL; -- TEST: Omakurve -- evelope protection Limit_Target_Attitude; -- compute elevon position if not Config.Software.TEST_MODE_ACTIVE then control_Pitch; control_Roll; else -- fake elevon waving for ground tests G_Plane_Control.Elevator := Elevator_Angle_Type (0.0); declare now : constant Ada.Real_Time.Time := Ada.Real_Time.Clock; t_abs : constant Time_Type := Units.To_Time (now); sinval : constant Unit_Type := Unit_Type (Ada.Numerics.Elementary_Functions.Sin (2.0 * Float (t_abs))); pragma Assume (sinval in -1.0 .. 1.0); FAKE_ROLL_MAGNITUDE : constant Angle_Type := 20.0 * Degree; begin G_Plane_Control.Aileron := FAKE_ROLL_MAGNITUDE * sinval; end; end if; G_state.control_profiler.start; -- mix if abs( G_Object_Orientation.Roll ) > CFG_CONTROLL_UNSTABLE_ROLL_THRESHOLD then Control_Priority := ROLL_FIRST; end if; if abs( G_Object_Orientation.Pitch ) > CFG_CONTROLL_UNSTABLE_PITCH_THRESHOLD then Control_Priority := PITCH_FIRST; end if; G_Elevon_Angles := Elevon_Angles(G_Plane_Control.Elevator, G_Plane_Control.Aileron, Control_Priority); -- set servos Servo.set_Angle(Servo.LEFT_ELEVON, G_Elevon_Angles(LEFT) ); Servo.set_Angle(Servo.RIGHT_ELEVON, G_Elevon_Angles(RIGHT) ); -- Output PX4IO.Driver.sync_Outputs; G_state.control_profiler.stop; -- log G_state.logger_calls := Logger_Call_Type'Succ( G_state.logger_calls ); if G_state.logger_calls = 0 then log_Info; end if; end runOneCycle; ---------------- -- get_Elevons ---------------- function get_Elevons return Elevon_Angle_Array is begin return G_Elevon_Angles; end get_Elevons; end Controller;
oeis/315/A315020.asm
neoneye/loda-programs
11
87592
<reponame>neoneye/loda-programs ; A315020: Coordination sequence Gal.4.76.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; Submitted by <NAME> ; 1,5,9,15,19,23,29,33,38,43,47,53,57,61,67,71,76,81,85,91,95,99,105,109,114,119,123,129,133,137,143,147,152,157,161,167,171,175,181,185,190,195,199,205,209,213,219,223,228,233 mov $2,$0 mul $0,3 add $0,2 mov $3,4 lpb $0 sub $0,5 trn $0,$3 add $1,$0 trn $0,1 add $1,1 sub $1,$0 mov $3,2 lpe lpb $2 add $1,4 sub $2,1 lpe mov $0,$1
test/Fail/Issue413.agda
cruhland/agda
1,989
1750
<reponame>cruhland/agda module Issue413 where data Bool : Set where data ℕ : Set where zero : ℕ data Type : (A : Set) → Set where isBool : Type Bool isℕ : Type ℕ g : (A : Set) → Type A → Type A → ℕ g .Bool isBool isBool = zero
projects/batfish/src/main/antlr4/org/batfish/vendor/a10/grammar/A10Lexer.g4
jeffkala/batfish
0
5836
<filename>projects/batfish/src/main/antlr4/org/batfish/vendor/a10/grammar/A10Lexer.g4 lexer grammar A10Lexer; options { superClass = 'A10BaseLexer'; } tokens { QUOTED_TEXT, RBA_LINE, RBA_TAIL, WORD, WORD_SEPARATOR } // A10 keywords ACCESS_LIST : 'access-list' { if (lastTokenType() == IP) { pushMode(M_Word); } } ; ACTIVATE: 'activate'; ACTIVE: 'active'; ADDRESS: 'address'; AFLEX: 'aflex' -> pushMode(M_Word); ANY: 'any'; ARP_RETRY: 'arp-retry'; AUTO: 'auto'; BFD: 'bfd'; BGP: 'bgp'; BLADE_PARAMETERS: 'blade-parameters'; BOTH: 'both'; BUCKET_COUNT: 'bucket-count'; CACHE: 'cache'; CAPABILITY: 'capability'; CHECK: 'check'; CIPHER: 'cipher'; CLIENT_SSL: 'client-ssl'; COMMON: 'common'; COMPOUND : 'compound' { if (lastTokenType() == METHOD) { pushMode(M_Words); } } ; CONN_LIMIT: 'conn-limit'; CONN_MIRROR: 'conn-mirror'; CONNECTED: 'connected'; CONNECTION_REUSE: 'connection-reuse'; COOKIE: 'cookie'; CPU_PROCESS: 'cpu-process'; DATABASE : 'database' { if (lastTokenType() == METHOD) { pushMode(M_Words); } } ; DEAD_TIMER: 'dead-timer'; DEF_SELECTION_IF_PREF_FAILED: 'def-selection-if-pref-failed'; DEFAULT: 'default'; DENY: 'deny'; DESCRIPTION: 'description' -> pushMode(M_Word); DESTINATION_IP: 'destination-ip'; DEVICE_ID: 'device-id'; DIAMETER: 'diameter'; DISABLE: 'disable'; DISABLE_DEFAULT_VRID: 'disable-default-vrid'; DNS: 'dns'; DO_AUTO_RECOVERY: 'do-auto-recovery'; DUPLEXITY: 'duplexity'; DYNAMIC: 'dynamic'; DYNAMIC_SERVICE: 'dynamic-service'; HA: 'ha'; ENABLE: 'enable'; ETHERNET: 'ethernet'; EXPECT: 'expect'; EXTENDED: 'extended'; EXTENDED_STATS: 'extended-stats'; EXTERNAL : 'external' { if (lastTokenType() == METHOD) { pushMode(M_Words); } } ; FAIL_OVER_POLICY_TEMPLATE: 'fail-over-policy-template' -> pushMode(M_Word); FALL_OVER: 'fall-over'; FAST_EXTERNAL_FAILOVER: 'fast-external-failover'; FLOATING_IP: 'floating-ip'; FTP: 'ftp'; GATEWAY: 'gateway'; GET_READY_TIME: 'get-ready-time'; GET_READY_TIME_ACOS2: 'get_ready_time'; GLOBAL: 'global'; GRACEFUL_RESTART: 'graceful-restart'; GROUP: 'group'; HELLO_INTERVAL: 'hello-interval'; HA_GROUP: 'ha-group'; HA_GROUP_ID: 'ha-group-id'; HALFOPEN: 'halfopen'; HEALTH: 'health'; HEALTH_CHECK: 'health-check' -> pushMode(M_Word); HEALTH_CHECK_DISABLE: 'health-check-disable'; HOST: 'host'; HOSTNAME: 'hostname' -> pushMode(M_Word); HTTP : 'http' { if (lastTokenType() == METHOD) { pushMode(M_Words); } } ; HTTPS : 'https' { if (lastTokenType() == METHOD) { pushMode(M_Words); } } ; ICMP: 'icmp'; ID: 'id'; IN: 'in'; INTERVAL: 'interval'; IMAP: 'imap'; IP: 'ip'; IP_NAT: 'ip-nat'; IP_RR: 'ip-rr'; IPG_BIT_TIME: 'ipg-bit-time'; INBOUND: 'inbound'; INTERFACE: 'interface'; KERBEROS_KDC: 'kerberos-kdc'; LACP: 'lacp'; LACP_TRUNK: 'lacp-trunk'; LACP_UDLD: 'lacp-udld'; LDAP : 'ldap' { if (lastTokenType() == METHOD) { pushMode(M_Words); } } ; LEAST_CONNECTION: 'least-connection'; LEAST_REQUEST: 'least-request'; LLDP: 'lldp'; LOAD_INTERVAL: 'load-interval'; LOCAL_PREFERENCE: 'local-preference'; LOG_NEIGHBOR_CHANGES: 'log-neighbor-changes'; LONG: 'long'; LOOPBACK: 'loopback'; MAXIMUM_PATHS: 'maximum-paths'; MAXIMUM_PREFIX: 'maximum-prefix'; MEMBER: 'member' -> pushMode(M_Word); METHOD: 'method'; MIN_ACTIVE_MEMBER: 'min-active-member'; MODE: 'mode'; MONITOR : 'monitor' { if (lastTokenType() == HEALTH) { pushMode(M_Word); } } ; MTU: 'mtu'; NAME: 'name' -> pushMode(M_Word); NAT: 'nat'; NEIGHBOR: 'neighbor'; NETMASK: 'netmask'; NEXTHOP_TRIGGER_COUNT: 'nexthop-trigger-count'; NO: 'no'; NO_AUTO_UP_ON_AFLEX: 'no-auto-up-on-aflex'; NO_HEARTBEAT: 'no-heartbeat'; NONE: 'none'; NOTIFICATION: 'notification'; NTP: 'ntp'; ONLY_FLAGGED: 'only-flagged'; ONLY_NOT_FLAGGED: 'only-not-flagged'; OPTIMIZATION_LEVEL: 'optimization-level'; ORF: 'orf'; OVERRIDE_PORT: 'override-port'; PARTITION: 'partition' -> pushMode(M_Word); PASSIVE: 'passive'; PEER: 'peer'; PEER_GROUP: 'peer-group'; PERMIT: 'permit'; PERSIST: 'persist'; PERSIST_SCORING: 'persist-scoring'; POLICY: 'policy'; POOL: 'pool' -> pushMode(M_Word); POP3: 'pop3'; PORT : 'port' { if (lastTokenType() == TEMPLATE) { pushMode(M_Word); } } ; PORT_OVERLOAD: 'port-overload'; PORTS_THRESHOLD: 'ports-threshold'; PREEMPT_MODE: 'preempt-mode'; PREEMPTION_DELAY: 'preemption-delay'; PREEMPTION_ENABLE: 'preemption-enable'; PRIORITY: 'priority'; PRIORITY_COST: 'priority-cost'; RADIUS : 'radius' { if (lastTokenType() == METHOD) { pushMode(M_Words); } } ; RANGE: 'range'; RBA: 'rba' -> pushMode(M_Rba); RESTART_TIME: 'restart-time'; REDISTRIBUTE: 'redistribute'; REDISTRIBUTION_FLAGGED: 'redistribution-flagged'; REMOTE_AS: 'remote-as'; RETRY: 'retry'; ROLE: 'role'; ROUND_ROBIN: 'round-robin'; ROUND_ROBIN_STRICT: 'round-robin-strict'; ROUTE: 'route'; ROUTE_REFRESH: 'route-refresh'; ROUTER: 'router'; ROUTER_ID: 'router-id'; ROUTER_INTERFACE: 'router-interface'; RTSP: 'rtsp'; RX: 'rx'; SCALEOUT_DEVICE_ID: 'scaleout-device-id'; SCAN_TIME: 'scan-time'; SEND_COMMUNITY: 'send-community'; SERVER : 'server' { if (lastTokenType() == SLB) { pushMode(M_Word); } } ; SERVER_INTERFACE: 'server-interface'; SERVER_SSL: 'server-ssl'; SERVICE_GROUP: 'service-group' -> pushMode(M_Word); SERVICE_LEAST_CONNECTION: 'service-least-connection'; SESSION_SYNC: 'session-sync'; SET_ID: 'set-id'; SHORT: 'short'; SIP: 'sip'; SLB: 'slb'; SMTP: 'smtp'; SNMP: 'snmp'; SOFT_RECONFIGURATION: 'soft-reconfiguration'; SOURCE_IP: 'source-ip'; SOURCE_NAT: 'source-nat'; SPEED: 'speed'; SSL_CIPHERS: 'ssl-ciphers' -> pushMode(M_Word); SSL_PROXY: 'ssl-proxy'; STANDARD: 'standard'; STATIC: 'static'; STATS_DATA_DISABLE: 'stats-data-disable'; STATS_DATA_ENABLE: 'stats-data-enable'; SYNCHRONIZATION: 'synchronization'; TACPLUS: 'tacplus'; TAGGED: 'tagged'; TCP: 'tcp'; TCP_PROXY: 'tcp-proxy'; TEMPLATE: 'template' -> pushMode(M_Template); THRESHOLD: 'threshold'; TIME_INTERVAL: 'time-interval'; TIMEOUT: 'timeout'; TIMEOUT_RETRY_COUNT: 'timeout-retry-count'; TIMER: 'timer'; TIMERS: 'timers'; TO: 'to'; TRACK_EVENT_DELAY: 'track-event-delay'; TRUNK: 'trunk'; TRUNK_GROUP: 'trunk-group'; TX: 'tx'; UDP: 'udp'; UNTAGGED: 'untagged'; UP_RETRY: 'up-retry'; UPDATE_SOURCE: 'update-source'; URL: 'url'; USE_RCV_HOP_FOR_RESP: 'use-rcv-hop-for-resp'; USER_TAG: 'user-tag' -> pushMode(M_Word); VE: 've'; VIP: 'vip'; VIRTUAL_PORT: 'virtual-port'; VIRTUAL_SERVER: 'virtual-server' -> pushMode(M_Word); VLAN: 'vlan'; VRID: 'vrid'; VRID_LEAD: 'vrid-lead' -> pushMode(M_Word); VRRP_A: 'vrrp-a'; WAF: 'waf'; WEIGHT: 'weight'; // Complex tokens COMMENT_LINE : F_Whitespace* '!' {lastTokenType() == NEWLINE || lastTokenType() == -1}? F_NonNewlineChar* (F_Newline | EOF) -> skip ; DOUBLE_QUOTE : '"' -> pushMode ( M_DoubleQuote ) ; SINGLE_QUOTE : ['] -> pushMode ( M_SingleQuote ) ; SUBNET_MASK: F_SubnetMask; IP_ADDRESS: F_IpAddress; IP_SLASH_PREFIX: F_IpSlashPrefix; IPV6_ADDRESS: F_Ipv6Address; NEWLINE: F_Newline; UINT8: F_Uint8; UINT16: F_Uint16; UINT32: F_Uint32; WS: F_Whitespace+ -> skip; // Fragments fragment F_DecByte : F_Digit | F_PositiveDigit F_Digit | '1' F_Digit F_Digit | '2' [0-4] F_Digit | '25' [0-5] ; fragment F_Digit: [0-9]; fragment F_HexDigit : [0-9A-Fa-f] ; fragment F_HexWord : F_HexDigit F_HexDigit? F_HexDigit? F_HexDigit? ; fragment F_HexWord2 : F_HexWord ':' F_HexWord ; fragment F_HexWord3 : F_HexWord2 ':' F_HexWord ; fragment F_HexWord4 : F_HexWord3 ':' F_HexWord ; fragment F_HexWord5 : F_HexWord4 ':' F_HexWord ; fragment F_HexWord6 : F_HexWord5 ':' F_HexWord ; fragment F_HexWord7 : F_HexWord6 ':' F_HexWord ; fragment F_HexWord8 : F_HexWord6 ':' F_HexWordFinal2 ; fragment F_HexWordFinal2 : F_HexWord2 | F_IpAddress ; fragment F_HexWordFinal3 : F_HexWord ':' F_HexWordFinal2 ; fragment F_HexWordFinal4 : F_HexWord ':' F_HexWordFinal3 ; fragment F_HexWordFinal5 : F_HexWord ':' F_HexWordFinal4 ; fragment F_HexWordFinal6 : F_HexWord ':' F_HexWordFinal5 ; fragment F_HexWordFinal7 : F_HexWord ':' F_HexWordFinal6 ; fragment F_HexWordLE1 : F_HexWord? ; fragment F_HexWordLE2 : F_HexWordLE1 | F_HexWordFinal2 ; fragment F_HexWordLE3 : F_HexWordLE2 | F_HexWordFinal3 ; fragment F_HexWordLE4 : F_HexWordLE3 | F_HexWordFinal4 ; fragment F_HexWordLE5 : F_HexWordLE4 | F_HexWordFinal5 ; fragment F_HexWordLE6 : F_HexWordLE5 | F_HexWordFinal6 ; fragment F_HexWordLE7 : F_HexWordLE6 | F_HexWordFinal7 ; fragment F_IpAddress: F_DecByte '.' F_DecByte '.' F_DecByte '.' F_DecByte; fragment F_IpSlashPrefix: '/' F_IpPrefixLength; fragment F_IpPrefixLength : F_Digit | [12] F_Digit | [3] [012] ; fragment F_Ipv6Address : '::' F_HexWordLE7 | F_HexWord '::' F_HexWordLE6 | F_HexWord2 '::' F_HexWordLE5 | F_HexWord3 '::' F_HexWordLE4 | F_HexWord4 '::' F_HexWordLE3 | F_HexWord5 '::' F_HexWordLE2 | F_HexWord6 '::' F_HexWordLE1 | F_HexWord7 '::' | F_HexWord8 ; // Any number of newlines, allowing whitespace in between fragment F_Newline : F_NewlineChar (F_Whitespace* F_NewlineChar+)* ; // A single newline character [sequence - allowing \r, \r\n, or \n] fragment F_NewlineChar : '\r' '\n'? | '\n' ; fragment F_NonNewlineChar : ~[\r\n] // carriage return or line feed ; fragment F_PositiveDigit: [1-9]; fragment F_SubnetMask : F_SubnetMaskOctet '.0.0.0' | '255.' F_SubnetMaskOctet '.0.0' | '255.255.' F_SubnetMaskOctet '.0' | '255.255.255.' F_SubnetMaskOctet ; fragment F_SubnetMaskOctet : '0' | '128' | '192' | '224' | '240' | '248' | '252' | '254' | '255' ; fragment F_Uint8 : F_Digit | F_PositiveDigit F_Digit | '1' F_Digit F_Digit | '2' [0-4] F_Digit | '25' [0-5] ; fragment F_Uint16 : F_Digit | F_PositiveDigit F_Digit F_Digit? F_Digit? | [1-5] F_Digit F_Digit F_Digit F_Digit | '6' [0-4] F_Digit F_Digit F_Digit | '65' [0-4] F_Digit F_Digit | '655' [0-2] F_Digit | '6553' [0-5] ; fragment F_Uint32 : // 0-4294967295 F_Digit | F_PositiveDigit F_Digit F_Digit? F_Digit? F_Digit? F_Digit? F_Digit? F_Digit? F_Digit? | [1-3] F_Digit F_Digit F_Digit F_Digit F_Digit F_Digit F_Digit F_Digit F_Digit | '4' [0-1] F_Digit F_Digit F_Digit F_Digit F_Digit F_Digit F_Digit F_Digit | '42' [0-8] F_Digit F_Digit F_Digit F_Digit F_Digit F_Digit F_Digit | '429' [0-3] F_Digit F_Digit F_Digit F_Digit F_Digit F_Digit | '4294' [0-8] F_Digit F_Digit F_Digit F_Digit F_Digit | '42949' [0-5] F_Digit F_Digit F_Digit F_Digit | '429496' [0-6] F_Digit F_Digit F_Digit | '4294967' [0-1] F_Digit F_Digit | '42949672' [0-8] F_Digit | '429496729' [0-5] ; fragment F_Whitespace : [ \t\u000C] // tab or space or unicode 0x000C ; fragment F_NonWhitespace : ~[ \t\u000C\u00A0\n\r] ; fragment F_Word: F_WordChar+; fragment F_WordChar : [0-9A-Za-z!@#$%^&*()_=+.;:{}/<>\u2013] | '-' ; fragment F_StrChar: ~( [ \t\u000C\u00A0\n\r(),!$'"*#] | '[' | ']' ); fragment F_Str: F_StrChar+; fragment F_EscapedDoubleQuote: '\\"'; fragment F_EscapedSingleQuote: '\\' [']; // Modes mode M_DoubleQuote; M_DoubleQuote_DOUBLE_QUOTE: '"' -> type(DOUBLE_QUOTE), popMode; M_DoubleQuote_QUOTED_TEXT: (F_EscapedDoubleQuote | ~'"')+ -> type(QUOTED_TEXT); mode M_SingleQuote; M_SingleQuote_SINGLE_QUOTE: ['] -> type(SINGLE_QUOTE), popMode; M_SingleQuote_QUOTED_TEXT: (F_EscapedSingleQuote | ~['])+ -> type(QUOTED_TEXT); mode M_Word; M_Word_WS: F_Whitespace+ -> type(WORD_SEPARATOR), mode(M_WordValue); M_Word_NEWLINE: F_Newline -> type(NEWLINE), popMode; mode M_WordValue; M_WordValue_DOUBLE_QUOTE: '"' -> type(DOUBLE_QUOTE), pushMode(M_DoubleQuote); M_WordValue_SINGLE_QUOTE: ['] -> type(SINGLE_QUOTE), pushMode(M_SingleQuote); M_WordValue_WORD: F_Word -> type(WORD); M_WordValue_WS: F_Whitespace+ -> skip, popMode; M_WordValue_NEWLINE: F_Newline -> type(NEWLINE), popMode; mode M_Words; M_Words_WS: F_Whitespace+ -> type(WORD_SEPARATOR), mode(M_WordsValue); M_Words_NEWLINE: F_Newline -> type(NEWLINE), popMode; mode M_WordsValue; M_WordsValue_DOUBLE_QUOTE: '"' -> type(DOUBLE_QUOTE), pushMode(M_DoubleQuote); M_WordsValue_SINGLE_QUOTE: ['] -> type(SINGLE_QUOTE), pushMode(M_SingleQuote); M_WordsValue_WORD: F_Word -> type(WORD); M_WordsValue_WS: F_Whitespace+ -> type(WORD_SEPARATOR); M_WordsValue_NEWLINE: F_Newline -> type(NEWLINE), popMode; mode M_Rba; M_Rba_WS: F_Whitespace+ -> skip; M_Rba_ROLE: ROLE -> type(ROLE), mode(M_RbaRoleName); M_Rba_NEWLINE: F_Newline -> type(NEWLINE), mode(M_RbaLine); mode M_RbaRoleName; M_RbaRoleName_WS: F_Whitespace+ -> type(WORD_SEPARATOR), mode(M_RbaRoleNameValue); M_RbaRoleName_NEWLINE: F_Newline -> type(NEWLINE), popMode; mode M_RbaRoleNameValue; M_RbaRoleNameValue_DOUBLE_QUOTE: '"' -> type(DOUBLE_QUOTE), pushMode(M_DoubleQuote); M_RbaRoleNameValue_SINGLE_QUOTE: ['] -> type(SINGLE_QUOTE), pushMode(M_SingleQuote); M_RbaRoleNameValue_WORD: F_Word -> type(WORD); M_RbaRoleNameValue_WS: F_Whitespace+ -> skip, mode(M_RbaTail); M_RbaRoleNameValue_NEWLINE: F_Newline -> type(NEWLINE), mode(M_RbaLine); mode M_RbaTail; M_RbaTail_RBA_TAIL: F_NonNewlineChar+ -> type(RBA_TAIL); M_RbaTail_NEWLINE: F_Newline -> type(NEWLINE), mode(M_RbaLine); mode M_RbaLine; M_RbaLine_WS: F_Whitespace+ -> skip; M_RbaLine_RBA_LINE: F_Word F_Whitespace+ ('no-access'|'read'|'partition-only'|'oper'|'write') -> type(RBA_LINE); M_RbaLine_NEWLINE: F_Newline -> type(NEWLINE); M_RbaLine_COMMENT_LINE: F_Whitespace* '!' {lastTokenType() == NEWLINE}? F_NonNewlineChar* (F_Newline | EOF) -> skip; M_RbaLine_END: F_NonWhitespace+ {less();} -> popMode; mode M_Template; M_Template_WS: F_Whitespace+ -> skip; M_Template_CACHE: 'cache' -> type(CACHE), mode(M_Word); M_Template_CIPHER: 'cipher' -> type(CIPHER), mode(M_Word); M_Template_CLIENT_SSL: 'client-ssl' -> type(CLIENT_SSL), mode(M_Word); M_Template_CONNECTION_REUSE: 'connection-reuse' -> type(CONNECTION_REUSE), mode(M_Word); M_Template_DIAMETER: 'diameter' -> type(DIAMETER), mode(M_Word); M_Template_DNS: 'dns' -> type(DNS), mode(M_Word); M_Template_DYNAMIC_SERVICE: 'dynamic-service' -> type(DYNAMIC_SERVICE), mode(M_Word); M_Template_HTTP: 'http' -> type(HTTP), mode(M_Word); M_Template_PERSIST: 'persist' -> type(PERSIST), mode(M_TemplatePersist); M_Template_POLICY: 'policy' -> type(POLICY), mode(M_Word); M_Template_PORT: 'port' -> type(PORT), mode(M_Word); M_Template_SERVER: 'server' -> type(SERVER), mode(M_Word); M_Template_SERVER_SSL: 'server-ssl' -> type(SERVER_SSL), mode(M_Word); M_Template_SIP: 'sip' -> type(SIP), mode(M_Word); M_Template_TCP: 'tcp' -> type(TCP), mode(M_Word); M_Template_TCP_PROXY: 'tcp-proxy' -> type(TCP_PROXY), mode(M_Word); M_Template_UDP: 'udp' -> type(UDP), mode(M_Word); M_Template_VIRTUAL_PORT: 'virtual-port' -> type(VIRTUAL_PORT), mode(M_Word); M_Template_WAF: 'waf' -> type(WAF), mode(M_Word); M_Template_NEWLINE: F_Newline -> type(NEWLINE), popMode; mode M_TemplatePersist; M_TemplatePersist_WS: F_Whitespace+ -> skip; M_TemplatePersist_COOKIE: 'cookie' -> type(COOKIE), mode(M_Word); M_TemplatePersist_DESTINATION_IP: 'destination-ip' -> type(DESTINATION_IP), mode(M_Word); M_TemplatePersist_SOURCE_IP: 'source-ip' -> type(SOURCE_IP), mode(M_Word); M_TemplatePersist_NEWLINE: F_Newline -> type(NEWLINE), popMode;
modules/opDivide.asm
antuniooh/assembly-calculator
2
81850
OP_DIVIDE: mov A, R5 mov B, R6 div AB mov R3, A ACALL SHOW_RESULT ACALL LONG_DELAY ACALL CLEAR_ALL
src/parser/Grammar.g4
srensamblador/JSON-Parser
0
2692
grammar Grammar ; import Lexicon ; @parser::header { import ast.*; } start returns [Json ast] : valor EOF { $ast = new Json($valor.ast) ;} ; valor returns [Valor ast] : STRING {$ast = new Cadena($STRING) ;} | NUMBER {$ast = new Numero($NUMBER) ;} | 'true' {$ast = new True(); } | 'false' {$ast = new False(); } | 'null' {$ast = new Null(); } | '{' propiedades '}' { $ast = new Objeto($propiedades.list); } | '[' valores ']' {$ast = new Array($valores.list); } ; propiedades returns [List<Atributo> list = new ArrayList<>()] : (propiedad {$list.add($propiedad.ast); } (',' propiedad {$list.add($propiedad.ast); } ) *)? ; propiedad returns [Atributo ast] : STRING ':' valor { $ast = new Atributo($STRING, $valor.ast); } ; valores returns [List<Valor> list = new ArrayList<>()] : (valor {$list.add($valor.ast); } (',' valor {$list.add($valor.ast);})*)? ;
oeis/010/A010549.asm
neoneye/loda-programs
11
14621
<filename>oeis/010/A010549.asm ; A010549: Decimal expansion of square root of 98. ; 9,8,9,9,4,9,4,9,3,6,6,1,1,6,6,5,3,4,1,6,1,1,8,2,1,0,6,9,4,6,7,8,8,6,5,4,9,9,8,7,7,0,3,1,2,7,6,3,8,6,3,6,5,1,2,2,3,6,7,5,8,1,6,5,9,3,5,1,2,7,3,4,9,2,3,4,7,4,9,2,7,1,9,5,2,7,1,2,7,4,0,2,9,3,4,9,1,0,0,9 mov $1,1 mov $2,1 mov $3,$0 add $3,8 mov $4,$0 add $4,3 mul $4,2 mov $7,10 pow $7,$4 mov $9,10 lpb $3 mov $4,$2 pow $4,2 mul $4,98 mov $5,$1 pow $5,2 add $4,$5 mov $6,$1 mov $1,$4 mul $6,$2 mul $6,2 mov $2,$6 mov $8,$4 div $8,$7 max $8,2 div $1,$8 div $2,$8 sub $3,1 lpe mov $3,$9 pow $3,$0 div $2,$3 div $1,$2 mod $1,$9 mov $0,$1
mc-sema/validator/x86/tests/FILD_64m.asm
randolphwong/mcsema
2
90175
BITS 32 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS= ;TEST_FILE_META_END ;TEST_BEGIN_RECORDING lea edi, [esp-0x0c] mov dword [edi+00], 0x0000 mov dword [edi+04], 0x0001 FILD qword [edi] mov edi, 0 ;TEST_END_RECORDING
tests/crew-inventory-test_data-tests.ads
thindil/steamsky
80
16509
<filename>tests/crew-inventory-test_data-tests.ads -- This package has been generated automatically by GNATtest. -- Do not edit any part of it, see GNATtest documentation for more details. -- begin read only with Gnattest_Generated; package Crew.Inventory.Test_Data.Tests is type Test is new GNATtest_Generated.GNATtest_Standard.Crew.Inventory .Test_Data .Test with null record; procedure Test_UpdateInventory_5fa756_83591c(Gnattest_T: in out Test); -- crew-inventory.ads:41:4:UpdateInventory:Test_UpdateInventory procedure Test_FreeInventory_df8fe5_1b9261(Gnattest_T: in out Test); -- crew-inventory.ads:62:4:FreeInventory:Test_FreeInventory procedure Test_TakeOffItem_a8b09e_af73e9(Gnattest_T: in out Test); -- crew-inventory.ads:76:4:TakeOffItem:Test_TakeOffItem procedure Test_ItemIsUsed_9a8ce5_329a6e(Gnattest_T: in out Test); -- crew-inventory.ads:90:4:ItemIsUsed:Test_ItemIsUsed procedure Test_FindTools_9ef8ba_dbafa3(Gnattest_T: in out Test); -- crew-inventory.ads:110:4:FindTools:Test_FindTools end Crew.Inventory.Test_Data.Tests; -- end read only
src/gl/implementation/gl-fixed.adb
Roldak/OpenGLAda
79
7031
-- part of OpenGLAda, (c) 2017 <NAME> -- released under the terms of the MIT license, see the file "COPYING" with GL.API; -- Fixed function pipeline. Deprecated in OpenGL 3.0. package body GL.Fixed is procedure Set_Vertex_Pointer (Length : Vertex_Length; Stride, Offset : Size) is begin API.Vertex_Pointer (Int (Length), Double_Type, Stride, Offset); Raise_Exception_On_OpenGL_Error; end Set_Vertex_Pointer; procedure Set_Color_Pointer (Stride, Offset : Size) is begin API.Color_Pointer (4, Single_Type, Stride, Int (Offset)); Raise_Exception_On_OpenGL_Error; end Set_Color_Pointer; procedure Enable (Capability : Client_Side_Capability) is begin API.Enable_Client_State (Capability); Raise_Exception_On_OpenGL_Error; end Enable; procedure Disable (Capability : Client_Side_Capability) is begin API.Disable_Client_State (Capability); Raise_Exception_On_OpenGL_Error; end Disable; end GL.Fixed;
programs/oeis/066/A066445.asm
neoneye/loda
22
10367
; A066445: a(n) = 12^n mod n^12. ; 0,144,1728,20736,248832,2985984,35831808,429981696,5159780352,61917364224,743008370688,0,13800864889148,36652392292352,96953703492618,236674172846080,568249606736865,15868743229440,1270692936983464,2296447475122176,1898727404471631,8621343763677184,13893976854626899,0,12124150597392182,16149530820198400,59921945037027846,151448237549551616,146830302009169536,216928950291431424,8565647067440819,0,1298066683076950194,1873377875038392320,1268213414778549893,0,5962470594095442367,981549741781233664,4553870646737276721,10232774426126974976,7892600901783585575,7962488193551966208,11057754093333445355,52506876263444512768,12468938394380587407,47894997850327625728,51057233123386043207,0,35530902398978457679,40695840260325658624,169636974586800764472,375261477633081212928,212498393259383693454,0,66970048968300399043,429751203457350500352,1094695386984607072806,32011452432645173248,1058738277067997052361,1364931677874894667776,2624599357948403822595,1483829241971168034816,2682474161044472631990,0,3886889615885919303257,2343553107553336651776,4517286292657842605182,7135212484290806808576,9354830508096623135523,1202147151322068045824,6364891599320865621475,0,17353031847899701292534,21798102068388705513472,2545990683075236290068,14139967428375057793024,38954658459706471794280,15491847594699140272128,52816887446199683517261,62599773330196530200576,0,52101960546723460382720,18097440726485015192939,2376647845924917215232,78471300246174012305357,56061223876953472684032,120955159809018453015090,30570505971530880516096,138989969337572519575442,277483878723079966593024,171394089879401055711511,226299920655735567941632,225414750021633550457352,87237096970788064940032,156319390050572470660468,0,375966220868669642962623,40449962779318462091264,571252846432484036963682,770283296858019385573376 add $0,1 mov $2,12 mov $3,$0 pow $0,12 pow $2,$3 mod $2,$0 mov $0,$2
data/pokemon/base_stats/pelipper.asm
AtmaBuster/pokeplat-gen2
6
96341
<filename>data/pokemon/base_stats/pelipper.asm<gh_stars>1-10 db 0 ; species ID placeholder db 60, 50, 100, 65, 85, 70 ; hp atk def spd sat sdf db WATER, FLYING ; type db 45 ; catch rate db 164 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 20 ; step cycles to hatch INCBIN "gfx/pokemon/pelipper/front.dimensions" db GROWTH_MEDIUM_FAST ; growth rate dn EGG_WATER_1, EGG_FLYING ; egg groups db 70 ; happiness ; tm/hm learnset tmhm WATER_PULSE, TOXIC, HAIL, HIDDEN_POWER, ICE_BEAM, BLIZZARD, HYPER_BEAM, PROTECT, RAIN_DANCE, FRUSTRATION, RETURN, DOUBLE_TEAM, SHOCK_WAVE, AERIAL_ACE, FACADE, SECRET_POWER, REST, ATTRACT, THIEF, STEEL_WING, ROOST, BRINE, FLING, ENDURE, PAYBACK, GIGA_IMPACT, CAPTIVATE, SLEEP_TALK, NATURAL_GIFT, SWAGGER, PLUCK, U_TURN, SUBSTITUTE, FLY, SURF, DEFOG, AIR_CUTTER, GUNK_SHOT, ICY_WIND, KNOCK_OFF, MUD_SLAP, OMINOUS_WIND, SEED_BOMB, SNORE, SWIFT, TWISTER, UPROAR ; end
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1890.asm
ljhsiun2/medusa
9
161817
<filename>Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_1890.asm .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r14 push %r8 push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x1ed0b, %r14 nop nop nop nop sub $52977, %rbx mov (%r14), %rcx nop nop dec %r12 lea addresses_D_ht+0x412b, %rbx nop nop nop add %rdi, %rdi mov (%rbx), %ecx nop nop nop nop add $22553, %rdi lea addresses_UC_ht+0x1d0ab, %rsi lea addresses_D_ht+0x1f8b, %rdi nop nop nop nop nop sub %r11, %r11 mov $71, %rcx rep movsw dec %rbx lea addresses_WC_ht+0x8b8b, %rsi lea addresses_UC_ht+0x88cb, %rdi clflush (%rdi) nop nop nop nop sub $50307, %r11 mov $97, %rcx rep movsb nop nop nop nop sub $39158, %r14 lea addresses_A_ht+0x1b36f, %rdi nop nop nop nop nop xor %r14, %r14 movb $0x61, (%rdi) nop nop nop nop nop cmp %r14, %r14 lea addresses_A_ht+0x578b, %rcx nop nop and %r11, %r11 movb (%rcx), %r14b nop xor $9946, %r14 lea addresses_normal_ht+0xbb7b, %rbx nop xor %r14, %r14 movb $0x61, (%rbx) xor $7460, %rbx lea addresses_WC_ht+0x290b, %rsi lea addresses_normal_ht+0x1868b, %rdi nop nop nop nop nop cmp %r8, %r8 mov $72, %rcx rep movsq nop nop nop nop nop sub %r11, %r11 lea addresses_UC_ht+0x11f8b, %r14 clflush (%r14) nop nop nop add %rbx, %rbx mov $0x6162636465666768, %rcx movq %rcx, (%r14) nop nop nop nop dec %rdi lea addresses_WT_ht+0x1508b, %rsi lea addresses_UC_ht+0x14983, %rdi nop nop nop nop nop cmp %r12, %r12 mov $4, %rcx rep movsl nop xor %rcx, %rcx lea addresses_D_ht+0xc78b, %rsi lea addresses_WT_ht+0x15b8b, %rdi nop nop and %rbx, %rbx mov $100, %rcx rep movsb nop nop nop add $24263, %r14 lea addresses_A_ht+0xb98b, %rsi lea addresses_WC_ht+0x231, %rdi nop nop nop add $8791, %r14 mov $117, %rcx rep movsl add %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %rbx pop %r8 pop %r14 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r13 push %r9 push %rax // Store lea addresses_D+0xbc8b, %rax nop xor $30775, %r13 mov $0x5152535455565758, %r9 movq %r9, %xmm3 vmovups %ymm3, (%rax) nop cmp $45935, %rax // Faulty Load lea addresses_WC+0x1478b, %rax nop and %r13, %r13 mov (%rax), %r11d lea oracles, %r9 and $0xff, %r11 shlq $12, %r11 mov (%r9,%r11,1), %r11 pop %rax pop %r9 pop %r13 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_D', 'AVXalign': False, 'size': 32}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': True, 'size': 4}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': True, 'same': False, 'congruent': 7, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'src': {'same': True, 'congruent': 4, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}} {'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1}} {'src': {'NT': True, 'same': False, 'congruent': 9, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}} {'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8}} {'src': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}} {'src': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}} {'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}} {'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/aco-protocols-synchronization.adb
jonashaggstrom/ada-canopen
0
25336
with ACO.States; with Ada.Real_Time; use Ada.Real_Time; package body ACO.Protocols.Synchronization is --function To_Ms_From_100us (T : Natural) return Natural is (T / 10); procedure Counter_Reset (This : in out SYNC) is begin This.Counter := Counter_Type'First; end Counter_Reset; procedure Counter_Increment (This : in out SYNC; Overflow_Value : in Sync_Counter) is begin if Natural (This.Counter) >= Overflow_Value then This.Counter_Reset; else This.Counter := Counter_Type'Succ (This.Counter); end if; end Counter_Increment; function Is_Counter_Expected (This : in out SYNC) return Boolean is (This.Od.Get_Sync_Counter_Overflow > 1); function Create_Sync (This : in out SYNC; Overflow_Value : in Sync_Counter) return ACO.Messages.Message is Data : constant ACO.Messages.Data_Array := (if Overflow_Value > 1 then (ACO.Messages.Msg_Data'First => This.Counter) else ACO.Messages.Empty_Data); begin return ACO.Messages.Create (CAN_Id => SYNC_CAN_Id, RTR => False, Data => Data); end Create_Sync; procedure Send_Sync (This : in out SYNC) is Overflow_Value : constant Sync_Counter := This.Od.Get_Sync_Counter_Overflow; begin This.Handler.Put (This.Create_Sync (Overflow_Value)); if Overflow_Value > 1 then This.Counter_Increment (Overflow_Value); end if; end Send_Sync; overriding procedure Signal (This : access Sync_Producer_Alarm; T_Now : in Ada.Real_Time.Time) is use Alarms; SYNC_Ref : access SYNC renames This.SYNC_Ref; Period : constant Duration := SYNC_Ref.Od.Get_Communication_Cycle_Period; begin if Period > 0.0 then SYNC_Ref.Timers.Set (Alarm_Access (This), T_Now + To_Time_Span(D =>Period)); SYNC_Ref.Send_Sync; end if; end Signal; procedure Sync_Producer_Start (This : in out SYNC) is Period : constant Duration := This.Od.Get_Communication_Cycle_Period; begin if Period > 0.0 then ACO.Log.Put_Line(ACO.Log.Debug, "Starting sync producer "); ACO.Log.Put_Line(ACO.Log.Debug, "Comm Cycle Period_s: " & Duration'Image(Period)); This.Timers.Set (Alarm => This.Producer_Alarm'Unchecked_Access, Signal_Time => This.Handler.Current_Time + To_Time_Span(Period)); end if; end Sync_Producer_Start; procedure Sync_Producer_Stop (This : in out SYNC) is begin This.Timers.Cancel (This.Producer_Alarm'Unchecked_Access); end Sync_Producer_Stop; overriding procedure On_Event (This : in out Node_State_Change_Subscriber; Data : in ACO.Events.Event_Data) is use ACO.States; Active_In_State : constant array (State) of Boolean := (Stopped | Initializing | Unknown_State => False, Pre_Operational | Operational => True); begin if Data.State.Previous = Initializing and Data.State.Current = Pre_Operational then -- Bootup This.Sync_Ref.Counter_Reset; end if; if Active_In_State (Data.State.Current) and not Active_In_State (Data.State.Previous) then if Data.State.Previous = Stopped then This.Sync_Ref.Counter_Reset; end if; This.Sync_Ref.Sync_Producer_Start; elsif not Active_In_State (Data.State.Current) and Active_In_State (Data.State.Previous) then This.Sync_Ref.Sync_Producer_Stop; end if; end On_Event; overriding procedure On_Event (This : in out Entry_Update_Subscriber; Data : in ACO.Events.Event_Data) is pragma Unreferenced (Data); SYNC_Ref : access SYNC renames This.SYNC_Ref; begin if SYNC_Ref.Timers.Is_Pending (SYNC_Ref.Producer_Alarm'Unchecked_Access) then SYNC_Ref.Sync_Producer_Stop; SYNC_Ref.Counter_Reset; SYNC_Ref.Sync_Producer_Start; end if; end On_Event; overriding function Is_Valid (This : in out SYNC; Msg : in ACO.Messages.Message) return Boolean is use type ACO.Messages.Id_Type; pragma Unreferenced (This); begin return ACO.Messages.CAN_Id (Msg) = SYNC_CAN_Id; end Is_Valid; procedure Message_Received (This : in out SYNC; Msg : in ACO.Messages.Message) is begin if This.Is_Counter_Expected and Msg.Length /= 1 then return; end if; -- TODO: Trigger TPDO end Message_Received; procedure Periodic_Actions (This : in out SYNC; T_Now : in Ada.Real_Time.Time) is begin This.Timers.Process (T_Now); end Periodic_Actions; overriding procedure Initialize (This : in out SYNC) is begin Protocol (This).Initialize; This.Od.Events.Node_Events.Attach (This.Entry_Update'Unchecked_Access); This.Od.Events.Node_Events.Attach (This.State_Change'Unchecked_Access); end Initialize; overriding procedure Finalize (This : in out SYNC) is begin Protocol (This).Finalize; This.Od.Events.Node_Events.Detach (This.Entry_Update'Unchecked_Access); This.Od.Events.Node_Events.Detach (This.State_Change'Unchecked_Access); end Finalize; procedure SYNC_Log (This : in out SYNC; Level : in ACO.Log.Log_Level; Message : in String) is pragma Unreferenced (This); begin ACO.Log.Put_Line (Level, "(SYNC) " & Message); end SYNC_Log; end ACO.Protocols.Synchronization;
src/Delay-monad/Alternative/Termination.agda
nad/partiality-monad
2
5286
------------------------------------------------------------------------ -- Termination predicates ------------------------------------------------------------------------ {-# OPTIONS --erased-cubical --sized-types #-} open import Prelude hiding (↑; module W) module Delay-monad.Alternative.Termination {a} {A : Type a} where open import Equality.Propositional.Cubical open import Logical-equivalence using (_⇔_) open import Equality.Decision-procedures equality-with-J open import Function-universe equality-with-J hiding (id; _∘_) open import H-level equality-with-J open import H-level.Closure equality-with-J open import H-level.Truncation.Propositional equality-with-paths as Trunc import Nat equality-with-J as N open import Delay-monad hiding (Delay) open import Delay-monad.Alternative open import Delay-monad.Alternative.Equivalence open import Delay-monad.Alternative.Properties import Delay-monad.Bisimilarity as B import Delay-monad.Termination as T infix 4 _⇓_ _∥⇓∥_ _⇓′_ -- The three logically equivalent types x ⇓ y, x ∥⇓∥ y and x ⇓′ y -- all mean that the computation x terminates with the value y: -- -- ∙ _⇓_ is the "obvious" definition. The definition does not -- involve truncation, and can be used directly. -- -- ∙ _∥⇓∥_ is a truncated variant of _⇓_. It may be more convenient -- to construct values of type x ∥⇓∥ y than of type x ⇓ y, because -- the former type is a proposition. -- -- ∙ _⇓′_ is an auxiliary definition, used to prove that the other -- two are logically equivalent. This definition does not use -- truncation, but is still propositional (if A is a set). _⇓_ : Delay A → A → Type a (f , _) ⇓ y = ∃ λ n → f n ↓ y _∥⇓∥_ : Delay A → A → Type a x ∥⇓∥ y = ∥ x ⇓ y ∥ _⇓′_ : Delay A → A → Type _ (f , _) ⇓′ y = ∃ λ m → f m ↓ y × (∀ n → ¬ f n ↑ → m N.≤ n) -- _⇓′_ is a family of propositions (if A is a set). ⇓′-propositional : Is-set A → ∀ x {y : A} → Is-proposition (x ⇓′ y) ⇓′-propositional A-set x@(f , _) {y} p q = $⟨ number-unique p q ⟩ proj₁ p ≡ proj₁ q ↝⟨ ignore-propositional-component (×-closure 1 (Maybe-closure 0 A-set) (Π-closure ext 1 λ _ → Π-closure ext 1 λ _ → ≤-propositional)) ⟩□ p ≡ q □ where number-unique : (p q : x ⇓′ y) → proj₁ p ≡ proj₁ q number-unique (pm , f-pm↓y , pm≤) (qm , f-qm↓y , qm≤) = N.≤-antisymmetric (pm≤ qm λ f-qm↑ → ⊎.inj₁≢inj₂ (nothing ≡⟨ sym f-qm↑ ⟩ f qm ≡⟨ f-qm↓y ⟩∎ just y ∎)) (qm≤ pm λ f-pm↑ → ⊎.inj₁≢inj₂ (nothing ≡⟨ sym f-pm↑ ⟩ f pm ≡⟨ f-pm↓y ⟩∎ just y ∎)) -- All values that a computation can terminate with are equal. termination-value-unique : ∀ (x : Delay A) {y z} → x ⇓ y → x ⇓ z → y ≡ z termination-value-unique (f , inc) {y} {z} (m , fm↓y) (n , fn↓z) with N.total m n ... | inj₁ m≤n = ⊎.cancel-inj₂ (just y ≡⟨ sym (↓-upwards-closed inc m≤n fm↓y) ⟩ f n ≡⟨ fn↓z ⟩∎ just z ∎) ... | inj₂ n≤m = ⊎.cancel-inj₂ (just y ≡⟨ sym fm↓y ⟩ f m ≡⟨ ↓-upwards-closed inc n≤m fn↓z ⟩∎ just z ∎) -- _⇓_ is contained in _⇓′_. ⇓→⇓′ : ∀ x {y : A} → x ⇓ y → x ⇓′ y ⇓→⇓′ x@(f , inc) = uncurry find-min where find-min : ∀ {y} m → f m ↓ y → x ⇓′ y find-min zero f0↓y = zero , f0↓y , λ _ _ → N.zero≤ _ find-min {y} (suc m) f-1+m↓y with inspect (f m) ... | nothing , fm↑ = suc m , f-1+m↓y , 1+m-is-min where 1+m-is-min : ∀ n → ¬ f n ↑ → m N.< n 1+m-is-min n ¬fn↑ with inspect (f n) ... | nothing , fn↑ = ⊥-elim (¬fn↑ fn↑) ... | just _ , fn↓ = ↑<↓ inc fm↑ fn↓ ... | just y′ , fm↓y′ = $⟨ find-min m fm↓y′ ⟩ x ⇓′ y′ ↝⟨ Σ-map id (Σ-map with-other-value id) ⟩□ x ⇓′ y □ where with-other-value : ∀ {n} → f n ↓ y′ → f n ↓ y with-other-value = subst (_ ↓_) (termination-value-unique x (_ , fm↓y′) (_ , f-1+m↓y)) -- _⇓_ and _∥⇓∥_ are pointwise logically equivalent (if A is a set). ⇓⇔∥⇓∥ : Is-set A → ∀ x {y : A} → x ⇓ y ⇔ x ∥⇓∥ y ⇓⇔∥⇓∥ A-set x {y} = record { to = ∣_∣ ; from = x ∥⇓∥ y ↝⟨ Trunc.rec (⇓′-propositional A-set x) (⇓→⇓′ x) ⟩ x ⇓′ y ↝⟨ Σ-map id proj₁ ⟩□ x ⇓ y □ } -- The notion of termination defined here is logically equivalent -- (via Delay⇔Delay) to the one defined for the coinductive delay -- monad. ⇓⇔⇓ : ∀ x {y} → x ⇓ y ⇔ _⇔_.to Delay⇔Delay x T.⇓ y ⇓⇔⇓ x = record { to = λ { (n , fn↓y) → to n _ (proj₂ x) refl fn↓y } ; from = from _ refl } where to : ∀ {f : ℕ → Maybe A} n x {y} → Increasing f → x ≡ f 0 → f n ↓ y → Delay⇔Delay.To.to′ f x T.⇓ y to (suc n) nothing f-inc f0↑ fn↓y = B.laterʳ (to n _ (f-inc ∘ suc) refl fn↓y) to {f} zero nothing {y} _ f0↑ fn↓y = ⊥-elim $ ⊎.inj₁≢inj₂ ( nothing ≡⟨ f0↑ ⟩ f 0 ≡⟨ fn↓y ⟩∎ just y ∎) to {f} n (just x) {y} f-inc f0↓x fn↓y = subst (_ T.⇓_) (⊎.cancel-inj₂ {A = ⊤} (just x ≡⟨ sym $ ↓-upwards-closed₀ f-inc (sym f0↓x) n ⟩ f n ≡⟨ fn↓y ⟩∎ just y ∎)) B.now from : ∀ {f : ℕ → Maybe A} {y} x → x ≡ f 0 → Delay⇔Delay.To.to′ f x T.⇓ y → ∃ λ n → f n ↓ y from (just x) f0↓x B.now = 0 , sym f0↓x from nothing _ (B.laterʳ to⇓y) = Σ-map suc id (from _ refl to⇓y) ⇓⇔⇓′ : ∀ {x} {y : A} → x T.⇓ y ⇔ _⇔_.from Delay⇔Delay x ⇓ y ⇓⇔⇓′ = record { to = to ; from = uncurry (from _) } where to : ∀ {x y} → x T.⇓ y → Delay⇔Delay.from x ⇓ y to B.now = 0 , refl to (B.laterʳ p) = Σ-map suc id (to p) from : ∀ x {y} n → proj₁ (Delay⇔Delay.from x) n ↓ y → x T.⇓ y from (now x) n refl = B.now from (later x) zero () from (later x) (suc n) xn↓y = B.laterʳ (from (force x) n xn↓y) -- If there is a function f : ℕ → Maybe A satisfying a property -- similar to termination-value-unique, then this function can be -- turned into a value in Delay A which is, in some sense, weakly -- bisimilar to the function. complete-function : (f : ℕ → Maybe A) → (∀ {y z} → (∃ λ m → f m ↓ y) → (∃ λ n → f n ↓ z) → y ≡ z) → ∃ λ x → ∀ {y} → x ⇓ y ⇔ ∃ λ n → f n ↓ y complete-function f unique = (first-value , inc) , λ {y} → record { to = (∃ λ n → first-value n ↓ y) ↝⟨ uncurry first-value↓→f↓ ⟩□ (∃ λ n → f n ↓ y) □ ; from = (∃ λ n → f n ↓ y) ↝⟨ Σ-map id (f↓→first-value↓ _) ⟩□ (∃ λ n → first-value n ↓ y) □ } where -- If f m terminates for some m smaller than or equal to n, then -- first-value n returns the value of f for the largest such m, and -- otherwise nothing. first-value : ℕ → Maybe A first-value zero = f zero first-value (suc n) = Prelude.[ (λ _ → first-value n) , just ] (f (suc n)) -- Some simple lemmas. step : ∀ {n} → f (suc n) ↑ → first-value (suc n) ≡ first-value n step {n} = cong Prelude.[ (λ _ → first-value n) , just ] done : ∀ {n y} → f (suc n) ↓ y → first-value (suc n) ↓ y done {n} = cong Prelude.[ (λ _ → first-value n) , just ] -- If f n terminates with a certain value, then first-value n -- terminates with the same value. f↓→first-value↓ : ∀ {y} n → f n ↓ y → first-value n ↓ y f↓→first-value↓ zero f↓ = f↓ f↓→first-value↓ (suc n) f↑ = done f↑ -- If first-value m terminates with a certain value, then there is -- some n for which f n terminates with the same value. first-value↓→f↓ : ∀ {y} m → first-value m ↓ y → ∃ λ n → f n ↓ y first-value↓→f↓ zero first-value↓ = zero , first-value↓ first-value↓→f↓ {y} (suc n) first-value↓ with inspect (f (suc n)) ... | just y′ , f↓ = suc n , (f (suc n) ≡⟨ f↓ ⟩ just y′ ≡⟨ sym (done f↓) ⟩ first-value (suc n) ≡⟨ first-value↓ ⟩∎ just y ∎) ... | nothing , f↑ = first-value↓→f↓ n (first-value n ≡⟨ sym (step f↑) ⟩ first-value (suc n) ≡⟨ first-value↓ ⟩∎ just y ∎) -- The function first-value is an increasing sequence. inc : Increasing first-value inc n with inspect (first-value n) | inspect (f (suc n)) inc n | _ | nothing , f↑ = inj₁ (first-value n ≡⟨ sym (step f↑) ⟩∎ first-value (suc n) ∎) inc n | nothing , first-value↑ | just y , f↓ = inj₂ (first-value↑ , λ first-value↑ → ⊎.inj₁≢inj₂ ( nothing ≡⟨ sym first-value↑ ⟩ first-value (suc n) ≡⟨ done f↓ ⟩∎ just y ∎)) inc n | just y , first-value↓ | just y′ , f↓ = inj₁ (first-value n ≡⟨ first-value↓ ⟩ just y ≡⟨ cong just $ unique (_ , proj₂ (first-value↓→f↓ n first-value↓)) (_ , f↓) ⟩ just y′ ≡⟨ sym (done f↓) ⟩∎ first-value (suc n) ∎)
ada/vl53l1_types_h.ads
simonjwright/VL53L1X
0
16414
<reponame>simonjwright/VL53L1X<filename>ada/vl53l1_types_h.ads pragma Ada_2012; pragma Style_Checks (Off); pragma Warnings ("U"); with Interfaces.C; use Interfaces.C; with sys_ustdint_h; package vl53l1_types_h is subtype FixPoint1616_t is sys_ustdint_h.uint32_t; -- ../platform/vl53l1_types.h:109 end vl53l1_types_h;
oeis/185/A185175.asm
neoneye/loda-programs
11
18590
; A185175: a(n) = A010815(7*n + 5). ; Submitted by <NAME> ; 1,-1,0,1,0,-1,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,1,0,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,0,0,0,0,0,0,1,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,1,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 mul $0,7 add $0,5 seq $0,10815 ; From Euler's Pentagonal Theorem: coefficient of q^n in Product_{m>=1} (1 - q^m).
src/ansi.ads
mosteo/ansi-ada
1
291
package ANSI with Pure is Reset_All : constant String; -- Resets the device to its original state. This may include (if -- applicable): reset graphic rendition, clear tabulation stops, reset -- to default font, and more. type States is (Off, On); function Shorten (Sequence : String) return String is (Sequence); -- Some consecutive commands can be combined, resulting in a shorter -- string. Currently does nothing, but included for future optimization. ----------- -- COLOR -- ----------- type Colors is (Default, -- Implementation defined according to ANSI Black, Red, Green, Yellow, Blue, Magenta, Cyan, Grey, -- Note: these light variants might not work in older terminals. In -- general, the bold + [light] color combination will result in the -- same bright color Light_Black, Light_Red, Light_Green, Light_Yellow, Light_Blue, Light_Magenta, Light_Cyan, Light_Grey); Reset : constant String; -- Back to defaults. Applies to colors & styles. function Foreground (Color : Colors) return String; function Background (Color : Colors) return String; -- Basic palette, 8/16 colors subtype Palette_RGB is Natural range 0 .. 5; -- Used for the 256-palette colors. Actual colors in this index-mode -- palette can slightly vary from terminal to terminal. function Palette_Fg (R, G, B : Palette_RGB) return String; function Palette_Bg (R, G, B : Palette_RGB) return String; subtype Greyscale is Natural range 0 .. 23; -- Drawn from the same palette mode. 0 is black, 23 is white function Foreground (Level : Greyscale) return String; function Background (Level : Greyscale) return String; subtype True_RGB is Natural range 0 .. 255; -- Modern terminals support true 24-bit RGB color function Foreground (R, G, B : True_RGB) return String; function Background (R, G, B : True_RGB) return String; Default_Foreground : constant String; Default_Background : constant String; function Color_Wrap (Text : String; Foreground : String := ""; Background : String := "") return String; -- Wraps text between opening color and closing Defaults. See the combo -- color+styles below. ------------ -- STYLES -- ------------ type Styles is (Default, -- equivalent to Default_Foreground/Background Bright, -- aka Bold Dim, -- aka Faint Italic, Underline, Blink, Rapid_Blink, -- ansi.sys only Invert, -- swaps fg/bg, aka reverse video Conceal, -- aka hide Strike, -- aka crossed-out Fraktur, -- rarely supported, gothic style Double_Underline); function Style (Style : Styles; Active : States := On) return String; -- Apply/Remove a style function Style_Wrap (Text : String; Style : Styles) return String; -- Wraps Text in the given style between On/Off sequences function Wrap (Text : String; Style : Styles; Foreground : String := ""; Background : String := "") return String; ------------ -- CURSOR -- ------------ -- Cursor movement. No effect if at edge of screen. function Back (Cells : Positive := 1) return String; function Down (Lines : Positive := 1) return String; function Forward (Cells : Positive := 1) return String; function Up (Lines : Positive := 1) return String; function Next (Lines : Positive := 1) return String; function Previous (Lines : Positive := 1) return String; -- Move to the beginning of the next/prev lines. Not in ansi.sys function Horizontal (Column : Positive := 1) return String; -- Move to a certain absolute column. Not in ansy.sys function Position (Row, Column : Positive := 1) return String; -- 1, 1 is top-left Store : constant String; -- Store cursor position. Private SCO extension, may work in current vts Restore : constant String; -- Restore cursor position to the previously stored one Hide : constant String; Show : constant String; -- DECTCEM private extension, may work in current vts -------------- -- CLEARING -- -------------- Clear_Screen : constant String; Clear_Screen_And_Buffer : constant String; -- Clear also the backscroll buffer Clear_To_Beginning_Of_Screen : constant String; Clear_To_End_Of_Screen : constant String; -- From the cursor position Clear_Line : constant String; -- Does not change cursor position (neither the two following). Clear_To_Beginning_Of_Line : constant String; Clear_To_End_Of_Line : constant String; function Scroll_Up (Lines : Positive) return String; -- Adds lines at bottom function Scroll_Down (Lines : Positive) return String; -- Adds lines at top private ESC : constant Character := ASCII.ESC; CSI : constant String := ESC & '['; Reset_All : constant String := ESC & "c"; -- Helpers for the many int-to-str conversions function Tail (S : String) return String is (S (S'First + 1 .. S'Last)); function Img (I : Natural) return String is (Tail (I'Img)); ------------ -- COLORS -- ------------ Reset : constant String := CSI & "0m"; -- Back to defaults. Applies to colors & styles. function Foreground (Color : Colors) return String is (CSI & (case Color is when Default => "39", when Black => "30", when Red => "31", when Green => "32", when Yellow => "33", when Blue => "34", when Magenta => "35", when Cyan => "36", when Grey => "37", when Light_Black => "90", when Light_Red => "91", when Light_Green => "92", when Light_Yellow => "93", when Light_Blue => "94", when Light_Magenta => "95", when Light_Cyan => "96", when Light_Grey => "97") & "m"); function Background (Color : Colors) return String is (CSI & (case Color is when Default => "49", when Black => "40", when Red => "41", when Green => "42", when Yellow => "43", when Blue => "44", when Magenta => "45", when Cyan => "46", when Grey => "47", when Light_Black => "100", when Light_Red => "101", when Light_Green => "102", when Light_Yellow => "103", when Light_Blue => "104", when Light_Magenta => "105", when Light_Cyan => "106", when Light_Grey => "107") & "m"); function Bit8 (R, G, B : Palette_RGB) return String is (Img (16 + 36 * R + 6 * G + B)); Fg : constant String := "38"; Bg : constant String := "48"; function Palette_Fg (R, G, B : Palette_RGB) return String is (CSI & Fg & ";5;" & Bit8 (R, G, B) & "m"); function Palette_Bg (R, G, B : Palette_RGB) return String is (CSI & Bg & ";5;" & Bit8 (R, G, B) & "m"); function Foreground (Level : Greyscale) return String is (CSI & Fg & ";5;" & Img (232 + Level) & "m"); function Background (Level : Greyscale) return String is (CSI & Bg & ";5;" & Img (232 + Level) & "m"); function Foreground (R, G, B : True_RGB) return String is (CSI & Fg & ";2;" & Img (R) & ";" & Img (G) & ";" & Img (B) & "m"); function Background (R, G, B : True_RGB) return String is (CSI & Bg & ";2;" & Img (R) & ";" & Img (G) & ";" & Img (B) & "m"); Default_Foreground : constant String := CSI & "39m"; Default_Background : constant String := CSI & "49m"; function Color_Wrap (Text : String; Foreground : String := ""; Background : String := "") return String is ((if Foreground /= "" then Foreground else "") & (if Background /= "" then Background else "") & Text & (if Background /= "" then Default_Background else "") & (if Foreground /= "" then Default_Foreground else "")); ------------ -- STYLES -- ------------ function Style (Style : Styles; Active : States := On) return String is (CSI & (case Active is when On => (case Style is when Default => "39", when Bright => "1", when Dim => "2", when Italic => "3", when Underline => "4", when Blink => "5", when Rapid_Blink => "6", when Invert => "7", when Conceal => "8", when Strike => "9", when Fraktur => "20", when Double_Underline => "21" ), when Off => (case Style is when Default => "49", when Bright => "22", when Dim => "22", when Italic => "23", when Underline => "24", when Blink => "25", when Rapid_Blink => "25", when Invert => "27", when Conceal => "28", when Strike => "29", when Fraktur => "23", when Double_Underline => "24" )) & "m"); function Style_Wrap (Text : String; Style : Styles) return String is (ANSI.Style (Style, On) & Text & ANSI.Style (Style, Off)); function Wrap (Text : String; Style : Styles; Foreground : String := ""; Background : String := "") return String is (Style_Wrap (Style => Style, Text => Color_Wrap (Text => Text, Foreground => Foreground, Background => Background))); ------------ -- CURSOR -- ------------ function Cursor (N : Positive; Code : Character) return String is (CSI & Img (N) & Code) with Inline_Always; -- For common Cursor sequences function Back (Cells : Positive := 1) return String is (Cursor (Cells, 'D')); function Down (Lines : Positive := 1) return String is (Cursor (Lines, 'B')); function Forward (Cells : Positive := 1) return String is (Cursor (Cells, 'C')); function Up (Lines : Positive := 1) return String is (Cursor (Lines, 'A')); function Next (Lines : Positive := 1) return String is (Cursor (Lines, 'E')); function Previous (Lines : Positive := 1) return String is (Cursor (Lines, 'F')); function Horizontal (Column : Positive := 1) return String is (Cursor (Column, 'G')); function Position (Row, Column : Positive := 1) return String is (CSI & Img (Row) & ";" & Img (Column) & "H"); Store : constant String := CSI & "s"; Restore : constant String := CSI & "u"; Hide : constant String := CSI & "?25l"; Show : constant String := CSI & "?25h"; -------------- -- CLEARING -- -------------- Clear_Screen : constant String := CSI & "2J"; Clear_Screen_And_Buffer : constant String := CSI & "3J"; Clear_To_Beginning_Of_Screen : constant String := CSI & "2J"; Clear_To_End_Of_Screen : constant String := CSI & "0J"; Clear_Line : constant String := CSI & "2K"; Clear_To_Beginning_Of_Line : constant String := CSI & "1K"; Clear_To_End_Of_Line : constant String := CSI & "0K"; function Scroll_Up (Lines : Positive) return String is (CSI & Img (Lines) & "S"); function Scroll_Down (Lines : Positive) return String is (CSI & Img (Lines) & "T"); end ANSI;
lib/scripts/get_playlist_count.itunes.applescript
swdotcom/music
11
555
<filename>lib/scripts/get_playlist_count.itunes.applescript on escape_quotes(string_to_escape) set AppleScript's text item delimiters to the "\"" set the item_list to every text item of string_to_escape set AppleScript's text item delimiters to the "\\\"" set string_to_escape to the item_list as string set AppleScript's text item delimiters to "" return string_to_escape end escape_quotes set myList to {} tell application "iTunes" set playlistResults to (name of playlists whose name does not contain "Library" and name does not contain "Music" and name does not contain "Audiobooks" and name does not contain "Purchased" and name does not contain "Movies" and name does not contain "TV Shows" and name does not contain "Podcasts") set playlistCounter to 0 repeat with t in playlistResults set playlistTracks to (every file track of playlist t) set counter to 0 set t_info to "{" set t_info to t_info & "\"name\": \"" & my escape_quotes(t) & "\"" repeat with aTrack in playlistTracks set counter to counter + 1 end repeat set t_info to t_info & ", \"count\": " & counter set t_info to t_info & "}[TRACK_END]" copy t_info to end of myList set playlistCounter to playlistCounter + 1 end repeat end tell return myList
src/antlr/FasmParser.g4
SymbiFlow/fasm
44
941
// Copyright (C) 2020 The SymbiFlow Authors. // // Use of this source code is governed by a ISC-style // license that can be found in the LICENSE file or at // https://opensource.org/licenses/ISC // // SPDX-License-Identifier: ISC parser grammar FasmParser; // Reference tokens from the lexer. options { tokenVocab=FasmLexer; } // fasmFile is the root of the parser fasmFile : fasmLine (NEWLINE fasmLine)* EOF ; // Describes one line fasmLine : setFasmFeature? annotations? COMMENT_CAP? ; // Example: a.b.c[31:0] = 3'o7 setFasmFeature : FEATURE featureAddress? (EQUAL value)? ; featureAddress : '[' INT (':' INT)? ']' ; // Matches an ordinary decimal integer, or a Verilog integer literal. value : INT? verilogDigits # VerilogValue | INT # PlainDecimal ; // Matches the portion of a Verilog integer literal starting with // the quote character (') e.g. 'b1101 verilogDigits : HEXADECIMAL_VALUE # HexValue | BINARY_VALUE # BinaryValue | DECIMAL_VALUE # DecimalValue | OCTAL_VALUE # OctalValue ; // Example: { a = "b", c = "d" } annotations : BEGIN_ANNOTATION annotation (',' annotation)* END_ANNOTATION ; annotation : ANNOTATION_NAME ANNOTATION_EQUAL ANNOTATION_VALUE ;
programs/oeis/123/A123509.asm
neoneye/loda
22
169090
; A123509: Rohrbach's problem: a(n) is the largest integer such that there exists a set of n integers that is a basis of order 2 for (0, 1, ..., a(n)-1). ; 1,3,5,9,13,17,21,27,33,41,47,55 seq $0,34107 ; Fractional part of square root of a(n) starts with 1: first term of runs. div $0,7 sub $0,1 mul $0,2 add $0,1
assignment-3/linux_x86_small_egghunter.nasm
rcesecurity/slae
8
14765
; SLAE - Assignment #3: Small Egghunter (Linux/x86) - 19 bytes ; Author: <NAME> (@MrTuxracer) ; Website: http://www.rcesecurity.com global _start section .text _start: mov eax, esp ;get current working stack address mov ebx, 0x42904a90 ;egg=INC EDX, NOP, DEC EDX, NOP search_the_egg: inc eax ;go upwards the stack addresses cmp dword [eax], ebx ;check if address contains egg jne search_the_egg ;loop until we found it cmp dword[eax+4], ebx ;if egg is found, dheck next four bytes for egg again jne search_the_egg ;not found? must be a standalone egg ;) jmp eax ;execute egg+shellcode
programs/oeis/141/A141106.asm
neoneye/loda
22
82453
; A141106: Lower Odd Swappage of Upper Wythoff Sequence. ; 1,5,7,9,13,15,17,19,23,25,27,31,33,35,39,41,43,47,49,51,53,57,59,61,65,67,69,73,75,77,81,83,85,89,91,93,95,99,101,103,107,109,111,115,117,119,123,125,127,129,133,135,137,141,143,145,149,151,153,157,159,161,163 add $0,1 seq $0,26352 ; a(n) = floor(n*tau)+n+1. mov $1,$0 div $1,$0 sub $0,$1 sub $0,1 div $0,2 mul $0,2 add $0,1
notes/FOT/FOTC/Program/ABP/StrongerInductionPrinciple/LemmaI.agda
asr/fotc
11
1638
<filename>notes/FOT/FOTC/Program/ABP/StrongerInductionPrinciple/LemmaI.agda ------------------------------------------------------------------------------ -- ABP auxiliary lemma ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module FOT.FOTC.Program.ABP.StrongerInductionPrinciple.LemmaI where open import Common.FOL.Relation.Binary.EqReasoning open import FOTC.Base open import FOTC.Base.PropertiesI open import FOTC.Base.List open import FOTC.Base.Loop open import FOTC.Base.List.PropertiesI open import FOTC.Data.Bool open import FOTC.Data.Bool.PropertiesI open import FOTC.Data.List open import FOTC.Data.List.PropertiesI open import FOTC.Program.ABP.ABP open import FOTC.Program.ABP.Fair.Type open import FOTC.Program.ABP.Fair.PropertiesI open import FOTC.Program.ABP.PropertiesI open import FOTC.Program.ABP.Terms ------------------------------------------------------------------------------ -- Helper function for the auxiliary lemma module Helper where helper : ∀ {b i' is' os₁ os₂ as bs cs ds js} → Bit b → Fair os₂ → S b (i' ∷ is') os₁ os₂ as bs cs ds js → ∀ ft₁ os₁' → F*T ft₁ → Fair os₁' → os₁ ≡ ft₁ ++ os₁' → ∃[ js' ] js ≡ i' ∷ js' helper {b} {i'} {is'} {os₁} {os₂} {as} {bs} {cs} {ds} {js} Bb Fos₂ (asS , bsS , csS , dsS , jsS) .(T ∷ []) os₁' f*tnil Fos₁' os₁-eq = js' , js-eq where os₁-eq-helper : os₁ ≡ T ∷ os₁' os₁-eq-helper = os₁ ≡⟨ os₁-eq ⟩ (T ∷ []) ++ os₁' ≡⟨ ++-∷ T [] os₁' ⟩ T ∷ ([] ++ os₁') ≡⟨ ∷-rightCong (++-leftIdentity os₁') ⟩ T ∷ os₁' ∎ as' : D as' = await b i' is' ds as-eq : as ≡ < i' , b > ∷ as' as-eq = trans asS (send-eq b i' is' ds) bs' : D bs' = corrupt os₁' · as' bs-eq : bs ≡ ok < i' , b > ∷ bs' bs-eq = bs ≡⟨ bsS ⟩ corrupt os₁ · as ≡⟨ ·-rightCong as-eq ⟩ corrupt os₁ · (< i' , b > ∷ as') ≡⟨ ·-leftCong (corruptCong os₁-eq-helper) ⟩ corrupt (T ∷ os₁') · (< i' , b > ∷ as') ≡⟨ corrupt-T os₁' < i' , b > as' ⟩ ok < i' , b > ∷ corrupt os₁' · as' ≡⟨ refl ⟩ ok < i' , b > ∷ bs' ∎ cs' : D cs' = ack (not b) · bs' js' : D js' = out (not b) · bs' js-eq : js ≡ i' ∷ js' js-eq = js ≡⟨ jsS ⟩ out b · bs ≡⟨ ·-rightCong bs-eq ⟩ out b · (ok < i' , b > ∷ bs') ≡⟨ out-ok≡ b b i' bs' refl ⟩ i' ∷ out (not b) · bs' ≡⟨ refl ⟩ i' ∷ js' ∎ ds' : D ds' = ds helper {b} {i'} {is'} {os₁} {os₂} {as} {bs} {cs} {ds} {js} Bb Fos₂ (asS , bsS , csS , dsS , jsS) .(F ∷ ft₁^) os₁' (f*tcons {ft₁^} FTft₁^) Fos₁' os₁-eq = helper Bb (tail-Fair Fos₂) ihS ft₁^ os₁' FTft₁^ Fos₁' refl where os₁^ : D os₁^ = ft₁^ ++ os₁' os₂^ : D os₂^ = tail₁ os₂ os₁-eq-helper : os₁ ≡ F ∷ os₁^ os₁-eq-helper = os₁ ≡⟨ os₁-eq ⟩ (F ∷ ft₁^) ++ os₁' ≡⟨ ++-∷ F ft₁^ os₁' ⟩ F ∷ ft₁^ ++ os₁' ≡⟨ refl ⟩ F ∷ os₁^ ∎ as^ : D as^ = await b i' is' ds as-eq : as ≡ < i' , b > ∷ as^ as-eq = trans asS (send-eq b i' is' ds) bs^ : D bs^ = corrupt os₁^ · as^ bs-eq : bs ≡ error ∷ bs^ bs-eq = bs ≡⟨ bsS ⟩ corrupt os₁ · as ≡⟨ ·-rightCong as-eq ⟩ corrupt os₁ · (< i' , b > ∷ as^) ≡⟨ ·-leftCong (corruptCong os₁-eq-helper) ⟩ corrupt (F ∷ os₁^) · (< i' , b > ∷ as^) ≡⟨ corrupt-F os₁^ < i' , b > as^ ⟩ error ∷ corrupt os₁^ · as^ ≡⟨ refl ⟩ error ∷ bs^ ∎ cs^ : D cs^ = ack b · bs^ cs-eq : cs ≡ not b ∷ cs^ cs-eq = cs ≡⟨ csS ⟩ ack b · bs ≡⟨ ·-rightCong bs-eq ⟩ ack b · (error ∷ bs^) ≡⟨ ack-error b bs^ ⟩ not b ∷ ack b · bs^ ≡⟨ refl ⟩ not b ∷ cs^ ∎ ds^ : D ds^ = corrupt os₂^ · cs^ ds-eq-helper₁ : os₂ ≡ T ∷ tail₁ os₂ → ds ≡ ok (not b) ∷ ds^ ds-eq-helper₁ h = ds ≡⟨ dsS ⟩ corrupt os₂ · cs ≡⟨ ·-rightCong cs-eq ⟩ corrupt os₂ · (not b ∷ cs^) ≡⟨ ·-leftCong (corruptCong h) ⟩ corrupt (T ∷ os₂^) · (not b ∷ cs^) ≡⟨ corrupt-T os₂^ (not b) cs^ ⟩ ok (not b) ∷ corrupt os₂^ · cs^ ≡⟨ refl ⟩ ok (not b) ∷ ds^ ∎ ds-eq-helper₂ : os₂ ≡ F ∷ tail₁ os₂ → ds ≡ error ∷ ds^ ds-eq-helper₂ h = ds ≡⟨ dsS ⟩ corrupt os₂ · cs ≡⟨ ·-rightCong cs-eq ⟩ corrupt os₂ · (not b ∷ cs^) ≡⟨ ·-leftCong (corruptCong h) ⟩ corrupt (F ∷ os₂^) · (not b ∷ cs^) ≡⟨ corrupt-F os₂^ (not b) cs^ ⟩ error ∷ corrupt os₂^ · cs^ ≡⟨ refl ⟩ error ∷ ds^ ∎ ds-eq : ds ≡ ok (not b) ∷ ds^ ∨ ds ≡ error ∷ ds^ ds-eq = case (λ h → inj₁ (ds-eq-helper₁ h)) (λ h → inj₂ (ds-eq-helper₂ h)) (head-tail-Fair Fos₂) as^-eq-helper₁ : ds ≡ ok (not b) ∷ ds^ → as^ ≡ send b · (i' ∷ is') · ds^ as^-eq-helper₁ h = await b i' is' ds ≡⟨ awaitCong₄ h ⟩ await b i' is' (ok (not b) ∷ ds^) ≡⟨ await-ok≢ b (not b) i' is' ds^ (x≢not-x Bb) ⟩ < i' , b > ∷ await b i' is' ds^ ≡⟨ sym (send-eq b i' is' ds^) ⟩ send b · (i' ∷ is') · ds^ ∎ as^-eq-helper₂ : ds ≡ error ∷ ds^ → as^ ≡ send b · (i' ∷ is') · ds^ as^-eq-helper₂ h = await b i' is' ds ≡⟨ awaitCong₄ h ⟩ await b i' is' (error ∷ ds^) ≡⟨ await-error b i' is' ds^ ⟩ < i' , b > ∷ await b i' is' ds^ ≡⟨ sym (send-eq b i' is' ds^) ⟩ send b · (i' ∷ is') · ds^ ∎ as^-eq : as^ ≡ send b · (i' ∷ is') · ds^ as^-eq = case as^-eq-helper₁ as^-eq-helper₂ ds-eq js-eq : js ≡ out b · bs^ js-eq = js ≡⟨ jsS ⟩ out b · bs ≡⟨ ·-rightCong bs-eq ⟩ out b · (error ∷ bs^) ≡⟨ out-error b bs^ ⟩ out b · bs^ ∎ ihS : S b (i' ∷ is') os₁^ os₂^ as^ bs^ cs^ ds^ js ihS = as^-eq , refl , refl , refl , js-eq ------------------------------------------------------------------------------ -- From Dybjer and Sander's paper: From the assumption that os₁ ∈ Fair -- and hence by unfolding Fair, we conclude that there are ft₁ :  F*T -- and os₁' : Fair, such that os₁ = ft₁ ++ os₁'. -- -- We proceed by induction on ft₁ : F*T using helper. open Helper lemma : ∀ {b i' is' os₁ os₂ as bs cs ds js} → Bit b → Fair os₁ → Fair os₂ → S b (i' ∷ is') os₁ os₂ as bs cs ds js → ∃[ js' ] js ≡ i' ∷ js' lemma Bb Fos₁ Fos₂ s with Fair-out Fos₁ ... | ft , os₁' , FTft , prf , Fos₁' = helper Bb Fos₂ s ft os₁' FTft Fos₁' prf
specs/ada/common/tkmrpc-response-ike-nc_reset-convert.ads
DrenfongWong/tkm-rpc
0
15214
<reponame>DrenfongWong/tkm-rpc<gh_stars>0 with Ada.Unchecked_Conversion; package Tkmrpc.Response.Ike.Nc_Reset.Convert is function To_Response is new Ada.Unchecked_Conversion ( Source => Nc_Reset.Response_Type, Target => Response.Data_Type); function From_Response is new Ada.Unchecked_Conversion ( Source => Response.Data_Type, Target => Nc_Reset.Response_Type); end Tkmrpc.Response.Ike.Nc_Reset.Convert;
src/test/resources/references/completion/basic_completion_after_op.asm
chrisly42/mc68000-asm-plugin
7
100276
<reponame>chrisly42/mc68000-asm-plugin PIC_WIDTH = 320 PIC_HEIGHT equ 256 DEBUG_LEVEL set 10 DOUBLE_BUFFER_1 = 1 AUTO_COMPLETE_2 = 1 dood2 = 1 entry: bsr init bsr main bsr exit rts init move.w #PIC_HEIGHT,d1 .looph move.w #PIC_WIDTH,d0 .loopw clr.b (a0)+ subq.w #1,d0 bne.s .loopw subq.w #1,d1 bne.s .looph move.w a1,d2 move.w e move.w exit move.w PIC_WIDTH move.w AUTO_COMPLETE_2 move.w DEBUG_LEVEL move.w AUTO_COMPLETE_2 move.w DOUBLE_BUFFER_1 rts main moveq.l #0,d0 rts exit illegal rts
programs/oeis/112/A112248.asm
jmorken/loda
1
83234
<gh_stars>1-10 ; A112248: a(n) = n mod floor(log_2(n)). ; 0,0,0,1,0,1,2,0,1,2,0,1,2,0,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4,5,0,1,2,3,4 mov $2,$0 add $2,2 mov $0,$2 log $2,2 mod $0,$2 mov $1,$0
intellij/astava/src/main/java/astava/java/parser/antlr4/Java.g4
jakobehmsen/Astava
0
4282
grammar Java; classFile: classDefinition; script: element*; element: classDefinition | implementsInterface | fieldDefinition | methodDefinition | statement | expression | annotation; classDefinition: modifiers KW_CLASS name=typeQualifier implementsInterface OPEN_BRA classMember* CLOSE_BRA; implementsInterface: KW_IMPLEMENTS typeQualifier (COMMA typeQualifier)*; classMember: fieldDefinition | methodDefinition; fieldDefinition: modifiers type=typeQualifier name=ID (OP_ASSIGN value=expression)? SEMI_COLON; methodDefinition: modifiers returnType=typeQualifier name=ID parameters (SEMI_COLON | OPEN_BRA statement* CLOSE_BRA); parameters: OPEN_PAR (parameter (COMMA parameter)*)? CLOSE_PAR; parameter: type=typeQualifier name=ID; typeQualifier: ID (DOT ID)* | capture; modifiers: accessModifier? KW_ABSTRACT? KW_STATIC?; accessModifier: KW_PUBLIC | KW_PRIVATE | KW_PROTECTED; statement: nonDelimitedStatement | (anyStatement=capture | delimitedStatement SEMI_COLON); nonDelimitedStatement: ifElseStatement | tryCatchStatement | methodBodyStatement; ifElseStatement: KW_IF OPEN_PAR condition=expression CLOSE_PAR ifTrueBlock=singleOrMultiStatement (KW_ELSE ifFalseBlock=singleOrMultiStatement)?; tryCatchStatement: tryBlock catchBlock* finallyBlock?; tryBlock: KW_TRY OPEN_BRA statement* CLOSE_BRA; catchBlock: KW_CATCH OPEN_PAR type=typeQualifier name=ID CLOSE_PAR OPEN_BRA statement* CLOSE_BRA; finallyBlock: KW_FINALLY OPEN_BRA statement* CLOSE_BRA; methodBodyStatement: ELLIPSIS; singleOrMultiStatement: OPEN_BRA statement* CLOSE_BRA | statement; delimitedStatement: returnStatement | variableDeclaration | throwStatement | expression; returnStatement: KW_RETURN expression?; variableDeclaration: type=typeQualifier name=ID (OP_ASSIGN value=expression)?; // Expression precedence following http://www.cs.bilkent.edu.tr/~guvenir/courses/CS101/op_precedence.html expression: assignment | expression4 | anyExpression=capture; assignment: name=ID OP_ASSIGN value=expression; expression4: expressionLogicalAnd | expression8; expressionLogicalAnd: first=expression8 (AMPERSAND expression)*; expression8: relationalExpression | expression9; relationalExpression: first=expression9 (OP_EQUALS expression)*; expression9: instanceOfExpression | expression13; instanceOfExpression: expression13 KW_INSTANCE_OF typeQualifier; expression13: typeCastExpression | leafExpression; typeCastExpression: OPEN_PAR typeQualifier CLOSE_PAR expression; // TODO: Add support for boolean literals true and false leafExpression: ( invocation | classLiteral | ambigousName | intLiteral | stringLiteral | nullLiteral | thisLiteral | trueLiteral | falseLiteral | newInstance | methodBodyExpression ) chainElement*; invocation: identifier arguments; chainElement: DOT (fieldAssignment | fieldAccess | invocation); fieldAssignment: identifier OP_ASSIGN value=expression; fieldAccess: identifier; identifier: ID | capture; classLiteral: typeQualifier DOT KW_CLASS; ambigousName: ID ({_input.LT(2).getType() != OPEN_PAR && _input.LT(2).getType() != OP_ASSIGN}? DOT ID)*; intLiteral: INT; stringLiteral: STRING; nullLiteral: KW_NULL; thisLiteral: KW_THIS; trueLiteral: KW_TRUE; falseLiteral: KW_FALSE; newInstance: KW_NEW name=typeQualifier arguments; arguments: OPEN_PAR (expression (COMMA expression)*)? CLOSE_PAR; methodBodyExpression: ELLIPSIS; throwStatement: KW_THROW expression; annotation: AT typeQualifier (OPEN_PAR ((valueArgument=expression | annotationArgument)? (COMMA annotationArgument)*) CLOSE_PAR)?; annotationArgument: name=ID OP_ASSIGN value=expression; classPredicate: classPredicateElement*; classPredicateElement: classPredicateAccessAnnotation | /*classPredicateAccessModifier | */classPredicateName | classPredicateExtends | classPredicateImplements | classPredicateMember; classPredicateAccessAnnotation: annotation; /*classPredicateAccessModifier: accessModifier;*/ classPredicateName: KW_CLASS name=typeQualifier; classPredicateExtends: (KW_EXTENDS superClassName=typeQualifier); classPredicateImplements: KW_IMPLEMENTS classPredicateInterface (COMMA classPredicateInterface)*; classPredicateInterface: typeQualifier; classPredicateMember: classPredicateField | classPredicateMethod; classPredicateField: modifiers type=typeQualifier? name=ID? SEMI_COLON; classPredicateMethod: modifiers returnType=typeQualifier? name=ID? classPredicateMethodParameters; classPredicateMethodParameters: OPEN_PAR ((typeQualifier (COMMA typeQualifier)*) | anyParams=ELLIPSIS)? CLOSE_PAR; methodPredicate: methodPredicateElement*; methodPredicateElement: methodPredicateAnnotation | methodPredicateAccessModifiers | methodPredicateAccessTypeAndName | methodPredicateParameters ; methodPredicateAnnotation: annotation; methodPredicateAccessModifiers: modifier+; methodPredicateAccessTypeAndName: (returnType=typeQualifier | ELLIPSIS) name=ID?; methodPredicateParameters: OPEN_PAR (typeQualifier (COMMA typeQualifier)*)? CLOSE_PAR; modifier: KW_PRIVATE | KW_PUBLIC | KW_PROTECTED | KW_STATIC | KW_ABSTRACT; methodModification: methodModificationElement*; methodModificationElement: methodModificationAnnotation | methodModificationBody; methodModificationAnnotation: annotation; methodModificationBody: statement+; capture: QUESTION_MARK ID?; statementsOrExpression: statement* | expression; QUESTION_MARK: '?'; AMPERSAND: '&&'; AT: '@'; OP_ASSIGN: '='; OP_EQUALS: '=='; SEMI_COLON: ';'; DOT: '.'; ELLIPSIS: '...'; COMMA: ','; OPEN_PAR: '('; CLOSE_PAR: ')'; OPEN_BRA: '{'; CLOSE_BRA: '}'; KW_NEW: 'new'; KW_RETURN: 'return'; KW_PUBLIC: 'public'; KW_PRIVATE: 'private'; KW_PROTECTED: 'protected'; KW_ABSTRACT: 'abstract'; KW_STATIC: 'static'; KW_CLASS: 'class'; KW_NULL: 'null'; KW_EXTENDS: 'extends'; KW_IMPLEMENTS: 'implements'; KW_INSTANCE_OF: 'instanceof'; KW_IF: 'if'; KW_ELSE: 'else'; KW_THIS: 'this'; KW_TRUE: 'true'; KW_FALSE: 'false'; KW_THROW: 'throw'; KW_TRY: 'try'; KW_CATCH: 'catch'; KW_FINALLY: 'finally'; fragment DIGIT: [0-9]; fragment LETTER: [A-Z]|[a-z]; ID: (LETTER | '_') (LETTER | '_' | DIGIT)*; INT: DIGIT+ (DOT DIGIT+)?; STRING: '"' (EscapeSequence | ~[\\"])* '"'; fragment HexDigit: [0-9a-fA-F]; fragment EscapeSequence: '\\' [btnfr"'\\] | UnicodeEscape | OctalEscape; fragment OctalEscape: '\\' [0-3] [0-7] [0-7] | '\\' [0-7] [0-7] | '\\' [0-7]; fragment UnicodeEscape: '\\' 'u' HexDigit HexDigit HexDigit HexDigit; WS: [ \n\t\r]+ -> skip; SINGLE_LINE_COMMENT: '//' ~('\r' | '\n')* -> skip; MULTI_LINE_COMMENT: '/*' .*? '*/' -> skip;
oeis/016/A016854.asm
neoneye/loda-programs
11
83412
<reponame>neoneye/loda-programs ; A016854: a(n) = (5*n)^6. ; 0,15625,1000000,11390625,64000000,244140625,729000000,1838265625,4096000000,8303765625,15625000000,27680640625,46656000000,75418890625,117649000000,177978515625,262144000000,377149515625,531441000000,735091890625,1000000000000,1340095640625,1771561000000,2313060765625,2985984000000,3814697265625,4826809000000,6053445140625,7529536000000,9294114390625,11390625000000,13867245015625,16777216000000,20179187015625,24137569000000,28722900390625,34012224000000,40089475140625,47045881000000 pow $0,6 mul $0,15625
libsrc/target/msx/msxbios/msx_get_trigger.asm
jpoikela/z88dk
640
91853
; ; MSX specific routines ; ; GFX - a small graphics library ; Copyright (C) 2004 <NAME> ; ; extern bool __FASTCALL__ msx_get_trigger(unsigned char id); ; ; get state of joystick button (trigger) number \a id, true = pressed ; ; $Id: msx_get_trigger.asm,v 1.8 2017-01-02 23:19:02 aralbrec Exp $ ; SECTION code_clib PUBLIC msx_get_trigger PUBLIC _msx_get_trigger EXTERN msxbios IF FORmsx INCLUDE "target/msx/def/msxbios.def" ELSE INCLUDE "target/svi/def/svibios.def" ENDIF msx_get_trigger: _msx_get_trigger: ; __FASTCALL__ : stick id is already in L push ix ld a,l ld ix,GTTRIG call msxbios ld h,0 ld l,a pop ix ret
src/Halting-problem.agda
nad/chi
2
4242
<reponame>nad/chi ------------------------------------------------------------------------ -- The halting problem ------------------------------------------------------------------------ module Halting-problem where open import Equality.Propositional.Cubical open import Logical-equivalence using (_⇔_) open import Prelude hiding (const; Decidable) open import Tactic.By.Propositional open import Univalence-axiom open import Equality.Decision-procedures equality-with-J open import Function-universe equality-with-J hiding (id; _∘_) open import H-level equality-with-J open import H-level.Closure equality-with-J open import H-level.Truncation.Propositional equality-with-paths as Trunc hiding (rec) -- To simplify the development, let's work with actual natural numbers -- as variables and constants (see -- Atom.one-can-restrict-attention-to-χ-ℕ-atoms). open import Atom open import Cancellation χ-ℕ-atoms open import Chi χ-ℕ-atoms open import Coding χ-ℕ-atoms open import Compatibility χ-ℕ-atoms open import Computability χ-ℕ-atoms hiding (_∘_) open import Constants χ-ℕ-atoms open import Deterministic χ-ℕ-atoms open import Free-variables χ-ℕ-atoms open import Propositional χ-ℕ-atoms open import Reasoning χ-ℕ-atoms open import Termination χ-ℕ-atoms open import Values χ-ℕ-atoms open χ-atoms χ-ℕ-atoms import Coding.Instances.Nat open import Combinators as χ hiding (id; if_then_else_) open import Internal-coding ------------------------------------------------------------------------ -- The extensional halting problem -- The extensional halting problem is undecidable. extensional-halting-problem : ¬ ∃ λ halts → Closed halts × ∀ p → Closed p → (Terminates p → apply halts (lambda v-underscore p) ⇓ ⌜ true ⦂ Bool ⌝) × (¬ Terminates p → apply halts (lambda v-underscore p) ⇓ ⌜ false ⦂ Bool ⌝) extensional-halting-problem (halts , cl , hyp) = contradiction where terminv : Exp → Exp terminv p = χ.if apply halts (lambda v-underscore p) then loop else ⌜ zero ⌝ terminv-lemma : ∀ {p} → Closed p → Terminates (terminv p) ⇔ ¬ Terminates p terminv-lemma {p} cl-p = record { to = to; from = from } where to : Terminates (terminv p) → ¬ Terminates p to (_ , case _ (there _ (there _ ())) _ _) p⇓ to (_ , case halts⇓false (there _ here) [] _) p⇓ = C.distinct-codes→distinct-names (λ ()) $ proj₁ $ cancel-const $ ⇓-deterministic (proj₁ (hyp p cl-p) p⇓) halts⇓false to (_ , case _ here [] loop⇓) p⇓ = ¬loop⇓ (_ , loop⇓) from : ¬ Terminates p → Terminates (terminv p) from ¬p⇓ = _ , case (proj₂ (hyp p cl-p) ¬p⇓) (there lemma here) [] (const []) where lemma = C.distinct-codes→distinct-names (λ ()) strange : Exp strange = rec v-p (terminv (var v-p)) strange-closed : Closed strange strange-closed = Closed′-closed-under-rec $ if-then-else-closed (Closed′-closed-under-apply (Closed→Closed′ cl) (Closed′-closed-under-lambda (Closed′-closed-under-var (inj₂ (inj₁ refl))))) (Closed→Closed′ loop-closed) (Closed→Closed′ $ rep-closed zero) subst-lemma : terminv (var v-p) [ v-p ← strange ] ≡ terminv strange subst-lemma = terminv (var v-p) [ v-p ← strange ] ≡⟨⟩ χ.if apply ⟨ halts [ v-p ← strange ] ⟩ (lambda v-underscore strange) then loop else ⌜ zero ⌝ ≡⟨ ⟨by⟩ (subst-closed _ _ cl) ⟩ χ.if apply halts (lambda v-underscore strange) then loop else ⌜ zero ⌝ ≡⟨⟩ terminv strange ∎ strange-lemma : Terminates strange ⇔ ¬ Terminates strange strange-lemma = Terminates strange ↝⟨ record { to = λ { (_ , rec p) → _ , p } ; from = Σ-map _ rec } ⟩ Terminates (terminv (var v-p) [ v-p ← strange ]) ↔⟨ ≡⇒↝ bijection (by subst-lemma) ⟩ Terminates (terminv strange) ↝⟨ terminv-lemma strange-closed ⟩ ¬ Terminates strange □ contradiction : ⊥ contradiction = ¬[⇔¬] strange-lemma -- A variant of the statement above. extensional-halting-problem′ : ¬ ∃ λ halts → Closed halts × ∀ p → Closed p → ∃ λ (b : Bool) → apply halts (lambda v-underscore p) ⇓ ⌜ b ⌝ × if b then Terminates p else (¬ Terminates p) extensional-halting-problem′ (halts , cl , hyp) = extensional-halting-problem ( halts , cl , λ _ cl-p → ⇓→⇓true cl-p , ¬⇓→⇓false cl-p ) where ⇓→⇓true : ∀ {p} → Closed p → Terminates p → apply halts (lambda v-underscore p) ⇓ ⌜ true ⦂ Bool ⌝ ⇓→⇓true {p} cl p⇓ with hyp p cl ... | true , halts⇓true , _ = halts⇓true ... | false , _ , ¬p⇓ = ⊥-elim (¬p⇓ p⇓) ¬⇓→⇓false : ∀ {p} → Closed p → ¬ Terminates p → apply halts (lambda v-underscore p) ⇓ ⌜ false ⦂ Bool ⌝ ¬⇓→⇓false {p} cl ¬p⇓ with hyp p cl ... | false , halts⇓false , _ = halts⇓false ... | true , _ , p⇓ = ⊥-elim (¬p⇓ p⇓) -- And another variant. extensional-halting-problem″ : ¬ ∃ λ halts → Closed halts × ∀ p → Closed p → ∥ (∃ λ (b : Bool) → apply halts (lambda v-underscore p) ⇓ ⌜ b ⌝ × if b then Terminates p else (¬ Terminates p)) ∥ extensional-halting-problem″ (halts , cl , hyp) = extensional-halting-problem ( halts , cl , λ _ cl-p → ⇓→⇓true cl-p , ¬⇓→⇓false cl-p ) where ⇓→⇓true : ∀ {p} → Closed p → Terminates p → apply halts (lambda v-underscore p) ⇓ ⌜ true ⦂ Bool ⌝ ⇓→⇓true cl p⇓ = flip (Trunc.rec ⇓-propositional) (hyp _ cl) λ where (false , _ , ¬p⇓) → ⊥-elim (¬p⇓ p⇓) (true , halts⇓true , _) → halts⇓true ¬⇓→⇓false : ∀ {p} → Closed p → ¬ Terminates p → apply halts (lambda v-underscore p) ⇓ ⌜ false ⦂ Bool ⌝ ¬⇓→⇓false cl ¬p⇓ = flip (Trunc.rec ⇓-propositional) (hyp _ cl) λ where (true , _ , p⇓) → ⊥-elim (¬p⇓ p⇓) (false , halts⇓false , _) → halts⇓false ------------------------------------------------------------------------ -- The intensional halting problem with arbitrary or non-standard -- coding relations -- A "termination inversion" function, parametrised by a solution to -- the (generalised) intensional halting problem of self application. terminv : Exp → Exp terminv halts = lambda v-x (χ.if apply halts (var v-x) then loop else ⌜ zero ⌝) -- A generalised variant of the intensional halting problem of -- self-application is not decidable. This variant replaces the coding -- function for expressions with an arbitrary relation, restricted so -- that codes have to be values. Furthermore the statement is changed -- to include the assumption that there is a code for a certain -- "strange" program. generalised-intensional-halting-problem-of-self-application : (Code : Exp → ∃ Value → Type) → ¬ ∃ λ halts → Closed halts × ∃ (Code (terminv halts)) × ∀ p c → Closed p → Code p c → let c′ = proj₁ c in (Terminates (apply p c′) → apply halts c′ ⇓ ⌜ true ⦂ Bool ⌝) × (¬ Terminates (apply p c′) → apply halts c′ ⇓ ⌜ false ⦂ Bool ⌝) generalised-intensional-halting-problem-of-self-application Code (halts , cl , (code-strange , cd) , hyp) = contradiction where terminv-lemma : ∀ p c → Closed p → Code p c → Terminates (apply (terminv halts) (proj₁ c)) ⇔ ¬ Terminates (apply p (proj₁ c)) terminv-lemma p (c , c-vl) cl-p cd-p = record { to = to; from = from } where to : Terminates (apply (terminv halts) c) → ¬ Terminates (apply p c) to (_ , apply lambda _ (case _ here [] loop⇓)) p⇓ = ¬loop⇓ (_ , loop⇓) to (_ , apply lambda _ (case _ (there _ (there _ ())) _ _)) p⇓ to (_ , apply lambda rep-p⇓ (case halts⇓false′ (there _ here) [] _)) p⇓ = C.distinct-codes→distinct-names (λ ()) $ proj₁ $ cancel-const $ ⇓-deterministic (proj₁ (hyp p (c , c-vl) cl-p cd-p) p⇓) halts⇓false where halts⇓false : apply halts c ⇓ ⌜ false ⦂ Bool ⌝ halts⇓false rewrite sym $ values-only-compute-to-themselves c-vl rep-p⇓ = subst (λ e → apply e _ ⇓ _) (subst-closed _ _ cl) halts⇓false′ from : ¬ Terminates (apply p c) → Terminates (apply (terminv halts) c) from ¬p⇓ = _ , apply lambda (values-compute-to-themselves c-vl) (case halts⇓false (there (C.distinct-codes→distinct-names (λ ())) here) [] (const [])) where halts⇓false : apply (halts [ v-x ← c ]) c ⇓ ⌜ false ⦂ Bool ⌝ halts⇓false = subst (λ e → apply e _ ⇓ _) (sym $ subst-closed _ _ cl) (proj₂ (hyp p (c , c-vl) cl-p cd-p) ¬p⇓) strange : Exp strange = apply (terminv halts) (proj₁ code-strange) terminv-closed : Closed (terminv halts) terminv-closed = Closed′-closed-under-lambda $ if-then-else-closed (Closed′-closed-under-apply (Closed→Closed′ cl) (Closed′-closed-under-var (inj₁ refl))) (Closed→Closed′ loop-closed) (Closed→Closed′ $ rep-closed zero) strange-lemma : Terminates strange ⇔ ¬ Terminates strange strange-lemma = terminv-lemma (terminv halts) code-strange terminv-closed cd contradiction : ⊥ contradiction = ¬[⇔¬] strange-lemma -- A coding relation: An expression e that terminates is encoded by -- the representation of true, and an expression e that does not -- terminate is encoded by the representation of false. ⇓-coding : Exp → ∃ Value → Type ⇓-coding e (c , _) = Terminates e × c ≡ ⌜ true ⦂ Bool ⌝ ⊎ ¬ Terminates e × c ≡ ⌜ false ⦂ Bool ⌝ -- When this coding relation is used the intensional halting problem -- with zero arguments is decidable. intensional-halting-problem₀-with-⇓-coding : ∃ λ halts → Closed halts × ∀ p (c@(c′ , _) : ∃ Value) → Closed p → ⇓-coding p c → (Terminates p → apply halts c′ ⇓ ⌜ true ⦂ Bool ⌝) × (¬ Terminates p → apply halts c′ ⇓ ⌜ false ⦂ Bool ⌝) intensional-halting-problem₀-with-⇓-coding = halts , halts-closed , halts-correct where halts : Exp halts = lambda v-p (case (var v-p) (branch c-true [] ⌜ true ⦂ Bool ⌝ ∷ branch c-false [] ⌜ false ⦂ Bool ⌝ ∷ [])) halts-closed : Closed halts halts-closed = from-⊎ (closed? halts) halts-correct : ∀ p (c@(c′ , _) : ∃ Value) → Closed p → ⇓-coding p c → (Terminates p → apply halts c′ ⇓ ⌜ true ⦂ Bool ⌝) × (¬ Terminates p → apply halts c′ ⇓ ⌜ false ⦂ Bool ⌝) halts-correct _ (.(⌜ true ⌝) , _) _ (inj₁ (p⇓ , refl)) = (λ _ → apply lambda (rep⇓rep (true ⦂ Bool)) (case (rep⇓rep (true ⦂ Bool)) here [] (rep⇓rep (true ⦂ Bool)))) , (λ ¬p⇓ → ⊥-elim (¬p⇓ p⇓)) halts-correct _ (.(⌜ false ⌝) , _) _ (inj₂ (¬p⇓ , refl)) = (λ p⇓ → ⊥-elim (¬p⇓ p⇓)) , (λ _ → apply lambda (rep⇓rep (false ⦂ Bool)) (case (rep⇓rep (false ⦂ Bool)) (there (λ ()) here) [] (rep⇓rep (false ⦂ Bool)))) ------------------------------------------------------------------------ -- The intensional halting problem -- The intensional halting problem of self-application. (This -- definition is not used below.) Intensional-halting-problem-of-self-application : Closed-exp →Bool Intensional-halting-problem-of-self-application = as-function-to-Bool₁ (λ { (e , _) → Terminates (apply e ⌜ e ⌝) }) -- The intensional halting problem of self-application is not -- decidable. intensional-halting-problem-of-self-application : ¬ ∃ λ halts → Closed halts × ∀ p → Closed p → (Terminates (apply p ⌜ p ⌝) → apply halts ⌜ p ⌝ ⇓ ⌜ true ⦂ Bool ⌝) × (¬ Terminates (apply p ⌜ p ⌝) → apply halts ⌜ p ⌝ ⇓ ⌜ false ⦂ Bool ⌝) intensional-halting-problem-of-self-application (halts , cl , hyp) = generalised-intensional-halting-problem-of-self-application ⌜⌝-Code ( halts , cl , ( ( ⌜ terminv halts ⌝ , const→value (rep-const (terminv halts)) ) , refl ) , λ { p _ cl-p refl → hyp p cl-p } ) where ⌜⌝-Code : Exp → ∃ Value → Type ⌜⌝-Code e (c , _) = ⌜ e ⌝ ≡ c -- The intensional halting problem with one argument is not decidable. intensional-halting-problem₁ : ¬ ∃ λ halts → Closed halts × ∀ p x → Closed p → Closed x → (Terminates (apply p ⌜ x ⌝) → apply halts ⌜ p , x ⌝ ⇓ ⌜ true ⦂ Bool ⌝) × (¬ Terminates (apply p ⌜ x ⌝) → apply halts ⌜ p , x ⌝ ⇓ ⌜ false ⦂ Bool ⌝) intensional-halting-problem₁ (halts , cl , hyp) = intensional-halting-problem-of-self-application ( halts′ , cl′ , λ p cl-p → Σ-map (lemma p true ∘_) (lemma p false ∘_) (hyp p p cl-p cl-p) ) where arg = const c-pair (var v-p ∷ var v-p ∷ []) halts′ = lambda v-p (apply halts arg) cl′ : Closed halts′ cl′ = Closed′-closed-under-lambda $ Closed′-closed-under-apply (Closed→Closed′ cl) (from-⊎ (closed′? arg (v-p ∷ []))) lemma : (p : Exp) (b : Bool) → apply halts ⌜ p , p ⌝ ⇓ ⌜ b ⌝ → apply halts′ ⌜ p ⌝ ⇓ ⌜ b ⌝ lemma p b halts⇓ = apply halts′ ⌜ p ⌝ ⟶⟨ apply lambda (rep⇓rep p) ⟩ apply ⟨ halts [ v-p ← ⌜ p ⌝ ] ⟩ ⌜ p , p ⌝ ≡⟨ ⟨by⟩ (subst-closed _ _ cl) ⟩⟶ apply halts ⌜ p , p ⌝ ⇓⟨ halts⇓ ⟩■ ⌜ b ⌝ -- The intensional halting problem with zero arguments is not -- decidable. intensional-halting-problem₀ : ¬ ∃ λ halts → Closed halts × ∀ p → Closed p → (Terminates p → apply halts ⌜ p ⌝ ⇓ ⌜ true ⦂ Bool ⌝) × (¬ Terminates p → apply halts ⌜ p ⌝ ⇓ ⌜ false ⦂ Bool ⌝) intensional-halting-problem₀ (halts , cl , hyp) = intensional-halting-problem-of-self-application ( halts′ , cl′ , λ p cl-p → Σ-map (lemma p true ∘_) (lemma p false ∘_) (hyp (apply p ⌜ p ⌝) (Closed′-closed-under-apply (Closed→Closed′ cl-p) (Closed→Closed′ (rep-closed p)))) ) where halts′ = lambda v-p (apply halts ( const c-apply (var v-p ∷ apply internal-code (var v-p) ∷ []))) cl′ : Closed halts′ cl′ = Closed′-closed-under-lambda $ Closed′-closed-under-apply (Closed→Closed′ cl) (Closed′-closed-under-const (λ { _ (inj₁ refl) → Closed′-closed-under-var (inj₁ refl) ; _ (inj₂ (inj₁ refl)) → Closed′-closed-under-apply (Closed→Closed′ internal-code-closed) (Closed′-closed-under-var (inj₁ refl)) ; _ (inj₂ (inj₂ ())) })) abstract lemma : (p : Exp) (b : Bool) → apply halts ⌜ Exp.apply p ⌜ p ⌝ ⌝ ⇓ ⌜ b ⌝ → apply halts′ ⌜ p ⌝ ⇓ ⌜ b ⌝ lemma p b halts⇓ = apply halts′ ⌜ p ⌝ ⟶⟨ apply lambda (rep⇓rep p) ⟩ apply ⟨ halts [ v-p ← ⌜ p ⌝ ] ⟩ (const c-apply ( ⌜ p ⌝ ∷ apply (internal-code [ v-p ← ⌜ p ⌝ ]) ⌜ p ⌝ ∷ [])) ≡⟨ ⟨by⟩ (subst-closed _ _ cl) ⟩⟶ apply halts (const c-apply ( ⌜ p ⌝ ∷ apply ⟨ internal-code [ v-p ← ⌜ p ⌝ ] ⟩ ⌜ p ⌝ ∷ [])) ≡⟨ ⟨by⟩ (subst-closed v-p ⌜ p ⌝ internal-code-closed) ⟩⟶ apply halts (const c-apply ( ⌜ p ⌝ ∷ apply internal-code ⌜ p ⌝ ∷ [])) ⟶⟨ []⇓ (apply→ ∙) (const (rep⇓rep p ∷ internal-code-correct p ∷ [])) ⟩ apply halts (const c-apply (⌜ p ⌝ ∷ ⌜ ⌜ p ⌝ ⦂ Exp ⌝ ∷ [])) ⟶⟨⟩ apply halts ⌜ Exp.apply p ⌜ p ⌝ ⌝ ⇓⟨ halts⇓ ⟩■ ⌜ b ⌝ -- Two statements of the intensional halting problem with zero -- arguments. Intensional-halting-problem₀₁ : Closed-exp →Bool Intensional-halting-problem₀₁ = as-function-to-Bool₁ (Terminates ∘ proj₁) Intensional-halting-problem₀₂ : Closed-exp →Bool Intensional-halting-problem₀₂ = as-function-to-Bool₂ (Terminates ∘ proj₁) Terminates-propositional -- The first variant is not decidable. intensional-halting-problem₀₁ : ¬ Decidable Intensional-halting-problem₀₁ intensional-halting-problem₀₁ (halts , cl , hyp , _) = intensional-halting-problem₀ ( halts , cl , λ p cl-p → (λ p⇓ → apply halts ⌜ p ⌝ ⇓⟨ hyp (p , cl-p) true ((λ _ → refl) , λ ¬p⇓ → ⊥-elim (¬p⇓ p⇓)) ⟩■ ⌜ true ⦂ Bool ⌝) , λ ¬p⇓ → apply halts ⌜ p ⌝ ⇓⟨ hyp (p , cl-p) false ((λ p⇓ → ⊥-elim (¬p⇓ p⇓)) , λ _ → refl) ⟩■ ⌜ false ⦂ Bool ⌝ ) -- The second variant is not decidable. intensional-halting-problem₀₂ : ¬ Decidable Intensional-halting-problem₀₂ intensional-halting-problem₀₂ (halts , cl , hyp , _) = intensional-halting-problem₀ ( halts , cl , λ p cl-p → (λ p⇓ → apply halts ⌜ p ⌝ ⇓⟨ hyp (p , cl-p) true (inj₁ (p⇓ , refl)) ⟩■ ⌜ true ⦂ Bool ⌝) , (λ ¬p⇓ → apply halts ⌜ p ⌝ ⇓⟨ hyp (p , cl-p) false (inj₂ (¬p⇓ , refl)) ⟩■ ⌜ false ⦂ Bool ⌝) ) -- Under the assumption of excluded middle one can prove that -- Intensional-halting-problem₀₁ and Intensional-halting-problem₀₂ are -- pointwise equal. Intensional-halting-problem₀₂→Intensional-halting-problem₀₁ : ∀ {e b} → proj₁ Intensional-halting-problem₀₂ [ e ]= b → proj₁ Intensional-halting-problem₀₁ [ e ]= b Intensional-halting-problem₀₂→Intensional-halting-problem₀₁ (inj₁ (e⇓ , refl)) = (λ _ → refl) , (⊥-elim ∘ (_$ e⇓)) Intensional-halting-problem₀₂→Intensional-halting-problem₀₁ (inj₂ (¬e⇓ , refl)) = (⊥-elim ∘ ¬e⇓) , λ _ → refl Intensional-halting-problem₀₁→Intensional-halting-problem₀₂ : (excluded-middle : (P : Type) → Is-proposition P → Dec P) → ∀ {e} b → proj₁ Intensional-halting-problem₀₁ [ e ]= b → proj₁ Intensional-halting-problem₀₂ [ e ]= b Intensional-halting-problem₀₁→Intensional-halting-problem₀₂ em = λ where true (_ , ¬¬e⇓) → inj₁ ( double-negation-elimination Terminates-propositional (Bool.true≢false ∘ ¬¬e⇓) , refl ) false (¬e⇓ , _) → inj₂ ( Bool.true≢false ∘ sym ∘ ¬e⇓ , refl ) where double-negation-elimination : {P : Type} → Is-proposition P → ¬ ¬ P → P double-negation-elimination P-prop ¬¬p = case em _ P-prop of λ where (inj₁ p) → p (inj₂ ¬p) → ⊥-elim (¬¬p ¬p) ------------------------------------------------------------------------ -- "Half of the halting problem" -- If a (correct) self-interpreter can be implemented, then "half of -- the halting problem" is computable. half-of-the-halting-problem : (eval : Exp) → Closed eval → (∀ p v → Closed p → p ⇓ v → apply eval ⌜ p ⌝ ⇓ ⌜ v ⌝) → (∀ p → Closed p → ¬ Terminates p → ¬ Terminates (apply eval ⌜ p ⌝)) → ∃ λ halts → Closed halts × ∀ p → Closed p → (Terminates p → apply halts ⌜ p ⌝ ⇓ ⌜ true ⦂ Bool ⌝) × (¬ Terminates p → ¬ Terminates (apply halts ⌜ p ⌝)) half-of-the-halting-problem eval cl eval⇓ eval¬⇓ = halts , cl′ , λ p cl-p → lemma₁ p cl-p , lemma₂ p cl-p module Half-of-the-halting-problem where halts = lambda v-p (apply (lambda v-underscore ⌜ true ⦂ Bool ⌝) (apply eval (var v-p))) cl′ : Closed halts cl′ = Closed′-closed-under-lambda $ Closed′-closed-under-apply (from-⊎ (closed′? (lambda v-underscore ⌜ true ⦂ Bool ⌝) _)) (Closed′-closed-under-apply (Closed→Closed′ cl) (Closed′-closed-under-var (inj₁ refl))) lemma₁ : ∀ p → Closed p → Terminates p → apply halts ⌜ p ⌝ ⇓ ⌜ true ⦂ Bool ⌝ lemma₁ p cl-p (v , p⇓v) = apply halts ⌜ p ⌝ ⟶⟨ apply lambda (rep⇓rep p) ⟩ apply (lambda v-underscore ⌜ true ⦂ Bool ⌝) (apply ⟨ eval [ v-p ← ⌜ p ⌝ ] ⟩ ⌜ p ⌝) ≡⟨ ⟨by⟩ (subst-closed _ _ cl) ⟩⟶ apply (lambda v-underscore ⌜ true ⦂ Bool ⌝) (apply eval ⌜ p ⌝) ⇓⟨ apply lambda (eval⇓ p v cl-p p⇓v) (rep⇓rep (true ⦂ Bool)) ⟩■ ⌜ true ⦂ Bool ⌝ halts-eval-inversion : ∀ e → Terminates (apply halts e) → Terminates (apply eval e) halts-eval-inversion e (_ , apply {v₂ = v} lambda e⇓ (apply {v₂ = v₂} _ eval⇓ _)) = _ , (apply eval e ⟶⟨ []⇓ (apply→ ∙) e⇓ ⟩ apply eval v ≡⟨ by (subst-closed _ _ cl) ⟩⟶ apply (eval [ v-p ← v ]) v ⇓⟨ eval⇓ ⟩■ v₂) lemma₂ : ∀ p → Closed p → ¬ Terminates p → ¬ Terminates (apply halts ⌜ p ⌝) lemma₂ p cl-p ¬p⇓ = Terminates (apply halts ⌜ p ⌝) ↝⟨ halts-eval-inversion ⌜ p ⌝ ⟩ Terminates (apply eval ⌜ p ⌝) ↝⟨ eval¬⇓ p cl-p ¬p⇓ ⟩□ ⊥ □ -- Two statements of "half of the halting problem". Half-of-the-halting-problem₁ : Closed-exp ⇀ Bool Half-of-the-halting-problem₁ = as-partial-function-to-Bool₁ (Terminates ∘ proj₁) Half-of-the-halting-problem₂ : Closed-exp ⇀ Bool Half-of-the-halting-problem₂ = as-partial-function-to-Bool₂ (Terminates ∘ proj₁) Terminates-propositional -- If a (correct) self-interpreter can be implemented, then -- Half-of-the-halting-problem₂ is computable. half-of-the-halting-problem₂ : (eval : Exp) → Closed eval → (∀ p v → Closed p → p ⇓ v → apply eval ⌜ p ⌝ ⇓ ⌜ v ⌝) → (∀ p v → Closed p → apply eval ⌜ p ⌝ ⇓ v → ∃ λ v′ → p ⇓ v′ × v ≡ ⌜ v′ ⌝) → Computable Half-of-the-halting-problem₂ half-of-the-halting-problem₂ eval cl eval₁ eval₂ = H.halts , H.cl′ , (λ { (p , cl-p) .true (p⇓ , refl) → H.lemma₁ p cl-p p⇓ }) , (λ { (p , cl-p) v halts⌜p⌝⇓v → true , Σ-map (_, refl) id (lemma₂ p v cl-p halts⌜p⌝⇓v) }) where eval-inversion : ∀ p → Closed p → Terminates (apply eval ⌜ p ⌝) → Terminates p eval-inversion p cl-p = Σ-map id proj₁ ∘ eval₂ p _ cl-p ∘ proj₂ module H = Half-of-the-halting-problem eval cl eval₁ (λ { p cl-p ¬p⇓ → Terminates (apply eval ⌜ p ⌝) ↝⟨ eval-inversion p cl-p ⟩ Terminates p ↝⟨ ¬p⇓ ⟩□ ⊥ □ }) lemma₂ : ∀ p v → Closed p → apply H.halts ⌜ p ⌝ ⇓ v → Terminates p × v ≡ ⌜ true ⦂ Bool ⌝ lemma₂ p v cl-p q@(apply lambda _ (apply lambda _ (const []))) = ( $⟨ _ , q ⟩ Terminates (apply H.halts ⌜ p ⌝) ↝⟨ H.halts-eval-inversion ⌜ p ⌝ ⟩ Terminates (apply eval ⌜ p ⌝) ↝⟨ eval-inversion p cl-p ⟩□ Terminates p □) , refl ------------------------------------------------------------------------ -- Halting with zero -- If the expression terminates with ⌜ zero ⌝ as the result, then this -- (total partial) function returns true. If the expression does not -- terminate with ⌜ zero ⌝ as the result, then the function returns -- false. Halts-with-zero : Closed-exp →Bool Halts-with-zero = as-function-to-Bool₁ (λ { (e , _) → e ⇓ ⌜ zero ⌝ }) -- Halts-with-zero is not decidable. halts-with-zero : ¬ Decidable Halts-with-zero halts-with-zero = Reduction→¬Computable→¬Computable (proj₁ Intensional-halting-problem₀₁) (proj₁ Halts-with-zero) red intensional-halting-problem₀₁ where red : Reduction (proj₁ Intensional-halting-problem₀₁) (proj₁ Halts-with-zero) red (halts-with-zero , cl , hyp₁ , hyp₂) = halts , cl-halts , hyp₁′ , hyp₂′ where argument : Closed-exp → Closed-exp argument (p , cl-p) = apply (lambda v-x (const c-zero [])) p , (Closed′-closed-under-apply (from-⊎ (closed′? (lambda v-x (const c-zero [])) [])) (Closed→Closed′ cl-p)) coded-argument : Exp → Exp coded-argument p = const c-apply ( ⌜ Exp.lambda v-x (const c-zero []) ⌝ ∷ p ∷ []) halts : Exp halts = lambda v-p (apply halts-with-zero (coded-argument (var v-p))) cl-halts : Closed halts cl-halts = Closed′-closed-under-lambda $ Closed′-closed-under-apply (Closed→Closed′ cl) (Closed′-closed-under-const λ where _ (inj₁ refl) → Closed→Closed′ $ rep-closed (Exp.lambda v-x (const c-zero [])) _ (inj₂ (inj₁ refl)) → Closed′-closed-under-var (inj₁ refl) _ (inj₂ (inj₂ ()))) lemma₁ : ∀ p b → proj₁ Intensional-halting-problem₀₁ [ p ]= b → proj₁ Halts-with-zero [ argument p ]= b lemma₁ p true (_ , ¬¬p⇓) = (λ _ → refl) , λ ¬arg-p⇓zero → ¬¬p⇓ λ p⇓ → ¬arg-p⇓zero (proj₁ (argument p) ⇓⟨ apply lambda (proj₂ p⇓) (const []) ⟩■ const c-zero []) lemma₁ p false (¬p⇓ , _) = (λ { (apply _ p⇓ _) → ¬p⇓ (_ , p⇓) }) , λ _ → refl hyp₁′ : ∀ p b → proj₁ Intensional-halting-problem₀₁ [ p ]= b → apply halts ⌜ p ⌝ ⇓ ⌜ b ⌝ hyp₁′ p b halts[p]=b = apply halts ⌜ p ⌝ ⟶⟨ apply lambda (rep⇓rep p) ⟩ apply ⟨ halts-with-zero [ v-p ← ⌜ p ⌝ ] ⟩ (coded-argument ⌜ p ⌝) ≡⟨ ⟨by⟩ (subst-closed _ _ cl) ⟩⟶ apply halts-with-zero (coded-argument ⌜ p ⌝) ⟶⟨⟩ apply halts-with-zero ⌜ argument p ⌝ ⇓⟨ hyp₁ (argument p) b (lemma₁ p _ halts[p]=b) ⟩■ ⌜ b ⌝ pattern coded-argument-⇓ p = const (const (const (const (const (const [] ∷ []) ∷ []) ∷ []) ∷ const (const [] ∷ const [] ∷ []) ∷ []) ∷ p ∷ []) lemma₂ : ∀ p v → apply halts ⌜ p ⌝ ⇓ v → apply halts-with-zero ⌜ argument p ⌝ ⇓ v lemma₂ p v (apply {v₂ = v₂} lambda q r) = apply ⟨ halts-with-zero ⟩ ⌜ argument p ⌝ ≡⟨ ⟨by⟩ (subst-closed _ _ cl) ⟩⟶ apply (halts-with-zero [ v-p ← v₂ ]) (coded-argument ⌜ p ⌝) ⟶⟨ []⇓ (apply→ ∙) (coded-argument-⇓ q) ⟩ apply (halts-with-zero [ v-p ← v₂ ]) (coded-argument v₂) ⇓⟨ r ⟩■ v hyp₂′ : ∀ p v → apply halts ⌜ p ⌝ ⇓ v → ∃ λ v′ → proj₁ Intensional-halting-problem₀₁ [ p ]= v′ × v ≡ ⌜ v′ ⌝ hyp₂′ p v q = Σ-map id (Σ-map (Σ-map (_∘ λ p⇓ → apply lambda (proj₂ p⇓) (const [])) (_∘ λ ¬p⇓ → λ { (apply lambda p⇓ (const [])) → ¬p⇓ (_ , p⇓) })) id) $ hyp₂ (argument p) v (lemma₂ p v q)
agda/InsertSort/Impl1/Correctness/Permutation/Base.agda
bgbianchi/sorting
6
451
<filename>agda/InsertSort/Impl1/Correctness/Permutation/Base.agda open import Relation.Binary.Core module InsertSort.Impl1.Correctness.Permutation.Base {A : Set} (_≤_ : A → A → Set) (tot≤ : Total _≤_) where open import Data.List open import Data.Sum open import InsertSort.Impl1 _≤_ tot≤ open import List.Permutation.Base A lemma-insert∼/ : (x : A)(xs : List A) → (insert x xs) / x ⟶ xs lemma-insert∼/ x [] = /head lemma-insert∼/ x (y ∷ ys) with tot≤ x y ... | inj₁ _ = /head ... | inj₂ _ = /tail (lemma-insert∼/ x ys) lemma-insert∼ : {xs ys : List A}(x : A) → xs ∼ ys → (x ∷ xs) ∼ insert x ys lemma-insert∼ {xs} {ys} x xs∼ys = ∼x /head (lemma-insert∼/ x ys) xs∼ys theorem-insertSort∼ : (xs : List A) → xs ∼ insertSort xs theorem-insertSort∼ [] = ∼[] theorem-insertSort∼ (x ∷ xs) = lemma-insert∼ x (theorem-insertSort∼ xs)
models/tests/test29.als
transclosure/Amalgam
4
757
module tests/test sig A { x:Int, y:Int } sig B { x:Int, z:Int } sig C in A+B {} run {} expect 1
Cubical/HITs/James/Inductive/ColimitEquivalence.agda
thomas-lamiaux/cubical
1
13585
<reponame>thomas-lamiaux/cubical {- This file contains: - The reduced version gives the same type as James. -} {-# OPTIONS --safe --experimental-lossy-unification #-} module Cubical.HITs.James.Inductive.ColimitEquivalence where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Pointed open import Cubical.HITs.James.Base renaming (James to JamesConstruction) open import Cubical.HITs.James.Inductive.Reduced renaming (𝕁Red to 𝕁RedConstruction ; 𝕁Red∞ to 𝕁amesConstruction) open import Cubical.HITs.James.Inductive.Coherence private variable ℓ : Level module _ ((X , x₀) : Pointed ℓ) where private James = JamesConstruction (X , x₀) 𝕁ames = 𝕁amesConstruction (X , x₀) 𝕁Red = 𝕁RedConstruction (X , x₀) -- Mimicking the constructors in each other unit' : (x : X)(xs : James) → Path James (x₀ ∷ x ∷ xs) (x ∷ x₀ ∷ xs) unit' x xs = sym (unit (x ∷ xs)) ∙∙ refl ∙∙ (λ i → x ∷ unit xs i) coh' : (xs : James) → refl ≡ unit' x₀ xs coh' xs i j = coh-helper {A = James} (unit xs) (unit (x₀ ∷ xs)) (λ i → x₀ ∷ unit xs i) (λ i j → unit (unit xs j) i) i j _∷∞_ : X → 𝕁ames → 𝕁ames _∷∞_ x (inl xs) = inl (x ∷ xs) _∷∞_ x (push xs i) = (push (x ∷ xs) ∙ (λ i → inl (unit x xs i))) i push∞ : (xs : 𝕁ames) → xs ≡ x₀ ∷∞ xs push∞ (inl xs) = push xs push∞ (push xs i) j = push-helper {A = 𝕁ames} (push xs) (push (x₀ ∷ xs)) (λ i → inl (unit x₀ xs i)) (λ i j → inl (coh xs i j)) j i infixr 5 _∷∞_ -- One side map 𝕁→James-inl : 𝕁Red → James 𝕁→James-inl [] = [] 𝕁→James-inl (x ∷ xs) = x ∷ 𝕁→James-inl xs 𝕁→James-inl (unit x xs i) = unit' x (𝕁→James-inl xs) i 𝕁→James-inl (coh xs i j) = coh' (𝕁→James-inl xs) i j 𝕁→James : 𝕁ames → James 𝕁→James (inl xs) = 𝕁→James-inl xs 𝕁→James (push xs i) = unit (𝕁→James-inl xs) i -- Commutativity with pseudo-constructors 𝕁→James-∷ : (x : X)(xs : 𝕁ames) → 𝕁→James (x ∷∞ xs) ≡ x ∷ 𝕁→James xs 𝕁→James-∷ x (inl xs) = refl 𝕁→James-∷ x (push xs i) j = comp-cong-helper 𝕁→James (push (x ∷ xs)) _ (λ i → inl (unit x xs i)) refl j i 𝕁→James-push : (xs : 𝕁ames) → PathP (λ i → 𝕁→James xs ≡ 𝕁→James-∷ x₀ xs i) (cong 𝕁→James (push∞ xs)) (unit (𝕁→James xs)) 𝕁→James-push (inl xs) = refl 𝕁→James-push (push xs i) j k = hcomp (λ l → λ { (i = i0) → unit (𝕁→James-inl xs) k ; (i = i1) → unit (x₀ ∷ 𝕁→James-inl xs) k ; (j = i0) → push-helper-cong 𝕁→James (push xs) (push (x₀ ∷ xs)) (λ i → inl (unit x₀ xs i)) (λ i j → inl (coh xs i j)) k i (~ l) ; (j = i1) → unit (unit (𝕁→James-inl xs) i) k ; (k = i0) → unit (𝕁→James-inl xs) i ; (k = i1) → comp-cong-helper-filler 𝕁→James (push (x₀ ∷ xs)) _ (λ i → inl (unit x₀ xs i)) refl j i l }) (push-coh-helper _ _ _ (λ i j → unit (unit (𝕁→James-inl xs) j) i) k i j) -- The other-side map private push-square : (x : X)(xs : 𝕁Red) → sym (push (x ∷ xs)) ∙∙ refl ∙∙ (λ i → x ∷∞ push xs i) ≡ (λ i → inl (unit x xs i)) push-square x xs i j = push-square-helper (push (x ∷ xs)) (λ i → inl (unit x xs i)) i j coh-cube : (xs : 𝕁Red) → SquareP (λ i j → coh-helper _ _ _ (λ i j → push∞ (push xs j) i) i j ≡ inl (coh xs i j)) (λ i j → inl (x₀ ∷ x₀ ∷ xs)) (λ i j → push-square-helper (push (x₀ ∷ xs)) (λ i → inl (unit x₀ xs i)) j i) (λ i j → inl (x₀ ∷ x₀ ∷ xs)) (λ i j → inl (x₀ ∷ x₀ ∷ xs)) coh-cube xs = coh-cube-helper {A = 𝕁ames} (push xs) (push (x₀ ∷ xs)) (λ i → inl (unit x₀ xs i)) (λ i j → inl (coh xs i j)) J→𝕁ames : James → 𝕁ames J→𝕁ames [] = inl [] J→𝕁ames (x ∷ xs) = x ∷∞ (J→𝕁ames xs) J→𝕁ames (unit xs i) = push∞ (J→𝕁ames xs) i -- The following is the most complicated part. -- It seems horrible but mainly it's due to correction of boudaries. 𝕁→J→𝕁ames-inl : (xs : 𝕁Red) → J→𝕁ames (𝕁→James (inl xs)) ≡ inl xs 𝕁→J→𝕁ames-inl [] = refl 𝕁→J→𝕁ames-inl (x ∷ xs) t = x ∷∞ 𝕁→J→𝕁ames-inl xs t 𝕁→J→𝕁ames-inl (unit x xs i) j = hcomp (λ k → λ { (i = i0) → square-helper (j ∨ ~ k) i0 ; (i = i1) → square-helper (j ∨ ~ k) i1 ; (j = i0) → square-helper (~ k) i ; (j = i1) → inl (unit x xs i) }) (push-square x xs j i) where square-helper : (i j : I) → 𝕁ames square-helper i j = doubleCompPath-cong-filler J→𝕁ames (sym (unit (x ∷ 𝕁→James-inl xs))) refl (λ i → x ∷ unit (𝕁→James-inl xs) i) (λ i j → push∞ (x ∷∞ 𝕁→J→𝕁ames-inl xs i) (~ j)) (λ i j → x ∷∞ 𝕁→J→𝕁ames-inl xs i) (λ i j → x ∷∞ push∞ (𝕁→J→𝕁ames-inl xs i) j) i j i1 𝕁→J→𝕁ames-inl (coh xs i j) k = hcomp (λ l → λ { (i = i0) → cube-helper i0 j (k ∨ ~ l) ; (i = i1) → inl-filler j k l ; (j = i0) → cube-helper i i0 (k ∨ ~ l) ; (j = i1) → cube-helper i i1 (k ∨ ~ l) ; (k = i0) → cube-helper i j (~ l) ; (k = i1) → inl (coh xs i j) }) (coh-cube xs i j k) where cube-helper : (i j k : I) → 𝕁ames cube-helper i j k = coh-helper-cong J→𝕁ames _ _ _ (λ i j → unit (unit (𝕁→James-inl xs) j) i) (λ i j k → push∞ (push∞ (𝕁→J→𝕁ames-inl xs k) j) i) i j k inl-filler : (i j k : I) → 𝕁ames inl-filler i j k = hfill (λ k → λ { (i = i0) → square-helper (j ∨ ~ k) i0 ; (i = i1) → square-helper (j ∨ ~ k) i1 ; (j = i0) → square-helper (~ k) i ; (j = i1) → inl (unit x₀ xs i) }) (inS (push-square x₀ xs j i)) k where square-helper : (i j : I) → 𝕁ames square-helper i j = doubleCompPath-cong-filler J→𝕁ames (sym (unit (x₀ ∷ 𝕁→James-inl xs))) refl (λ i → x₀ ∷ unit (𝕁→James-inl xs) i) (λ i j → push∞ (x₀ ∷∞ 𝕁→J→𝕁ames-inl xs i) (~ j)) (λ i j → x₀ ∷∞ 𝕁→J→𝕁ames-inl xs i) (λ i j → x₀ ∷∞ push∞ (𝕁→J→𝕁ames-inl xs i) j) i j i1 -- The main equivalence 𝕁→J→𝕁ames : (xs : 𝕁ames) → J→𝕁ames (𝕁→James xs) ≡ xs 𝕁→J→𝕁ames (inl xs) = 𝕁→J→𝕁ames-inl xs 𝕁→J→𝕁ames (push xs i) j = push∞ (𝕁→J→𝕁ames-inl xs j) i J→𝕁→James : (xs : James) → 𝕁→James (J→𝕁ames xs) ≡ xs J→𝕁→James [] = refl J→𝕁→James (x ∷ xs) = 𝕁→James-∷ x (J→𝕁ames xs) ∙ (λ i → x ∷ J→𝕁→James xs i) J→𝕁→James (unit xs i) j = hcomp (λ k → λ { (i = i0) → J→𝕁→James xs (j ∧ k) ; (i = i1) → compPath-filler (𝕁→James-∷ x₀ (J→𝕁ames xs)) (λ i → x₀ ∷ J→𝕁→James xs i) k j ; (j = i0) → 𝕁→James (J→𝕁ames (unit xs i)) ; (j = i1) → unit (J→𝕁→James xs k) i }) (𝕁→James-push (J→𝕁ames xs) j i) James≃𝕁Red∞ : James ≃ 𝕁ames James≃𝕁Red∞ = isoToEquiv (iso J→𝕁ames 𝕁→James 𝕁→J→𝕁ames J→𝕁→James)
src/Lemmachine/Resource/Configure.agda
isabella232/Lemmachine
56
16541
<filename>src/Lemmachine/Resource/Configure.agda module Lemmachine.Resource.Configure where open import Lemmachine.Request open import Lemmachine.Response open import Lemmachine.Resource open import Lemmachine.Resource.Universe open import Data.Bool open import Data.Maybe open import Data.Product open import Data.List open import Data.Function using (const) private update : (code : Code) → El code → Resource → Resource update resourceExists f c = record { resourceExists = f ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update serviceAvailable f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = f ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update isAuthorized f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = f ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update forbidden f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = f ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update allowMissingPost f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = f ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update malformedRequest f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = f ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update uriTooLong f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = f ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update knownContentType f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = f ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update validContentHeaders f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = f ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update validEntityLength f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = f ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update options f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = f ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update allowedMethods f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = f ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update knownMethods f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = f ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update deleteResource f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = f ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update deleteCompleted f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = f ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update postIsCreate f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = f ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update createPath f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = f ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update processPost f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = f ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update contentTypesProvided f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = f ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update languageAvailable f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = f ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update contentTypesAccepted f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = f ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update charsetsProvided f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = f ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update encodingsProvided f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = f ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update variances f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = f ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update isConflict f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = f ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update multipleChoices f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = f ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update previouslyExisted f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = f ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update movedPermanently f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = f ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update movedTemporarily f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = f ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update lastModified f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = f ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update expires f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = f ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update generateETag f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = f ; finishRequest = Resource.finishRequest c ; body = Resource.body c } update finishRequest f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = f ; body = Resource.body c } update body f c = record { resourceExists = Resource.resourceExists c ; serviceAvailable = Resource.serviceAvailable c ; isAuthorized = Resource.isAuthorized c ; forbidden = Resource.forbidden c ; allowMissingPost = Resource.allowMissingPost c ; malformedRequest = Resource.malformedRequest c ; uriTooLong = Resource.uriTooLong c ; knownContentType = Resource.knownContentType c ; validContentHeaders = Resource.validContentHeaders c ; validEntityLength = Resource.validEntityLength c ; options = Resource.options c ; allowedMethods = Resource.allowedMethods c ; knownMethods = Resource.knownMethods c ; deleteResource = Resource.deleteResource c ; deleteCompleted = Resource.deleteCompleted c ; postIsCreate = Resource.postIsCreate c ; createPath = Resource.createPath c ; processPost = Resource.processPost c ; contentTypesProvided = Resource.contentTypesProvided c ; languageAvailable = Resource.languageAvailable c ; contentTypesAccepted = Resource.contentTypesAccepted c ; charsetsProvided = Resource.charsetsProvided c ; encodingsProvided = Resource.encodingsProvided c ; variances = Resource.variances c ; isConflict = Resource.isConflict c ; multipleChoices = Resource.multipleChoices c ; previouslyExisted = Resource.previouslyExisted c ; movedPermanently = Resource.movedPermanently c ; movedTemporarily = Resource.movedTemporarily c ; lastModified = Resource.lastModified c ; expires = Resource.expires c ; generateETag = Resource.generateETag c ; finishRequest = Resource.finishRequest c ; body = f } default : Resource default = record { resourceExists = const true ; serviceAvailable = const true ; isAuthorized = const true ; forbidden = const false ; allowMissingPost = const false ; malformedRequest = const false ; uriTooLong = const false ; knownContentType = const true ; validContentHeaders = const true ; validEntityLength = const true ; options = const [] ; allowedMethods = const (HEAD ∷ GET ∷ []) ; knownMethods = const (HEAD ∷ GET ∷ PUT ∷ DELETE ∷ POST ∷ TRACE ∷ CONNECT ∷ OPTIONS ∷ []) ; deleteResource = const false ; deleteCompleted = const true ; postIsCreate = const false ; createPath = const nothing ; processPost = const false ; contentTypesProvided = const [ "text/html" ] ; languageAvailable = const true ; contentTypesAccepted = const [] ; charsetsProvided = const [] ; encodingsProvided = const [ "identity" , "defaultEncoder" ] ; variances = const [] ; isConflict = const false ; multipleChoices = const false ; previouslyExisted = const false ; movedPermanently = const nothing ; movedTemporarily = const nothing ; lastModified = const nothing ; expires = const nothing ; generateETag = const nothing ; finishRequest = const true ; body = defaultHtml } configure : Resource → Hooks → Resource configure base [] = base configure base ((code , f) ∷ cfs) = update code f (configure base cfs) toResource : Hooks → Resource toResource props = configure default props
lib/third_party/mcu_vendor/renesas/rz_mcu_boards/core_package/generate/compiler/asm/cpu.asm
renesas-rx/amazon-freertos
7
173657
<reponame>renesas-rx/amazon-freertos @/******************************************************************************* @* DISCLAIMER @* This software is supplied by Renesas Electronics Corporation and is only @* intended for use with Renesas products. No other uses are authorized. This @* software is owned by Renesas Electronics Corporation and is protected under @* all applicable laws, including copyright laws. @* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING @* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT @* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE @* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. @* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS @* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE @* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR @* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE @* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. @* Renesas reserves the right, without notice, to make changes to this software @* and to discontinue the availability of this software. By using this software, @* you agree to the additional terms and conditions found by accessing the @* following link: @* http://www.renesas.com/disclaimer @* Copyright (C) 2018 Renesas Electronics Corporation. All rights reserved. @*******************************************************************************/ @/******************************************************************************* @* File Name : cpu.asm @* Description : cpu c15 sccess, etc @*******************************************************************************/ .arm @****************************************************************************** @ Function Name : __set_sctlr @ Description : Set SCTLR register @****************************************************************************** .section .text.__set_sctlr .global __set_sctlr .type __set_sctlr,%function .func __set_sctlr __set_sctlr: MCR p15, 0, r0, c1, c0, 0 @;; SCTLR BX LR .endfunc @****************************************************************************** @ Function Name : __get_sctlr @ Description : Get SCTLR register @****************************************************************************** .section .text.__get_sctlr .global __get_sctlr .type __get_sctlr,%function .func __get_sctlr __get_sctlr: MRC p15, 0, r0, c1, c0, 0 @;; SCTLR BX LR .endfunc @****************************************************************************** @ Function Name : __set_cpsr @ Description : Set CPSR register @****************************************************************************** .section .text.__set_cpsr .global __set_cpsr .type __set_cpsr,%function .func __set_cpsr __set_cpsr: MSR cpsr, r0 BX LR .endfunc @****************************************************************************** @ Function Name : __get_cpsr @ Description : Get CPSR register @****************************************************************************** .section .text.__get_cpsr .global __get_cpsr .type __get_cpsr,%function .func __get_cpsr __get_cpsr: MRS r0, cpsr BX LR .endfunc @****************************************************************************** @ Function Name : __set_vbar @ Description : Set VBAR register @****************************************************************************** .section .text.__set_vbar .global __set_vbar .type __set_vbar,%function .func __set_vbar __set_vbar: MCR p15, 0, r0, c12, c0, 0 @;; VBAR BX LR .endfunc @****************************************************************************** @ Function Name : __get_vbar @ Description : Get VBAR register @****************************************************************************** .section .text.__get_vbar .global __get_vbar .type __get_vbar,%function .func __get_vbar __get_vbar: MRC p15, 0, r0, c12, c0, 0 @;; VBAR BX LR .endfunc @****************************************************************************** @ Function Name : __wfi @ Description : WFI @****************************************************************************** .section .text.__wfi .global __wfi .type __wfi,%function .func __wfi __wfi: WFI BX LR .endfunc @****************************************************************************** @ Function Name : __isb @ Description : ISB @****************************************************************************** .section .text.__isb .global __isb .type __isb,%function .func __isb __isb: ISB BX LR .endfunc @****************************************************************************** @ Function Name : __dsb @ Description : DSB @****************************************************************************** .section .text.__dsb .global __dsb .type __dsb,%function .func __dsb __dsb: DSB BX LR .endfunc @****************************************************************************** @ Function Name : __dmb @ Description : DMB @****************************************************************************** .section .text.__dmb .global __dmb .type __dmb,%function .func __dmb __dmb: DMB BX LR .endfunc @****************************************************************************** @ Function Name : R_SoftwareDelay @ Description : delay loop @****************************************************************************** .section .text.R_SoftwareDelay .global R_SoftwareDelay .type R_SoftwareDelay,%function R_SoftwareDelay: .fnstart CMP r0, #0 1: BXEQ LR SUBS r0, r0, #1 B 1b .size R_SoftwareDelay, .-R_SoftwareDelay .cantunwind .fnend .end
cohomology/Exactness.agda
danbornside/HoTT-Agda
0
7317
<reponame>danbornside/HoTT-Agda<filename>cohomology/Exactness.agda open import HoTT module cohomology.Exactness where module _ {i j k} {X : Ptd i} {Y : Ptd j} {Z : Ptd k} (F : fst (X ⊙→ Y)) (G : fst (Y ⊙→ Z)) where private f = fst F g = fst G {- in image of F ⇒ in kernel of G -} is-exact-itok : Type (lmax k (lmax j i)) is-exact-itok = (y : fst Y) → Trunc ⟨-1⟩ (Σ (fst X) (λ x → f x == y)) → g y == snd Z {- in kernel of G ⇒ in image of F -} is-exact-ktoi : Type (lmax k (lmax j i)) is-exact-ktoi = (y : fst Y) → g y == snd Z → Trunc ⟨-1⟩ (Σ (fst X) (λ x → f x == y)) record is-exact : Type (lmax k (lmax j i)) where field itok : is-exact-itok ktoi : is-exact-ktoi open is-exact public {- an equivalent version of is-exact-ktoi if Z is a set -} itok-alt-in : has-level ⟨0⟩ (fst Z) → ((x : fst X) → g (f x) == snd Z) → is-exact-itok itok-alt-in pZ h y = Trunc-rec (pZ _ _) (λ {(x , p) → ap g (! p) ∙ h x}) itok-alt-out : is-exact-itok → ((x : fst X) → g (f x) == snd Z) itok-alt-out h x = h (f x) [ x , idp ] {- Convenient notation for exact sequences. At the moment this is only set up for exact sequences of groups. Do we care about the general case? -} infix 2 _⊣| infixr 2 _⟨_⟩→_ data ExactDiag {i} : Group i → Group i → Type (lsucc i) where _⊣| : (G : Group i) → ExactDiag G G _⟨_⟩→_ : (G : Group i) {H K : Group i} (φ : G →ᴳ H) → ExactDiag H K → ExactDiag G K data ExactSeq {i} : {G H : Group i} → ExactDiag G H → Type (lsucc i) where exact-seq-zero : {G : Group i} → ExactSeq (G ⊣|) exact-seq-one : {G H : Group i} {φ : G →ᴳ H} → ExactSeq (G ⟨ φ ⟩→ H ⊣|) exact-seq-two : {G H K J : Group i} {φ : G →ᴳ H} {ψ : H →ᴳ K} {diag : ExactDiag K J} → is-exact (GroupHom.⊙f φ) (GroupHom.⊙f ψ) → ExactSeq (H ⟨ ψ ⟩→ diag) → ExactSeq (G ⟨ φ ⟩→ H ⟨ ψ ⟩→ diag) private exact-get-type : ∀ {i} {G H : Group i} → ExactDiag G H → ℕ → Type i exact-get-type (G ⊣|) _ = Lift Unit exact-get-type (G ⟨ φ ⟩→ H ⊣|) _ = Lift Unit exact-get-type (G ⟨ φ ⟩→ (H ⟨ ψ ⟩→ s)) O = is-exact (GroupHom.⊙f φ) (GroupHom.⊙f ψ) exact-get-type (_ ⟨ _ ⟩→ s) (S n) = exact-get-type s n exact-get : ∀ {i} {G H : Group i} {diag : ExactDiag G H} → ExactSeq diag → (n : ℕ) → exact-get-type diag n exact-get exact-seq-zero _ = lift unit exact-get exact-seq-one _ = lift unit exact-get (exact-seq-two ex s) O = ex exact-get (exact-seq-two ex s) (S n) = exact-get s n private exact-build-arg-type : ∀ {i} {G H : Group i} → ExactDiag G H → List (Type i) exact-build-arg-type (G ⊣|) = nil exact-build-arg-type (G ⟨ φ ⟩→ H ⊣|) = nil exact-build-arg-type (G ⟨ φ ⟩→ H ⟨ ψ ⟩→ s) = is-exact (GroupHom.⊙f φ) (GroupHom.⊙f ψ) :: exact-build-arg-type (H ⟨ ψ ⟩→ s) exact-build-helper : ∀ {i} {G H : Group i} (diag : ExactDiag G H) → HList (exact-build-arg-type diag) → ExactSeq diag exact-build-helper (G ⊣|) nil = exact-seq-zero exact-build-helper (G ⟨ φ ⟩→ H ⊣|) nil = exact-seq-one exact-build-helper (G ⟨ φ ⟩→ H ⟨ ψ ⟩→ s) (ie :: ies) = exact-seq-two ie (exact-build-helper (H ⟨ ψ ⟩→ s) ies) exact-build : ∀ {i} {G H : Group i} (diag : ExactDiag G H) → hlist-curry-type (exact-build-arg-type diag) (λ _ → ExactSeq diag) exact-build diag = hlist-curry (exact-build-helper diag) private exact-snoc-diag : ∀ {i} {G H K : Group i} → ExactDiag G H → (H →ᴳ K) → ExactDiag G K exact-snoc-diag (G ⊣|) ψ = G ⟨ ψ ⟩→ _ ⊣| exact-snoc-diag (G ⟨ φ ⟩→ s) ψ = G ⟨ φ ⟩→ exact-snoc-diag s ψ exact-concat-diag : ∀ {i} {G H K : Group i} → ExactDiag G H → ExactDiag H K → ExactDiag G K exact-concat-diag (G ⊣|) s₂ = s₂ exact-concat-diag (G ⟨ φ ⟩→ s₁) s₂ = G ⟨ φ ⟩→ (exact-concat-diag s₁ s₂) abstract exact-concat : ∀ {i} {G H K L : Group i} {diag₁ : ExactDiag G H} {φ : H →ᴳ K} {diag₂ : ExactDiag K L} → ExactSeq (exact-snoc-diag diag₁ φ) → ExactSeq (H ⟨ φ ⟩→ diag₂) → ExactSeq (exact-concat-diag diag₁ (H ⟨ φ ⟩→ diag₂)) exact-concat {diag₁ = G ⊣|} exact-seq-one es₂ = es₂ exact-concat {diag₁ = G ⟨ ψ ⟩→ H ⊣|} (exact-seq-two ex _) es₂ = exact-seq-two ex es₂ exact-concat {diag₁ = G ⟨ ψ ⟩→ H ⟨ χ ⟩→ s} (exact-seq-two ex es₁) es₂ = exact-seq-two ex (exact-concat {diag₁ = H ⟨ χ ⟩→ s} es₁ es₂)
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1282.asm
ljhsiun2/medusa
9
101028
.global s_prepare_buffers s_prepare_buffers: push %r15 push %r8 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x19679, %rsi lea addresses_normal_ht+0x188c9, %rdi clflush (%rdi) nop nop nop nop cmp $49973, %r8 mov $70, %rcx rep movsw nop nop nop cmp %r9, %r9 lea addresses_normal_ht+0x14549, %rsi lea addresses_D_ht+0xc649, %rdi nop nop inc %r15 mov $31, %rcx rep movsq nop nop nop nop xor $38731, %r8 lea addresses_A_ht+0x96b1, %r15 nop add $38312, %rbp mov $0x6162636465666768, %rsi movq %rsi, (%r15) nop nop nop nop nop cmp %r9, %r9 lea addresses_A_ht+0x10949, %rsi lea addresses_WC_ht+0x1e0c9, %rdi sub $24832, %rbx mov $127, %rcx rep movsq nop inc %r8 lea addresses_D_ht+0xdb09, %r15 nop and %r8, %r8 movw $0x6162, (%r15) nop nop nop nop and %rsi, %rsi lea addresses_WC_ht+0x28c9, %rsi lea addresses_D_ht+0x70c9, %rdi nop nop nop inc %r8 mov $46, %rcx rep movsl nop nop and $40112, %r15 lea addresses_WT_ht+0xf8c9, %rsi lea addresses_WC_ht+0x1a94b, %rdi nop sub %r9, %r9 mov $28, %rcx rep movsb inc %rbp lea addresses_D_ht+0xf2c9, %rsi xor %rbx, %rbx movw $0x6162, (%rsi) nop nop nop add %r8, %r8 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r8 pop %r15 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %r8 push %rax push %rbp push %rdi // Store lea addresses_RW+0x65e9, %rdi nop nop nop nop cmp %r13, %r13 mov $0x5152535455565758, %r15 movq %r15, %xmm5 vmovups %ymm5, (%rdi) sub %r15, %r15 // Faulty Load lea addresses_D+0x1b8c9, %r12 nop nop nop nop and $16972, %rax movups (%r12), %xmm3 vpextrq $1, %xmm3, %rbp lea oracles, %r12 and $0xff, %rbp shlq $12, %rbp mov (%r12,%rbp,1), %rbp pop %rdi pop %rbp pop %rax pop %r8 pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 5, 'size': 32, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 6, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
Task/Documentation/Ada/documentation.ada
LaudateCorpus1/RosettaCodeData
1
26492
with Ada.Text_Io; use Ada.Text_Io; generic SortName : in String; type DataType is (<>); type SortArrayType is array (Integer range <>) of DataType; with procedure Sort (SortArray : in out SortArrayType; Comp, Write, Ex : in out Natural); package Instrument is -- This generic package essentially accomplishes turning the sort -- procedures into first-class functions for this limited purpose. -- Obviously it doesn't change the way that Ada works with them; -- the same thing would have been much more straightforward to -- program in a language that had true first-class functions package Dur_Io is new Fixed_Io(Duration); procedure TimeSort (Arr : in out SortArrayType); procedure Put; procedure Put (File : in out File_Type); end Instrument;
Library/Chart/CGrObj/cgrobjManager.asm
steakknife/pcgeos
504
82309
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1992 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: cgrobjManager.asm AUTHOR: <NAME> ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- cdb 6/ 2/92 Initial version. DESCRIPTION: $Id: cgrobjManager.asm,v 1.1 97/04/04 17:48:06 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ include chartGeode.def ChartClassStructures segment resource ChartRectClass ChartSplineGuardianClass ChartLineClass ChartClassStructures ends ChartMiscCode segment resource include cgrobjRect.asm include cgrobjSpline.asm ChartMiscCode ends
Ada/problem_9/problem_9.adb
PyllrNL/Project_Euler_Solutions
0
24686
<reponame>PyllrNL/Project_Euler_Solutions package body Problem_9 is function Solution_1 return Int64 is X_1 : Constant Float := (1.0 + Sqrt(1.0 - (4.0*(-500.0)))) / 2.0; X_2 : Constant Float := (1.0 - Sqrt(1.0 - (4.0*(-500.0)))) / 2.0; Max,Temp,A,B,C : Int64; begin if X_1 >= X_2 then Max := Int64(X_1); else Max := Int64(X_2); end if; for M in reverse 1 .. Max loop for N in reverse 1 .. M - 1 loop Temp := 2*M*M + 2*N*M; if Temp = 1000 then A := M*M - N*N; B := 2*M*N; C := M*M + N*N; return A*B*C; end if; end loop; end loop; return 0; end Solution_1; procedure Test_Solution_1 is Solution : constant Int64 := 31875000; begin Assert( Solution_1 = Solution ); end Test_Solution_1; function Get_Solutions return Solution_Case is Ret : Solution_Case; begin Set_Name( Ret, "Problem 9"); Add_Test( Ret, Test_Solution_1'Access ); return Ret; end Get_Solutions; end Problem_9;
resources/scripts/api/greynoise.ads
digitalsanctum/Amass
7,053
25290
<gh_stars>1000+ -- Copyright 2021 <NAME>. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. local json = require("json") name = "Greynoise" type = "api" function start() set_rate_limit(1) end function vertical(ctx, domain) local resp, err = request(ctx, {['url']=build_url(domain)}) if (err ~= nil and err ~= "") then log(ctx, "vertical request to service failed: " .. err) return end local j = json.decode(resp) if (j == nil or j.count == 0) then return end for _, d in pairs(j.data) do new_name(ctx, d.rdns) new_addr(ctx, d.ip, d.rdns) end end function build_url(domain) return "https://greynoise-prod.herokuapp.com/enterprise/v2/experimental/gnql?size=1000&query=metadata.rdns:*." .. domain end
data/mapHeaders/ssanne4.asm
adhi-thirumala/EvoYellow
16
13236
<reponame>adhi-thirumala/EvoYellow SSAnne4_h: db SHIP ; tileset db SS_ANNE_4_HEIGHT, SS_ANNE_4_WIDTH ; dimensions (y, x) dw SSAnne4Blocks, SSAnne4TextPointers, SSAnne4Script ; blocks, texts, scripts db $00 ; connections dw SSAnne4Object ; objects
game/fixed_bank_filler.asm
pompshuffle/super-tilt-bro
2
176345
<gh_stars>1-10 ; ; Credits in the rom ; credits_begin: .asc " credits",$0a .asc $0a .asc " authors",$0a .asc $0a .asc "<NAME>",$0a .asc $0a .asc " art-sources",$0a .asc $0a .asc "backgrounds",$0a .asc " by <NAME>",$0a .asc "super tilt bro",$0a .asc " by tui",$0a .asc "kiki",$0a .asc " by <NAME>",$0a .asc "sinbad",$0a .asc " by zi ye",$0a .asc "i like jump rope",$0a .asc "perihelium",$0a .asc " by ozzed",$0a .asc $0a .asc $0a .asc " thanks",$0a .asc $0a .asc "<NAME> bacteriamage",$0a .asc "<NAME> bjorn nah",$0a .asc "fei <NAME>",$0a .asc "supergameland tui",$0a .byt $00 credits_end: ; ; Print some interesting addresses for debug ; #echo #echo wait_frame_loop: #print wait_next_real_frame+4 #echo nmi_begin: #print nmi #echo vblank_end: #print reset-11 #echo game_tick: #print game_tick #echo update_players: #print update_players #echo update_sprites #print update_sprites #echo game_tick_end: #print slowdown-1 ; ; Print some PRG-ROM space usage information ; ANIM_INVISIBLE_SIZE = 8 ANIM_INVISIBLE_ADDR = $fffa-ANIM_INVISIBLE_SIZE #echo #echo FIXED-bank total space: #print $10000-$c000 #echo #echo FIXED-bank audio engine size: #print ninegine_audio_engine_end-ninegine_audio_engine_begin #echo #echo FIXED-bank code size: #print code_end-$c000 #echo #echo FIXED-bank credits size: #print credits_end-credits_begin #echo #echo FIXED-bank free space: #print ANIM_INVISIBLE_ADDR-* ; ; Fill bank's empty space ; #if ANIM_INVISIBLE_ADDR-* < 0 #error Fixed bank overflow #endif .dsb ANIM_INVISIBLE_ADDR-*, 0 ; ; Place anim invisible (see comment in characters-common-animations.asm) ; #include "game/data/characters/characters-common-animations/invisible.asm" ; ; Set entry points vectors (also from nesmine) ; .word nmi ;entry point for VBlank interrupt (NMI) .word mapper_init ;entry point for program start (RESET) .word cursed ;entry point for masking interrupt (IRQ)
base32enc.asm
zeroplexer/assembly
0
165756
<reponame>zeroplexer/assembly<filename>base32enc.asm ; Executable name : base32enc ; Version : 2.6 ; Created date : 5.9.2018 ; Last update : 22.12.2018 ; Author : <NAME> ; Description : A Base32 Encoder SECTION .data ; Section containing initialised data Base32: db "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" SECTION .bss ; Section containing uninitialized data input resb 16384 ; Byte reservieren für den Input inputLength: equ 16384 ; output: resb 16384 ; Byte reservieren für den Output SECTION .text ; Section containing code global _start ; Linker needs this to find the entry point! _start: nop ; Keine Instruktion prepareInput: ; Alle Register welche ich benötige auf 0 setzen xor r10, r10 ; Eingabe groesse speichern counter read: mov rax, 0 ; Gibt dem System Bescheid, dass wir lesen möchten mov rdi, 0 ; Fangt beim Index 0 an mov rsi, input ; Es wird nach input geschrieben mov rdx, inputLength ; Die inputlänge add rsi, r10 ; Den Pointer auf die letzte Zeilen zeigen syscall ; Ruft den CPU auf um den Buffer zu fuellen sub rsi, r10 ; Den Pointer zurueck zum Anfang zeigen checkDone: cmp rax, 0 ; Wenn rax=0 ist entspricht ctrl + D je done ; Springe zu Fertig, wenn rax 0 ist. checkShouldReadAnotherLine: add rax, r10 ;Input groesse zu rax addieren mov r10, rax ; r10 als counter verwenden cmp byte [rsi+rax-1], 10 ; Vergleiche letzten Charakter mit neuer Zeile jne prepareRegister ; Wenn der letzte Charakter vom Input keine neue Zeile ist dann encoden jmp read ; Lese die naechste Zeile prepareRegister: xor rax, rax ; rax xor rbx, rbx ; rbx xor rcx, rcx ; rcx xor rdx, rdx ; rdx xor r8, r8 ; xor r9, r9 ; xor r11, r11 ; Ausgabe groesse counter speichern mov rax, r10 mov rbx, 8 ; RBX = Mulitplikator (8) mul rbx ; rax (Anzahl Byte) * rbx (8) = Anzahl Bit mov rbx, 5 ; rbx = Divisor (5) div rbx ; rax (Anzahl Bit) / rbx (5) = Anzahl durchgänge cmp rdx, 0 ; Ueberpruefen auf Rest jz noAddCounter inc rax ; Wenn es Rest gab, dann rax um 1 erhöhen noAddCounter: mov r10, rax ; r10 als counter verwenden ;;; Verarbeiten shift: mov bh, [rsi] ; 1 Byte einlesen ;; 1. 5 bit shr bx, 11 ; 3 nach rechts shiften, damit die ersten 5 Bits verarbeitet werden. 1. Zeichen gefunden mov cl, [Base32+ebx] ; Verwandle Eingabe in Base32 Charakter um call addOutput ; Base32 Charakter ausgeben ;; 2. 5 bit mov bh, [rsi] ; 1. Byte wieder einlesen inc rsi ; rsi um 1 erhöhen für das nächste Byte mov bl, [rsi] ; 2 Byte in bl einlesen shl bx, 5 ; shr bx, 11 ; 2. Zeichen gefunden mov cl, [Base32+ebx] ; Verwandle Eingabe in Base32 Charakter um call addOutput ; Base32 Charakter ausgeben ;; Byte 2 einlesen mov bh, [rsi] ; Byte 2 in bh einlesen ;; 3. 5 bit shl bx, 2 shr bx, 11 ; 3. Zeichen gefunden mov cl, [Base32+ebx] ; Verwandle Eingabe in Base32 Charakter um call addOutput ; Base32 Charakter ausgeben ;; 4. 5 bit mov bh, [rsi] ; 2. Byte wieder einlesen inc rsi ; rsi um 1 erhöhen für das nächste Byte mov bl, [rsi] ; 3 Byte in bl einlesen shl bx, 7 shr bx, 11 ; 4. Zeichen gefunden mov cl, [Base32+ebx] ; Verwandle Eingabe in Base32 Charakter um call addOutput ; Base32 Charakter ausgeben ;; Byte 3 + 4 einlesen mov bh, [rsi] ; Byte 3 wieder einlesen inc rsi ; rsi um 1 erhöhen für das nächste Byte mov bl, [rsi] ; Byte 4 einlesen ;; 5. 5 bit shl bx, 4 shr bx, 11 ; 5. Zeichen gefunden mov cl, [Base32+ebx] ; Verwandle Eingabe in Base32 Charakter um call addOutput ; Base32 Charakter ausgeben ;; 6. 5 bit mov bh, [rsi] ; Byte 4 wieder einlesen shl bx, 1 shr bx, 11 ; 6. Zeichen gefunden mov cl, [Base32+ebx] ; Verwandle Eingabe in Base32 Charakter um call addOutput ; Base32 Charakter ausgeben ;; Byte 4 + 5 einlesen mov bh, [rsi] ; Byte 4 einlesen inc rsi ; rsi um 1 erhöhen für das nächste Byte mov bl, [rsi] ; Byte 5 einlesen ;; 7. 5 bit shl bx, 6 shr bx, 11 ; 7. Zeichen gefunden mov cl, [Base32+ebx] ; Verwandle Eingabe in Base32 Charakter um call addOutput ; Base32 Charakter ausgeben ;; 8. 5 bit mov bh, [rsi] ; Byte 5 wieder einlesen shl bx, 3 shr bx, 11 ; 8. Zeichen gefunden mov cl, [Base32+ebx] ; Verwandle Eingabe in Base32 Charakter um call addOutput ; Base32 Charakter ausgeben inc rsi ; rsi um 1 erhöhen für das nächste Byte jmp shift ; Wenn noch Daten vorhanden sind springe zu Shift und beginne das Prozedere von vorne addEqualSign: mov rax, r11 ; Divident: Counter für Anzahl Bytes in Rax kopieren mov r13, 8 ; Divisor: 8 div r13 ; rax durch r13 = 8 rechnen cmp rdx, 0 ; Überprüfen ob die Division keinen Rest ergibt jz write ; Wenn 0 dann sind es alles Achterblöcke mov [output+r11], byte '=' ; EqualSign in die Ausgabe schreiben inc r11 ; Counter für Output erhöhen jmp addEqualSign ; Wieder Überprüfen ob es ein EqualSign benötigt write: mov rax, 1 ; Code um zu schreiben (sys-write) mov rdi, 1 ; stdout fd mov rsi, output ; Ausgabe Adresse mov rdx, r11 ; Ausgabegrösse syscall ; Kernel aufruf jmp prepareInput done: mov rax, 60 ; Code um das Programm zu beenden mov rdi, 0 ; Beenden mit 0 Code syscall ; Kernerl aufruf ; METHODEN addOutput: mov [output+r11], cl ; Ausgabe des Base32 Zeichen inc r11 ; counter für die Länge heraufzählen dec r10 ; counter r10 runterzählen cmp r10, 0 ; Vergleicht ob noch Daten vorhanden sind. jz addEqualSign ; Wenn keine Byte mehr vorhanden sind Springe zu addEqualSign ret ; Zurück zum Code
ada-command_line.ads
mgrojo/adalib
15
2243
<gh_stars>10-100 -- Standard Ada library specification -- Copyright (c) 2003-2018 <NAME> <<EMAIL>> -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual --------------------------------------------------------------------------- package Ada.Command_Line is pragma Preelaborate (Command_Line); function Argument_Count return Natural; function Argument (Number : in Positive) return String; function Command_Name return String; type Exit_Status is range implementation_defined .. implementation_defined; Success : constant Exit_Status; Failure : constant Exit_Status; procedure Set_Exit_Status (Code : in Exit_Status); private pragma Import (Ada, Success); pragma Import (Ada, Failure); end Ada.Command_Line;
src/net-dns.ads
stcarrez/ada-enet
16
19544
----------------------------------------------------------------------- -- net-dns -- DNS Network utilities -- Copyright (C) 2016, 2017 <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 Ada.Real_Time; with Net.Interfaces; with Net.Buffers; with Net.Sockets.Udp; -- == DNS Client == -- The DNS client is used to make a DNS resolution and resolve a hostname to get an IP address -- (RFC 1035). The client implementation is based on the UDP client sockets and it uses a -- random UDP port to receive the DNS response. -- -- === Initialization === -- The DNS client is represented by the <tt>Query</tt> tagged type. An instance must be declared -- for each hostname that must be resolved. -- -- Client : Net.DNS.Query; -- -- === Hostname resolution === -- The hostname resolution is started by calling the <tt>Resolve</tt> operation on the query -- object. That operation needs an access to the network interface to be able to send the -- DNS query packet. It returns a status code that indicates whether the packet was sent or not. -- -- Client.Resolve (Ifnet'Access, "www.google.com", Status); -- -- The DNS resolution is asynchronous. The <tt>Resolve</tt> operation does not wait for the -- response. The <tt>Get_Status</tt> operation can be used to look at the progress of the DNS -- query. The value <tt>PENDING</tt> indicates that a request was sent but no response was -- received yet. The value <tt>NOERROR</tt> indicates that the DNS resolution was successful. -- -- Once the <tt>Get_Status</tt> operation returns the <tt>NOERROR</tt> value, the IPv4 address -- can be obtained by using the <tt>Get_Ip</tt> function. -- -- IP : Net.Ip_Addr := Client.Get_Ip; package Net.DNS is -- Maximum length allowed for a hostname resolution. DNS_NAME_MAX_LENGTH : constant Positive := 255; -- Maximum length accepted by a response anwser. The official limit is 64K but this -- implementation limits the length of DNS records to 512 bytes which is more than acceptable. DNS_VALUE_MAX_LENGTH : constant Positive := 512; -- The DNS query status. type Status_Type is (NOQUERY, NOERROR, FORMERR, SERVFAIL, NXDOMAIN, NOTIMP, REFUSED, YXDOMAIN, XRRSET, NOTAUTH, NOTZONE, OTHERERROR, PENDING); -- The DNS record type is a 16-bit number. type RR_Type is new Net.Uint16; -- Common standard DNS record type values from RFC 1035, RFC 3586) -- (See http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml) A_RR : constant RR_Type := 1; NS_RR : constant RR_Type := 2; CNAME_RR : constant RR_Type := 5; PTR_RR : constant RR_Type := 12; MX_RR : constant RR_Type := 15; TXT_RR : constant RR_Type := 16; AAAA_RR : constant RR_Type := 28; -- The possible value types in the response. type Value_Type is (V_NONE, V_TEXT, V_IPV4, V_IPV6); -- The Response_Type record describes a response anwser that was received from the -- DNS server. The DNS server can send several response answers in the same packet. -- The answer data is extracted according to the RR type and made available as String, -- IPv4 and in the future IPv6. type Response_Type (Kind : Value_Type; Of_Type : RR_Type; Len : Natural) is record Class : Net.Uint16; Ttl : Net.Uint32; case Kind is when V_TEXT => -- CNAME_RR | TXT_RR | MX_RR | NS_RR | PTR_RR Text : String (1 .. Len); when V_IPV4 => -- A_RR Ip : Net.Ip_Addr; when others => null; end case; end record; type Query is new Net.Sockets.Udp.Socket with private; function Get_Status (Request : in Query) return Status_Type; -- Get the name defined for the DNS query. function Get_Name (Request : in Query) return String; -- Get the IP address that was resolved by the DNS query. function Get_Ip (Request : in Query) return Net.Ip_Addr; -- Get the TTL associated with the response. function Get_Ttl (Request : in Query) return Net.Uint32; -- Start a DNS resolution for the given hostname. procedure Resolve (Request : access Query; Ifnet : access Net.Interfaces.Ifnet_Type'Class; Name : in String; Status : out Error_Code; Timeout : in Duration := 10.0) with Pre => Name'Length < DNS_NAME_MAX_LENGTH, Post => Request.Get_Status /= NOQUERY; -- Save the answer received from the DNS server. This operation is called for each answer -- found in the DNS response packet. The Index is incremented at each answer. For example -- a DNS server can return a CNAME_RR answer followed by an A_RR: the operation is called -- two times. -- -- This operation can be overriden to implement specific actions when an answer is received. procedure Answer (Request : in out Query; Status : in Status_Type; Response : in Response_Type; Index : in Natural); overriding procedure Receive (Request : in out Query; From : in Net.Sockets.Sockaddr_In; Packet : in out Net.Buffers.Buffer_Type); private protected type Request is procedure Set_Result (Addr : in Net.Ip_Addr; Time : in Net.Uint32); procedure Set_Status (State : in Status_Type); function Get_IP return Net.Ip_Addr; function Get_Status return Status_Type; function Get_TTL return Net.Uint32; private Status : Status_Type := NOQUERY; Ip : Net.Ip_Addr := (others => 0); Ttl : Net.Uint32; end Request; type Query is new Net.Sockets.Udp.Socket with record Name : String (1 .. DNS_NAME_MAX_LENGTH); Name_Len : Natural := 0; Deadline : Ada.Real_Time.Time; Xid : Net.Uint16; Result : Request; end record; end Net.DNS;
card_dir.ads
97kovacspeter/ADA
0
1349
<reponame>97kovacspeter/ADA<filename>card_dir.ads<gh_stars>0 package Card_Dir is type Cardinal_Direction is (N, NE, E, SE, S, SW, W, NW); --enumerator for cardinal directions end Card_Dir;
alloy4fun_models/trashltl/models/0/xpmAFdRmwiumsJYab.als
Kaixi26/org.alloytools.alloy
0
4234
open main pred idxpmAFdRmwiumsJYab_prop1 { no Trash } pred __repair { idxpmAFdRmwiumsJYab_prop1 } check __repair { idxpmAFdRmwiumsJYab_prop1 <=> prop1o }
oeis/047/A047679.asm
neoneye/loda-programs
11
97177
<gh_stars>10-100 ; A047679: Denominators in full Stern-Brocot tree. ; Submitted by <NAME> ; 1,2,1,3,3,2,1,4,5,5,4,3,3,2,1,5,7,8,7,7,8,7,5,4,5,5,4,3,3,2,1,6,9,11,10,11,13,12,9,9,12,13,11,10,11,9,6,5,7,8,7,7,8,7,5,4,5,5,4,3,3,2,1,7,11,14,13,15,18,17,13,14,19,21,18,17,19,16,11,11,16,19,17,18,21,19,14,13,17,18,15,13,14,11,7,6,9,11,10,11 mov $2,2 add $2,$0 add $0,$2 seq $0,174980 ; Stern's diatomic series type ([0,1], 1).
software/unittest/estimator/src/config.ads
TUM-EI-RCS/StratoX
12
28368
<filename>software/unittest/estimator/src/config.ads with Units; use Units; with Units.Navigation; use Units.Navigation; package config is end config;
oeis/106/A106838.asm
neoneye/loda-programs
11
8110
<reponame>neoneye/loda-programs ; A106838: Numbers n such that n, n+1 and n+2 have odd part of form 4k+3. ; Submitted by <NAME> ; 22,46,54,86,94,110,118,150,174,182,190,214,222,238,246,278,302,310,342,350,366,374,382,406,430,438,446,470,478,494,502,534,558,566,598,606,622,630,662,686,694,702,726,734,750,758,766,790,814,822,854,862,878,886,894,918,942,950,958,982,990,1006,1014,1046,1070,1078,1110,1118,1134,1142,1174,1198,1206,1214,1238,1246,1262,1270,1302,1326,1334,1366,1374,1390,1398,1406,1430,1454,1462,1470,1494,1502,1518,1526,1534,1558,1582,1590,1622,1630 mov $2,$0 add $0,1 add $2,2 pow $2,2 lpb $2 mov $3,$1 seq $3,89013 ; a(n) = (A088567(8n) mod 2). sub $0,$3 add $1,1 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 sub $2,1 lpe mov $0,$1 sub $0,3 mul $0,8 add $0,22
src/matrix/mat_normalize_0_1/src/mat_normalize_0_1.asm
nikAizuddin/lib80386
4
166860
; 1 2 3 4 5 6 7 ;234567890123456789012345678901234567890123456789012345678901234567890 ;===================================================================== ; ; FUNCTION NAME: mat_normalize_0_1 ; FUNCTION DOCUMENTATION: <See doc/description file> ; ; AUTHOR: <NAME> <NAME> ; EMAIL: <EMAIL> ; DATE CREATED: 21-APR-2015 ; ; CONTRIBUTORS: --- ; ; LANGUAGE: x86 Assembly Language ; SYNTAX: Intel ; ASSEMBLER: NASM ; ARCHITECTURE: i386 ; KERNEL: Linux 32-bit ; FORMAT: elf32 ; ; REQ EXTERNAL FILES: vec_normalize_0_1.asm ; ; VERSION: 0.1.0 ; STATUS: Alpha ; BUGS: --- <See doc/bugs/index file> ; ; REVISION HISTORY: <See doc/revision_history/index file> ; ; MIT Licensed. See /LICENSE file. ; ;===================================================================== extern vec_normalize_0_1 global mat_normalize_0_1 section .text mat_normalize_0_1: ;parameter 1) EAX = @srcMatrix : Matrix (Input Only) ;parameter 2) EBX = @dstMatrix : Matrix (Input and Output) ;parameter 3) ECX = flag : DWORD (Input Only) ;returns --- .setup_stackframe: sub esp, 4 mov [esp], ebp mov ebp, esp .set_localvariables: sub esp, 16 mov [esp ], eax ;pSrcMatrix mov [esp + 4], ebx ;pDstMatrix mov [esp + 8], ecx ;flag mov dword [esp + 12], 0 ;i ;Done setup local variables ;Check flag, normalize by row or column? test ecx, ecx jnz .norm_by_column .norm_by_row: ;EDI = pSrcMatrix.numOfRows mov edi, [esp] ;EDI = pSrcMatrix.numOfRows mov edi, [edi] mov [esp + 12], edi ;i = EDI .loop_norm_by_row: mov edi, [esp + 12] ;EDI = i mov eax, [esp ] ;EAX = pSrcMatrix mov ebx, [esp + 4] ;EBX = pDstMatrix mov ecx, 0b00 sub edi, 1 mov [esp + 12], edi ;i = EDI mov edx, edi mov esi, edi call vec_normalize_0_1 mov edi, [esp + 12] ;EDI = i test edi, edi jnz .loop_norm_by_row .endloop_norm_by_row: jmp .clean_stackframe .norm_by_column: ;EDI = pSrcMatrix.numOfColumns mov edi, [esp] ;EDI = pSrcMatrix add edi, (1*4) ;EDI = .numOfColumns mov edi, [edi] mov [esp + 12], edi ;i = EDI .loop_norm_by_column: mov eax, [esp ] ;EAX = pSrcMatrix mov ebx, [esp + 4] ;EBX = pDstMatrix mov ecx, 0b11 sub edi, 1 mov [esp + 12], edi ;i = EDI mov edx, edi mov esi, edi call vec_normalize_0_1 mov edi, [esp + 12] ;EDI = i test edi, edi jnz .loop_norm_by_column .endloop_norm_by_column: .clean_stackframe: mov esp, ebp mov ebp, [esp] add esp, 4 ret
oeis/059/A059014.asm
neoneye/loda-programs
11
3950
<reponame>neoneye/loda-programs<filename>oeis/059/A059014.asm ; A059014: Numbers that have an even number of 0's and an odd number of 1's in binary expansion. ; Submitted by <NAME> ; 1,4,7,16,19,21,22,25,26,28,31,64,67,69,70,73,74,76,79,81,82,84,87,88,91,93,94,97,98,100,103,104,107,109,110,112,115,117,118,121,122,124,127,256,259,261,262,265,266,268,271,273,274,276,279,280,283,285,286,289,290,292,295,296,299,301,302,304,307,309,310,313,314,316,319,321,322,324,327,328,331,333,334,336,339,341,342,345,346,348,351,352,355,357,358,361,362,364,367,369 mul $0,2 trn $0,1 seq $0,59011 ; Odd number of 0's and 1's in binary expansion. add $0,1 div $0,2
alloy4fun_models/trashltl/models/11/cmm2LDEkT5vhDzARJ.als
Kaixi26/org.alloytools.alloy
0
1275
<filename>alloy4fun_models/trashltl/models/11/cmm2LDEkT5vhDzARJ.als<gh_stars>0 open main pred idcmm2LDEkT5vhDzARJ_prop12 { eventually (some f:File | eventually f in Trash implies always f in Trash) } pred __repair { idcmm2LDEkT5vhDzARJ_prop12 } check __repair { idcmm2LDEkT5vhDzARJ_prop12 <=> prop12o }
oeis/109/A109594.asm
neoneye/loda-programs
11
85145
<gh_stars>10-100 ; A109594: n followed by n^3 followed by n^2. ; Submitted by <NAME> ; 1,1,1,2,8,4,3,27,9,4,64,16,5,125,25,6,216,36,7,343,49,8,512,64,9,729,81,10,1000,100,11,1331,121,12,1728,144,13,2197,169,14,2744,196,15,3375,225,16,4096,256,17,4913,289,18,5832,324,19,6859,361,20,8000,400,21,9261,441,22,10648,484,23,12167,529,24,13824,576,25,15625,625,26,17576,676,27,19683,729,28,21952,784,29,24389,841,30,27000,900,31,29791,961,32,32768,1024,33,35937,1089,34 mov $1,$0 mul $0,2 mod $0,3 add $0,1 add $1,3 div $1,3 pow $1,$0 mov $0,$1
MuteScript/MuteGrammar.g4
GeirGrusom/mutescript
0
2775
grammar MuteGrammar; compileUnit: moduleStatement moduleScope EOF ; moduleStatement: 'module' name = ID; moduleScope: (imports += moduleImportStatement)* (types += typeDefinitionStatement)*; moduleImportStatement: 'import' name = ID; typeDefinitionStatement: typeAccess? classDefinition; typeAccess: ('public' | 'private'); classMemberAccess: ('public' | 'private' | 'protected'); classDefinition: (mutable = ('mutable' | 'immutable'))? 'class' name = ID genericArguments? '{' (members += classMember)* '}'; classMember: classMemberAccess? (fieldClassMember | methodClassMember); fieldClassMember: (storageClass = ('mutable' | 'const' | 'immutable'))? name = ID (':' type = dataType)?; methodClassMember :PURE? name = 'new' arguments = tupleDefinition (statementBlock | '=>' expression) |PURE? DEFER name = 'new' arguments = tupleDefinition |PURE? name = ID genericArguments? arguments = tupleDefinition ':' returnType = dataType (statementBlock| '=>' expression) |PURE? DEFER name = ID genericArguments? arguments = tupleDefinition ':' returnType = dataType; genericArguments: '<' (arguments += genericArgument ',')* (arguments += genericArgument) '>'; genericArgument: typeArgument | constArgument; typeArgument: name = ID; constArgument: name = ID ':' constExpression; methodParameter: name = ID ':' type = dataType; dataType: (typeReference | funcDefinition | tupleDefinition | builtInType | rangeType) (nullable = '?')?; rangeType: '[' dataType ']'; builtInType: 'int' | 'bool' | 'float' | 'string' | 'vec2' | 'vec3' | 'vec4' | 'mat4' | 'quat' | 'void' | 'never'; typeReference: (module = ID '.')? name = ID genericArguments?; funcDefinition: 'fn' tupleDefinition; tupleDefinition: '(' ((members += tupleMember ',')* (members += tupleMember))? ')'; tupleMember: storageClass = ('mutable'|'immutable'|'const')? ((name = ID ':' type = dataType) | type = dataType | name = ID '<-' expression); /* Expressions */ statementBlock: '{' (statements += expression)* '}'; variableDefExpression: storageClass = ('mutable'|'const'|'immutable') name = ID ( ':' dataType '<-' expression | ':' dataType| '<-' expression)?; expression: assignmentExpression; /* | indexerExpression | methodCallExpression | 'new' creator | powExpression | multiplicativeExpression | additiveExpression | comparisonExpression | equivalenceExpression | expression '&' expression | expression '^' expression | expression '|' expression | expression '&&' expression | expression '||' expression | expression '?' expression ':' expression | assignmentExpression;*/ unaryExpression : postfixExpression | operator = '-' unaryExpression | operator = 'return' unaryExpression | operator = 'yield' unaryExpression | operator = 'new' typeReference '!' expression ; postfixExpression : primaryExpression | postfixExpression ('[' expression ']' | '.' constInteger) | postfixExpression operator = '.' memberName = ID ; methodCallExpression: unaryExpression | methodCallExpression operator = '!' unaryExpression ; powExpression : multiplicativeExpression | powExpression operator = '^' multiplicativeExpression ; multiplicativeExpression: additiveExpression | multiplicativeExpression operator = ('*'|'/'|'%') additiveExpression ; additiveExpression: methodCallExpression | additiveExpression operator = ('+'|'-') methodCallExpression ; comparisonExpression: powExpression | comparisonExpression operator = ('<=' | '>=' | '>' | '<') powExpression ; logicalOrExpression : logicalAndExpression | logicalOrExpression '||' logicalAndExpression ; logicalAndExpression : equivalenceExpression | logicalAndExpression '&&' equivalenceExpression ; equivalenceExpression : comparisonExpression | equivalenceExpression operator = ('=' | '<>') comparisonExpression ; conditionalExpression : 'if' tupleExpression expression 'else' conditionalExpression ; assignmentExpression : logicalOrExpression | conditionalExpression | unaryExpression | <assoc=right> unaryExpression operator = '<-' assignmentExpression ; primaryExpression : tupleExpression | CONSTANT | STRING | INT | ID ; tupleExpression: '(' (arguments += expression (',' arguments += expression ',')*)? ')'; variableExpression: name = ID; CONSTANT: 'true' | 'false' | 'null' | 'never' | 'void'; constExpression : constInteger | constString; constString: STRING; constInteger: INT; LINE_COMMENT: '//' .*? '\r'? ('\n' | EOF) -> skip; BLOCK_COMMENT: '/*' .*? '*/' -> skip; STRING: '"' STRING_CHAR*? '"'; fragment STRING_CHAR: . | EscapeSequence; fragment EscapeSequence: '\\' ['"?abfnrtv\\]; WS: [ \t]+ -> skip; IGNORE: [;] -> skip; NL: ('\n' | '\r' '\n') -> skip; MUL_OPERATORS: ('*' | '/' | '%'); ADD_OPERATORS: ('+' | '-'); ID_HEAD: ('a' .. 'z')|('A' .. 'Z')|'_'; ID_TAIL: ('a' .. 'z')|('A' .. 'Z')|('0' .. '9')|'_'; ID: ID_HEAD ID_TAIL*; INT: ('1' .. '9')('0' .. '9')*|'0'; FLOAT: '-'?(INT '.' INT|'.'INT); PURE: 'pure'; DEFER: 'defer';
darkadapted/adjust-brightness.applescript
michaelhogg/configs
2
4641
set MIN_VALUE to 64 set MAX_VALUE to 255 set STEP_SIZE to 30 set RED_FACTOR to 1.0 set GREEN_FACTOR to 0.635 set BLUE_FACTOR to 0.295 on brighter(brightness) global MAX_VALUE, STEP_SIZE set brightness to brightness + STEP_SIZE if brightness > MAX_VALUE then set brightness to MAX_VALUE end if return brightness end brighter on darker(brightness) global MIN_VALUE, STEP_SIZE set brightness to brightness - STEP_SIZE if brightness < MIN_VALUE then set brightness to MIN_VALUE end if return brightness end darker tell application "DarkAdapted" set rgb to getGamma end tell set oldDelimiters to AppleScript's text item delimiters set AppleScript's text item delimiters to "," set rgb to every text item of rgb set AppleScript's text item delimiters to oldDelimiters set red to (item 1 of rgb as integer) set green to (item 2 of rgb as integer) set blue to (item 3 of rgb as integer) # log "old rgb = " & red & "," & green & "," & blue set brightness to brighter(red) # set brightness to darker(red) set red to (brightness * RED_FACTOR) as integer set green to (brightness * GREEN_FACTOR) as integer set blue to (brightness * BLUE_FACTOR) as integer set newrgb to "" & red & "," & green & "," & blue # log "new rgb = " & newrgb tell application "DarkAdapted" setGamma value newrgb end tell
libsrc/stdio/aquarius/fputc_cons.asm
grancier/z180
0
85683
<filename>libsrc/stdio/aquarius/fputc_cons.asm<gh_stars>0 ; ; Mattel Aquarius Routines ; ; Print character to the screen ; ; We can corrupt any register ; ; ; $Id: fputc_cons.asm,v 1.3 2016/05/15 20:15:45 dom Exp $ ; SECTION code_clib PUBLIC fputc_cons_native ; ; Entry: char to print ; .fputc_cons_native ld hl,2 add hl,sp ld a,(hl); Now A contains the char IF STANDARDESCAPECHARS cp 10 ; CR ? jr nz,nocrlf call $1d72 ld a,13 ELSE cp 13 jr nz,nocrlf call $1d72 ld a,10 ENDIF .nocrlf cp 12 jr nz,nocls ld a,$b .nocls jp $1d72
libsrc/_DEVELOPMENT/input/zx/c/sdcc_iy/in_key_pressed_fastcall.asm
meesokim/z88dk
0
86438
; int in_key_pressed_fastcall(uint16_t scancode) SECTION code_input PUBLIC _in_key_pressed_fastcall EXTERN asm_in_key_pressed defc _in_key_pressed_fastcall = asm_in_key_pressed
oeis/142/A142696.asm
neoneye/loda-programs
11
170711
<filename>oeis/142/A142696.asm ; A142696: Primes congruent to 50 mod 57. ; Submitted by <NAME> ; 107,449,563,677,1019,1361,1931,2273,2729,2843,2957,3299,3413,3527,4211,5009,5237,5351,5693,5807,6263,6491,6719,6833,6947,7517,8087,8429,8543,8999,9227,9341,10139,10253,10709,10937,11279,11393,11621,12647,13103,13217,13331,13901,14243,14699,14813,15269,15383,15497,16067,16979,17093,17207,17321,17891,18119,18233,18461,18803,18917,19031,19259,19373,20399,20627,21767,21881,22109,22679,22907,23021,23819,25073,25301,25643,26099,26669,26783,27011,27239,27581,27809,28151,28493,28607,28949,29063,29633 mov $1,53 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $2,1 mov $3,$1 mul $3,2 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,57 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,113
oeis/263/A263646.asm
neoneye/loda-programs
11
163358
; A263646: Coefficients for an expansion of the Schwarzian derivative of a power series. ; Submitted by <NAME> ; 1,1,2,1,3,1,1,4,1,1,5,1,1,1,6,1,1,1,7,1,1,1,1,8,1,1,1,1,9,1,1,1,1,1,10,1,1,1,1,1,11,1,1,1,1,1,1,12,1,1,1,1,1,1,13,1,1,1,1,1,1,1,14,1,1,1,1,1,1,1,15,1,1,1,1,1,1,1,1,16,1,1,1,1,1,1,1,1,17,1,1,1,1,1,1,1,1,1 lpb $0 mov $2,$0 lpb $0 mov $0,$2 sub $0,1 add $1,1 sub $2,$1 sub $2,1 add $2,$3 cmp $4,0 add $3,$4 lpe sub $0,$3 lpe mov $0,$1 add $0,1
oeis/209/A209239.asm
neoneye/loda-programs
11
88582
; A209239: Number of length n words on {0,1,2} with no four consecutive 0's. ; Submitted by <NAME> ; 1,3,9,27,80,238,708,2106,6264,18632,55420,164844,490320,1458432,4338032,12903256,38380080,114159600,339561936,1010009744,3004222720,8935908000,26579404800,79059090528,235157252096,699463310848 add $0,2 mov $2,1 lpb $0 sub $0,1 add $5,$1 mov $1,$3 sub $3,$4 mov $4,$2 mov $2,$3 mul $5,2 add $5,$4 mov $3,$5 lpe mov $0,$3 div $0,2
programs/oeis/333/A333996.asm
jmorken/loda
1
16420
<gh_stars>1-10 ; A333996: Number of composite numbers in the triangular n X n multiplication table. ; 0,1,3,7,11,17,23,31,40,50,60,72,84,98,113,129,145,163,181,201,222,244,266,290,315,341,368,396,424,454,484,516,549,583,618,654,690,728,767,807,847,889,931,975,1020,1066,1112,1160,1209,1259,1310,1362,1414 mov $2,$0 mov $3,$0 add $3,1 lpb $3 mov $0,$2 sub $3,1 sub $0,$3 mov $4,$0 add $4,1 cal $0,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $4,$0 add $1,$4 lpe sub $1,1
P6/data_P6_2/MDTest83.asm
alxzzhou/BUAA_CO_2020
1
81899
<filename>P6/data_P6_2/MDTest83.asm ori $ra,$ra,0xf srav $4,$4,$2 mflo $5 sll $5,$5,20 lui $4,2499 mtlo $4 srav $6,$0,$6 multu $1,$4 mtlo $3 mfhi $4 div $0,$ra mtlo $2 mfhi $6 mflo $4 ori $0,$2,8352 mflo $3 lui $5,11005 srav $2,$2,$1 lui $3,21437 sll $5,$2,27 lb $5,9($0) sb $4,10($0) multu $5,$1 srav $5,$4,$6 ori $1,$1,59312 srav $2,$2,$2 addu $6,$5,$1 addiu $5,$6,-20254 mult $6,$4 mfhi $4 lui $2,10090 srav $4,$2,$2 multu $4,$5 mflo $4 addiu $5,$5,-4930 ori $5,$4,54756 mtlo $0 srav $6,$4,$5 multu $2,$4 ori $4,$4,63219 mflo $4 addiu $4,$4,22910 addiu $1,$4,-19700 mtlo $3 srav $4,$2,$0 multu $4,$1 sb $3,15($0) lb $5,4($0) mflo $4 ori $1,$2,52799 multu $0,$4 lui $3,45869 srav $5,$6,$5 mfhi $5 sb $6,15($0) mflo $4 ori $3,$4,52852 mflo $4 srav $1,$6,$1 mfhi $4 addu $1,$2,$2 addu $1,$2,$5 sb $5,15($0) mtlo $2 mult $1,$1 mtlo $4 srav $1,$1,$1 addiu $2,$2,20372 div $4,$ra addiu $6,$1,-1551 lui $5,15030 div $5,$ra mflo $4 ori $1,$1,608 div $3,$ra multu $5,$5 addiu $4,$2,-15649 mflo $4 addiu $4,$4,15774 addiu $4,$4,-13354 mfhi $5 mfhi $6 mfhi $6 lb $4,10($0) lui $5,898 multu $0,$2 lui $1,33313 mflo $5 srav $1,$1,$1 addu $6,$3,$3 addiu $0,$1,10340 mflo $4 div $1,$ra lui $4,101 mthi $6 addu $1,$1,$2 lui $4,3529 lui $4,37943 mflo $4 srav $0,$4,$5 lui $0,32124 mfhi $3 div $1,$ra mflo $3 addiu $4,$1,6077 mult $6,$6 mflo $3 sll $6,$4,11 sll $5,$5,27 div $2,$ra sb $4,6($0) ori $1,$0,27997 addu $1,$1,$1 srav $5,$5,$4 sll $1,$1,25 mtlo $2 multu $1,$2 mtlo $4 sb $1,12($0) mflo $5 lb $0,0($0) divu $0,$ra lui $0,24699 divu $4,$ra div $5,$ra mult $1,$4 multu $6,$6 mult $1,$1 multu $2,$5 mtlo $6 addu $0,$1,$1 mtlo $5 mult $1,$4 mtlo $2 lui $5,12091 lb $6,10($0) mfhi $1 sll $4,$4,18 mfhi $2 mthi $4 srav $4,$2,$2 sll $6,$4,11 lui $1,30985 mtlo $2 srav $0,$5,$1 lui $4,40055 sll $5,$5,29 ori $4,$4,17947 addu $6,$5,$1 mthi $4 srav $6,$6,$1 mult $2,$2 addiu $1,$4,32193 div $4,$ra sb $4,9($0) sll $6,$3,31 lb $6,14($0) sll $5,$2,6 divu $4,$ra div $4,$ra sb $4,6($0) divu $6,$ra lb $1,15($0) lui $1,19135 mult $0,$4 lb $1,15($0) divu $6,$ra srav $4,$4,$1 mthi $1 mflo $1 mult $3,$4 mfhi $3 sll $4,$0,14 mtlo $2 mthi $2 mult $2,$2 lui $0,48763 ori $5,$1,31079 mult $5,$4 mult $6,$2 mult $2,$5 srav $5,$4,$4 lb $1,3($0) multu $5,$1 ori $1,$4,44601 ori $2,$6,20572 lb $1,9($0) mtlo $4 ori $2,$2,35116 addu $6,$3,$3 mult $0,$5 lui $4,16458 mflo $0 mtlo $4 multu $0,$1 mthi $3 ori $4,$3,22667 lui $2,45700 mthi $6 addu $6,$4,$6 addu $1,$2,$3 sll $1,$5,15 mfhi $5 addu $4,$0,$3 mflo $5 srav $5,$4,$3 sll $5,$0,12 sb $1,10($0) mthi $4 mflo $4 mfhi $1 mthi $6 sb $4,11($0) sll $3,$3,23 divu $5,$ra lui $6,56183 addu $1,$3,$3 addu $1,$4,$5 mult $1,$1 sb $6,7($0) sll $1,$2,29 mult $6,$0 lui $1,58345 lb $5,13($0) div $5,$ra mult $5,$2 sb $4,9($0) mflo $4 mult $1,$2 div $3,$ra lb $6,6($0) lui $2,55632 mult $3,$4 ori $5,$2,58884 lui $1,3325 sb $4,2($0) sb $3,5($0) lui $6,47644 lui $1,32249 lb $3,14($0) mflo $2 mult $1,$1 mflo $6 mult $6,$4 addiu $1,$1,1602 ori $5,$5,58104 mult $5,$2 divu $1,$ra mflo $0 mfhi $6 mtlo $1 lui $5,29876 sll $4,$6,25 divu $4,$ra multu $6,$1 ori $6,$0,34384 ori $4,$5,51376 mult $4,$4 srav $4,$5,$6 addiu $1,$0,10991 mfhi $4 divu $5,$ra mult $4,$4 sll $4,$4,12 mthi $4 sll $5,$5,20 sb $6,2($0) addu $6,$2,$1 divu $6,$ra addiu $4,$1,-13720 mflo $1 sb $1,5($0) addiu $4,$4,16433 mflo $1 mult $1,$4 ori $5,$2,55216 mthi $1 multu $4,$1 mflo $5 mtlo $4 ori $4,$1,19855 mfhi $0 addu $2,$2,$1 ori $1,$6,1376 sll $4,$4,7 sll $4,$5,19 mtlo $4 mflo $1 sll $5,$2,16 mthi $5 sb $4,13($0) div $4,$ra mthi $5 mfhi $5 ori $4,$5,19418 mflo $3 ori $5,$1,24152 mfhi $3 ori $1,$6,8730 div $1,$ra sb $4,11($0) mfhi $5 mtlo $6 mthi $5 mult $6,$1 addu $4,$2,$3 addu $5,$6,$5 ori $5,$1,34503 sll $0,$4,3 sll $0,$0,3 mthi $1 addiu $2,$2,-29609 addu $4,$4,$4 lb $5,14($0) mflo $1 addu $4,$0,$1 addu $1,$1,$1 srav $4,$4,$4 lui $1,29946 mult $0,$0 mtlo $4 mult $1,$1 div $4,$ra addiu $1,$2,5710 srav $3,$5,$3 mult $1,$1 lb $1,11($0) addiu $5,$2,-10398 multu $2,$2 sb $4,2($0) addiu $5,$2,8638 mfhi $1 mfhi $1 mflo $5 mflo $1 lb $4,5($0) addu $0,$4,$4 mtlo $4 addiu $3,$3,2743 mult $2,$2 div $3,$ra mult $1,$4 sll $6,$2,28 sb $6,10($0) addu $4,$4,$4 lui $4,10515 srav $4,$4,$2 multu $0,$1 mfhi $5 div $0,$ra lui $4,13374 addiu $3,$4,-177 ori $5,$2,9113 addiu $4,$2,16639 srav $4,$4,$3 mult $5,$4 div $4,$ra lb $5,10($0) addu $3,$6,$3 lui $1,55338 srav $5,$1,$3 multu $1,$4 lui $1,22870 addu $4,$1,$5 mfhi $4 lui $5,52582 lb $1,0($0) mthi $4 lui $4,60033 div $1,$ra ori $2,$1,17615 srav $4,$4,$5 div $5,$ra lb $2,7($0) mthi $1 multu $0,$6 mfhi $5 mflo $6 div $3,$ra mtlo $5 srav $5,$1,$4 mthi $1 ori $4,$4,34340 mflo $2 divu $6,$ra multu $0,$4 multu $4,$4 sb $5,7($0) mflo $5 multu $1,$4 divu $2,$ra mtlo $1 mthi $4 lb $0,1($0) addiu $3,$1,26988 lui $4,33309 div $4,$ra mflo $5 lb $2,7($0) mfhi $1 divu $1,$ra sb $0,2($0) divu $1,$ra sb $4,10($0) mfhi $1 addu $5,$6,$5 sll $4,$4,2 lui $5,30664 multu $3,$3 multu $4,$5 multu $5,$5 addiu $6,$5,2299 lb $6,16($0) mtlo $1 addu $2,$5,$2 sll $4,$1,10 div $5,$ra divu $3,$ra addu $3,$0,$3 sll $0,$6,13 divu $5,$ra mult $4,$4 addiu $2,$2,28623 ori $0,$6,18012 div $6,$ra lui $5,29080 srav $1,$1,$3 multu $1,$5 mthi $5 mfhi $1 divu $4,$ra mult $4,$4 mult $6,$6 srav $3,$5,$3 sb $1,3($0) sb $5,3($0) multu $4,$4 mflo $1 addiu $4,$4,-29923 mult $4,$0 mfhi $6 sll $0,$6,20 addiu $4,$1,-12341 mtlo $1 mtlo $0 mfhi $5 addiu $3,$3,5748 sll $1,$2,1 mflo $0 mult $4,$4 addiu $4,$4,10005 div $6,$ra mfhi $4 mtlo $0 ori $2,$2,18123 divu $2,$ra lui $5,45493 div $1,$ra lui $0,53369 mtlo $1 mtlo $4 mfhi $1 multu $1,$2 mfhi $4 mthi $3 mthi $1 mflo $5 sll $6,$2,10 srav $4,$2,$1 sb $1,13($0) div $5,$ra mtlo $4 sb $5,0($0) addu $5,$1,$0 multu $2,$4 mthi $0 divu $4,$ra lb $5,6($0) sll $5,$1,7 mfhi $5 sll $3,$0,1 addu $2,$2,$5 sll $5,$4,29 mfhi $2 mflo $2 sll $4,$4,2 addu $3,$6,$3 sll $4,$2,13 multu $5,$5 lui $3,64363 mfhi $1 mfhi $1 divu $2,$ra sb $4,7($0) sb $5,3($0) lb $0,6($0) lui $6,17437 multu $0,$6 mflo $5 addu $1,$3,$3 addiu $6,$6,-2655 mfhi $6 lb $4,10($0) div $5,$ra sb $5,6($0) mtlo $4 mtlo $4 mthi $1 div $5,$ra divu $4,$ra lui $6,16775 divu $0,$ra sb $4,0($0) mtlo $4 div $4,$ra div $6,$ra div $0,$ra sb $0,15($0) lb $5,14($0) div $2,$ra sll $4,$2,24 divu $1,$ra sll $4,$4,24 sll $0,$4,5 mtlo $4 mtlo $1 div $4,$ra addiu $3,$4,-29460 mult $5,$1 mtlo $5 multu $2,$2 div $4,$ra lui $5,64442 lb $2,1($0) mthi $5 addiu $4,$4,-823 lui $3,15571 addu $4,$4,$3 mtlo $3 mthi $6 addiu $5,$5,-5097 mult $4,$1 divu $3,$ra div $6,$ra div $4,$ra lb $4,2($0) multu $1,$1 divu $2,$ra addiu $2,$2,-26892 sb $1,7($0) lui $0,12191 mtlo $5 lui $4,10158 srav $4,$5,$4 ori $5,$5,1930 ori $4,$1,30736 addiu $4,$5,15447 mflo $1 multu $2,$4 mtlo $3 lui $0,56548 mtlo $5 addu $4,$4,$4 addiu $6,$5,27531 divu $3,$ra div $4,$ra mfhi $1 multu $4,$2 multu $4,$1 lb $1,1($0) srav $4,$4,$4 sll $2,$2,24 sb $4,0($0) addu $5,$5,$3 addiu $0,$4,22302 sb $3,7($0) mflo $1 mult $5,$5 mtlo $4 mthi $5 lb $5,3($0) sll $4,$1,7 mtlo $5 sll $4,$1,26 mtlo $5 mflo $0 mfhi $0 sb $1,7($0) sb $4,14($0) srav $3,$3,$3 ori $4,$2,9431 lb $4,11($0) multu $0,$2 srav $3,$2,$3 mtlo $4 lb $0,16($0) mtlo $3 divu $4,$ra ori $4,$2,16390 addu $4,$4,$4 lui $4,42751 mult $2,$2 multu $4,$5 lb $1,6($0) addu $0,$2,$0 addiu $1,$1,-26916 addu $1,$1,$1 sb $3,14($0) ori $4,$0,56139 lui $6,15266 srav $1,$4,$2 srav $5,$5,$3 srav $5,$2,$2 mult $0,$0 mfhi $5 multu $2,$2 addiu $4,$1,-11902 srav $0,$2,$2 mthi $5 mfhi $4 mfhi $1 sb $0,11($0) multu $1,$1 sb $3,13($0) sll $5,$2,15 mthi $3 multu $5,$2 div $1,$ra sb $4,0($0) sb $1,0($0) multu $4,$2 addiu $3,$2,14011 addiu $2,$1,6646 lb $5,0($0) div $5,$ra mthi $1 srav $4,$4,$4 ori $1,$5,867 mult $2,$4 sll $3,$4,9 mult $4,$0 sll $4,$2,28 mfhi $6 mult $4,$4 mult $5,$1 ori $0,$2,37182 mflo $5 ori $4,$6,11162 addu $1,$5,$5 mult $4,$1 addiu $4,$4,-32243 mult $6,$4 mflo $6 divu $5,$ra addiu $1,$5,-25933 lui $1,226 sll $1,$0,29 lui $4,6995 addu $0,$5,$3 mthi $3 addiu $0,$0,-5173 addu $1,$0,$1 sll $2,$2,0 mult $4,$6 mult $1,$5 mflo $2 mthi $4 div $5,$ra srav $0,$0,$0 multu $5,$4 mfhi $2 lui $5,23240 sll $2,$0,16 sll $1,$2,3 mthi $6 lb $6,4($0) lb $4,1($0) mfhi $6 lb $4,10($0) addu $5,$4,$4 sb $2,3($0) sb $4,15($0) mfhi $2 addu $4,$2,$4 multu $1,$0 mflo $0 divu $5,$ra sb $1,6($0) mfhi $1 multu $6,$6 addu $4,$3,$3 mtlo $4 divu $3,$ra lui $4,47777 ori $5,$2,16679 mult $2,$2 divu $1,$ra mult $1,$4 sll $1,$2,28 div $1,$ra mfhi $1 mflo $2 mflo $3 addiu $4,$5,-17936 mtlo $1 lui $4,7488 srav $0,$1,$3 addiu $4,$5,-23567 srav $0,$2,$1 mult $5,$2 lui $5,3942 lui $4,16509 sll $3,$2,13 srav $3,$3,$3 mfhi $3 addu $5,$5,$4 addu $4,$3,$3 multu $3,$3 mfhi $6 mult $4,$4 sb $5,8($0) lb $5,8($0) ori $0,$0,26081 lui $1,64146 srav $6,$6,$3 addiu $5,$5,-31694 addiu $2,$2,-19556 sb $0,14($0) lui $1,19773 divu $2,$ra mult $5,$5 addiu $4,$5,3285 ori $2,$2,32326 lb $4,10($0) mfhi $6 mtlo $1 lb $4,15($0) sll $4,$4,17 mfhi $3 mtlo $6 divu $4,$ra ori $4,$6,12950 srav $4,$4,$2 mflo $0 sb $2,11($0) addiu $5,$1,15038 mult $2,$2 addu $0,$4,$0 mult $4,$4 sb $4,14($0) lb $4,16($0) addu $6,$4,$6 multu $5,$2 mthi $2 lui $2,51008 sb $4,16($0) sb $1,0($0) mfhi $1 sll $1,$2,28 divu $1,$ra ori $4,$4,40213 lb $2,0($0) addiu $5,$4,24289 mfhi $5 mflo $1 addiu $5,$5,-9368 mtlo $1 addu $5,$5,$3 ori $5,$4,47751 div $3,$ra srav $1,$4,$1 mult $2,$2 mflo $4 mtlo $5 addiu $4,$2,14488 multu $5,$2 multu $4,$0 divu $4,$ra mtlo $0 multu $5,$0 lui $4,59046 sll $1,$2,11 lb $3,7($0) mult $5,$6 lb $0,14($0) sb $4,11($0) mflo $4 sll $4,$0,21 addu $5,$4,$2 addiu $1,$1,14530 ori $4,$2,33718 lb $3,8($0) lb $1,16($0) mult $1,$5 multu $6,$1 sll $4,$1,3 ori $1,$0,60810 srav $6,$5,$5 ori $4,$0,11500 lui $4,40287 addu $5,$4,$4 lb $2,5($0) sb $1,2($0) lb $2,0($0) mfhi $5 mthi $5 mult $4,$1 mthi $1 multu $3,$2 ori $1,$2,63228 addu $1,$4,$1 lb $4,4($0) srav $5,$4,$2 div $4,$ra sll $4,$2,30 div $2,$ra srav $5,$4,$3 sb $4,3($0) mtlo $0 divu $2,$ra div $4,$ra multu $6,$0 multu $5,$5 mflo $6 multu $6,$6 div $3,$ra addiu $2,$2,10087 mfhi $3 multu $4,$2 mult $1,$5 addu $4,$3,$3 mflo $1 lui $4,41057 mult $5,$4 mthi $1 addiu $3,$1,-9071 mfhi $4 mthi $6 mthi $5 mflo $2 mfhi $4 mult $5,$4 sb $1,3($0) sll $4,$2,29 addiu $4,$1,-6382 srav $4,$4,$0 divu $3,$ra mthi $6 sll $5,$2,29 srav $5,$2,$5 divu $2,$ra mfhi $4 divu $5,$ra lui $2,1207 lui $3,64170 multu $4,$4 div $5,$ra srav $5,$0,$0 mfhi $6 divu $6,$ra srav $4,$4,$4 div $0,$ra mflo $4 lui $3,24789 mflo $4 lb $1,15($0) lb $1,9($0) srav $3,$4,$3 lui $5,9501 mult $4,$4 mult $4,$2 divu $4,$ra sb $4,4($0) sll $3,$3,25 div $4,$ra mtlo $1 div $4,$ra lui $6,62527 lb $1,13($0) addu $6,$4,$3 mflo $4 ori $4,$1,48986 mfhi $2 srav $1,$4,$4 srav $6,$4,$2 mfhi $6 mflo $0 mflo $5 ori $4,$5,18927
src/support_utils/support_utils-developer_parameters.adb
lenzomj/whitakers-words
204
28600
-- WORDS, a Latin dictionary, by <NAME> (USAF, Retired) -- -- Copyright <NAME> (1936–2010) -- -- This is a free program, which means it is proper to copy it and pass -- it on to your friends. Consider it a developmental item for which -- there is no charge. However, just for form, it is Copyrighted -- (c). Permission is hereby freely given for any and all use of program -- and data. You can sell it as your own, but at least tell me. -- -- This version is distributed without obligation, but the developer -- would appreciate comments and suggestions. -- -- All parts of the WORDS system, source code and data files, are made freely -- available to anyone who wishes to use them, for whatever purpose. with Ada.Text_IO; use Ada.Text_IO; with Latin_Utils.Strings_Package; use Latin_Utils.Strings_Package; -- Omit when Put name here with Latin_Utils.Config; with Latin_Utils.Latin_File_Names; use Latin_Utils.Latin_File_Names; with Support_Utils.Word_Parameters; use Support_Utils.Word_Parameters; with Latin_Utils.Dictionary_Package; use Latin_Utils.Dictionary_Package; with Latin_Utils.Preface; with Support_Utils.Line_Stuff; use Support_Utils.Line_Stuff; use Latin_Utils; pragma Elaborate (Latin_Utils.Preface); package body Support_Utils.Developer_Parameters is type Help_Type is array (Natural range <>) of String (1 .. 70); Blank_Help_Line : constant String (1 .. 70) := (others => ' '); No_Help : constant Help_Type := (2 .. 1 => Blank_Help_Line); type Reply_Type is (N, Y); package Reply_Type_Io is new Ada.Text_IO.Enumeration_IO (Reply_Type); Reply : constant array (Boolean) of Reply_Type := (N, Y); Mdev_Of_Reply : constant array (Reply_Type) of Boolean := (False, True); Blank_Input : exception; -- The default MDEVs are set in the body so that they can be changed -- with only this being recompiled, not the rest of the with'ing system Default_Mdev_Array : constant Mdev_Array := ( -- HAVE_DEBUG_FILE => FALSE, -- WRITE_DEBUG_FILE => FALSE, Have_Statistics_File => False, Write_Statistics_File => False, Show_Dictionary => False, Show_Dictionary_Line => False, Show_Dictionary_Codes => True, Do_Pearse_Codes => False, Do_Only_Initial_Word => False, For_Word_List_Check => False, Do_Only_Fixes => False, Do_Fixes_Anyway => False, Use_Prefixes => True, Use_Suffixes => True, Use_Tackons => True, Do_Medieval_Tricks => True, Do_Syncope => True, Do_Two_Words => True, Include_Unknown_Context => True, No_Meanings => False, Omit_Archaic => True, Omit_Medieval => False, Omit_Uncommon => True, Do_I_For_J => False, Do_U_For_V => False, Pause_In_Screen_Output => True, No_Screen_Activity => False, Update_Local_Dictionary => False, Update_Meanings => False, Minimize_Output => True); Bad_Mdev_File : exception; --HAVE_DEBUG_FILE_HELP : constant HELP_TYPE := ( -- "This option instructs the program to Create a file which can hold ", -- "certain internal information about the current search. The file is ", -- "overwritten for every word in order to prevent it from growing out of ", -- "hand, so information about the last word searched is saved in case of ", -- "failure. The debug Output file is named " & DEBUG_FULL_NAME -- & (42+DEBUG_FULL_NAME'LENGTH .. 70 => ' '), -- "Use of this option, along with the WRITE_DEBUG_FILE option may slow ", -- "the program significantly. This information is usually only useful ", -- "to the developer, so the default is N(o). "); -- --WRITE_DEBUG_FILE_HELP : constant HELP_TYPE := ( -- "This option instructs the program, when HAVE_DEBUG_FILE is on, to Put ", -- "some debug data to a file named " & DEBUG_FULL_NAME -- & (33+DEBUG_FULL_NAME'LENGTH .. 70 => ' '), -- "This option may be turned on and off while running of the program, " -- "thereby capturing only certain desired results. The file is reset and", -- "restarted after each word parsed, so that it does not Get too big. ", -- "If the option HAVE_DEBUG_FILE is off, the user will not be given a ", -- "chance to turn this one on. Default is N(o). "); -- Have_Statistics_File_Help : constant Help_Type := ( "This option instructs the program to Create a file which can hold ", "certain statistical information about the process. The file is ", "overwritten for new invocation of the program, so old data must be ", "explicitly saved if it is to be retained. The statistics are in TEXT ", "format. The statistics file is named " & Stats_Full_Name & (42 + Stats_Full_Name'Length .. 70 => ' '), "This information is only of development use, so the default is N(o). "); Write_Statistics_File_Help : constant Help_Type := ( "This option instructs the program, with HAVE_STATISTICS_FILE, to Put ", "derived statistics in a file named " & Stats_Full_Name & (36 + Stats_Full_Name'Length .. 70 => ' '), "This option may be turned on and off while running of the program, ", "thereby capturing only certain desired results. The file is reset at ", "each invocation of the program, if the HAVE_STATISTICS_FILE is set. ", "If the option HAVE_STATISTICS_FILE is off, the user will not be given ", "a chance to turn this one on. Default is N(o). "); Show_Dictionary_Help : constant Help_Type := ( "This option causes a flag, like 'GEN>' to be Put before the meaning ", "in the Output. While this is useful for certain development purposes,", "it forces off a few Characters from the meaning, and is really of no ", "interest to most users. ", "The default choice is N(o), but it can be turned on with a Y(es). "); Show_Dictionary_Line_Help : constant Help_Type := ( "This option causes the number of the dictionary line for the current ", "meaning to be Output. This is of use to no one but the dictionary ", "maintainer. The default choice is N(o). It is activated by Y(es). "); Show_Dictionary_Codes_Help : constant Help_Type := ( "This option causes the codes for the dictionary entry for the current ", "meaning to be Output. This may not be useful to any but the most ", "involved user. The default choice is N(o). It is activated by Y(es)."); Do_Pearse_Codes_Help : constant Help_Type := ( "This option causes special codes to be Output flagging the different ", "kinds of Output lines. 01 for forms, 02 for dictionary forms, and ", "03 for meaning. The default choice is N(o). It is activated by Y(es).", "There are no Pearse codes in English mode. "); Do_Only_Initial_Word_Help : constant Help_Type := ( "This option instructs the program to only analyze the initial word on ", "each line submitted. This is a tool for checking and integrating new ", "dictionary Input, and will be of no interest to the general user. ", "The default choice is N(o), but it can be turned on with a Y(es). "); For_Word_List_Check_Help : constant Help_Type := ( "This option works in conjunction with DO_ONLY_INITIAL_WORD to allow ", "the processing of scanned dictionaries or text word lists. It accepts", "only the forms common in dictionary entries, like NOM S for N or ADJ, ", "or PRES ACTIVE IND 1 S for V. It is be used only with DO_INITIAL_WORD", "The default choice is N(o), but it can be turned on with a Y(es). "); Do_Only_Fixes_Help : constant Help_Type := ( "This option instructs the program to ignore the normal dictionary ", "search and to go direct to attach various prefixes and suffixes before", "processing. This is a pure research tool. It allows one to examine ", "the coverage of pure stems and dictionary primary compositions. ", "This option is only available if DO_FIXES is turned on. ", "This is entirely a development and research tool, not to be used in ", "conventional translation situations, so the default choice is N(o). ", "This processing can be turned on with the choice of Y(es). "); Do_Fixes_Anyway_Help : constant Help_Type := ( "This option instructs the program to do both the normal dictionary ", "search and then process for the various prefixes and suffixes too. ", "This is a pure research tool allowing one to consider the possibility ", "of strange constructions, even in the presence of conventional ", "results, e.g., alte => deeply (ADV), but al+t+e => wing+ed (ADJ VOC) ", "(If multiple suffixes were supported this could also be wing+ed+ly.) ", "This option is only available if DO_FIXES is turned on. ", "This is entirely a development and research tool, not to be used in ", "conventional translation situations, so the default choice is N(o). ", "This processing can be turned on with the choice of Y(es). ", " ------ PRESENTLY NOT IMPLEMENTED ------ "); Use_Prefixes_Help : constant Help_Type := ( "This option instructs the program to implement prefixes from ADDONS ", "whenever and wherever FIXES are called for. The purpose of this ", "option is to allow some flexibility while the program in running to ", "select various combinations of fixes, to turn them on and off, ", "individually as well as collectively. This is an option usually ", "employed by the developer while experimenting with the ADDONS file. ", "This option is only effective in connection with DO_FIXES. ", "This is primarily a development tool, so the conventional user should ", "probably maintain the default choice of Y(es). "); Use_Suffixes_Help : constant Help_Type := ( "This option instructs the program to implement suffixes from ADDONS ", "whenever and wherever FIXES are called for. The purpose of this ", "option is to allow some flexibility while the program in running to ", "select various combinations of fixes, to turn them on and off, ", "individually as well as collectively. This is an option usually ", "employed by the developer while experimenting with the ADDONS file. ", "This option is only effective in connection with DO_FIXES. ", "This is primarily a development tool, so the conventional user should ", "probably maintain the default choice of Y(es). "); Use_Tackons_Help : constant Help_Type := ( "This option instructs the program to implement TACKONS from ADDONS ", "whenever and wherever FIXES are called for. The purpose of this ", "option is to allow some flexibility while the program in running to ", "select various combinations of fixes, to turn them on and off, ", "individually as well as collectively. This is an option usually ", "employed by the developer while experimenting with the ADDONS file. ", "This option is only effective in connection with DO_FIXES. ", "This is primarily a development tool, so the conventional user should ", "probably maintain the default choice of Y(es). "); Do_Medieval_Tricks_Help : constant Help_Type := ( "This option instructs the program, when it is unable to find a proper ", "match in the dictionary, and after various prefixes and suffixes, and ", "trying every Classical Latin trick it can think of, to go to a few ", "that are usually only found in medieval Latin, replacements of z -> di", "caul -> col, st -> est, ix -> is, nct -> nt. It also tries some things", "like replacing doubled consonants in classical with a single one. ", "Together these tricks are useful, but may give False Positives (>20%).", "This option is only available if the general DO_TRICKS is chosen. ", "If the text is late or medieval, this option is much more useful than ", "tricks for classical. The dictionary can never contain all spelling ", "variations found in medieval Latin, but some constructs are common. ", "The default choice is N(o), since the results are iffy, medieval only,", "and expensive. This processing is turned on with the choice of Y(es)."); Do_Syncope_Help : constant Help_Type := ( "This option instructs the program to postulate that syncope of ", "perfect stem verbs may have occurred (e.g, aver -> ar in the perfect),", "and to try various possibilities for the insertion of a removed 'v'. ", "To do this it has to fully process the modified candidates, which can ", "have a considerable impact on the speed of processing a large file. ", "However, this trick seldom produces a False Positive, and syncope is ", "very common in Latin (first year texts excepted). Default is Y(es). ", "This processing is turned off with the choice of N(o). "); Do_Two_Words_Help : constant Help_Type := ( "There are some few common Latin expressions that combine two inflected", "words (e.g. respublica, paterfamilias). There are numerous examples ", "of numbers composed of two words combined together. ", "Sometimes a text or inscription will have words run together. ", "When WORDS is unable to reach a satisfactory solution with all other ", "tricks, as a last stab it will try to break the Input into two words. ", "This most often fails. Even if mechanically successful, the result is", "usually False and must be examined by the user. If the result is ", "correct, it is probably clear to the user. Otherwise, beware. . ", "Since this is a last chance and infrequent, the default is Y(es); ", "This processing is turned off with the choice of N(o). "); Include_Unknown_Context_Help : constant Help_Type := ( "This option instructs the program, when writing to an UNKNOWNS file, ", "to Put out the whole context of the UNKNOWN (the whole Input line on ", "which the UNKNOWN was found). This is appropriate for processing ", "large text files in which it is expected that there will be relatively", "few UNKNOWNS. The main use at the moment is to provide display ", "of the Input line on the Output file in the case of UNKNOWNS_ONLY. "); No_Meanings_Help : constant Help_Type := ( "This option instructs the program to omit Putting out meanings. ", "This is only useful for certain dictionary maintenance procedures. ", "The combination not DO_DICTIONARY_FORMS, MEANINGS_ONLY, NO_MEANINGS ", "results in no visible Output, except spacing lines. Default is N)o."); Omit_Archaic_Help : constant Help_Type := ( "THIS OPTION IS CAN ONLY BE ACTIVE IF WORDS_MODE(TRIM_OUTPUT) IS SET! ", "This option instructs the program to omit inflections and dictionary ", "entries with an AGE code of A (Archaic). Archaic results are rarely ", "of interest in general use. If there is no other possible form, then ", "the Archaic (roughly defined) will be reported. The default is Y(es)."); Omit_Medieval_Help : constant Help_Type := ( "THIS OPTION IS CAN ONLY BE ACTIVE IF WORDS_MODE(TRIM_OUTPUT) IS SET! ", "This option instructs the program to omit inflections and dictionary ", "entries with AGE codes of E or later, those not in use in Roman times.", "While later forms and words are a significant application, most users ", "will not want them. If there is no other possible form, then the ", "Medieval (roughly defined) will be reported. The default is Y(es). "); Omit_Uncommon_Help : constant Help_Type := ( "THIS OPTION IS CAN ONLY BE ACTIVE IF WORDS_MODE(TRIM_OUTPUT) IS SET! ", "This option instructs the program to omit inflections and dictionary ", "entries with FREQ codes indicating that the selection is uncommon. ", "While these forms area significant feature of the program, many users ", "will not want them. If there is no other possible form, then the ", "uncommon (roughly defined) will be reported. The default is Y(es). "); Do_I_For_J_Help : constant Help_Type := ( "This option instructs the program to modify the Output so that the j/J", "is represented as i/I. The consonant i was Written as j in cursive in", "Imperial times and called i longa, and often rendered as j in medieval", "times. The capital is usually rendered as I, as in inscriptions. ", "If this is NO/FALSE, the Output will have the same Character as Input.", "The program default, and the dictionary convention is to retain the j.", "Reset if this is unsuitable for your application. The default is N(o)."); Do_U_For_V_Help : constant Help_Type := ( "This option instructs the program to modify the Output so that the u ", "is represented as v. The consonant u was Written sometimes as uu. ", "The pronunciation was as current w, and important for poetic meter. ", "With the printing press came the practice of distinguishing consonant ", "u with the Character v, and was common for centuries. The practice of", "using only u has been adopted in some 20th century publications (OLD),", " but it is confusing to many modern readers. The capital is commonly ", "V in any case, as it was and is in inscriptions (easier to chisel). ", "If this is NO/FALSE, the Output will have the same Character as Input.", "The program default, and the dictionary convention is to retain the v.", "Reset If this is unsuitable for your application. The default is N(o)."); Pause_In_Screen_Output_Help : constant Help_Type := ( "This option instructs the program to pause in Output on the screen ", "after about 16 lines so that the user can read the Output, otherwise ", "it would just scroll off the top. A RETURN/ENTER gives another page. ", "If the program is waiting for a return, it cannot take other Input. ", "This option is active only for keyboard entry or command line Input, ", "and only when there is no Output file. It is moot if only single word", "Input or brief Output. The default is Y(es). "); No_Screen_Activity_Help : constant Help_Type := ( "This option instructs the program not to keep a running screen of the ", "Input. This is probably only to be used by the developer to calibrate", "run times for large text file Input, removing the time necessary to ", "Write to screen. The default is N(o). "); Update_Local_Dictionary_Help : constant Help_Type := ( "This option instructs the program to invite the user to Input a new ", "word to the local dictionary on the fly. This is only active if the ", "program is not using an (@) Input file! If an UNKNOWN is discovered, ", "the program asks for STEM, PART, and MEAN, the basic elements of a ", "dictionary entry. These are Put into the local dictionary right then,", "and are available for the rest of the session, and all later sessions.", "The use of this option requires a detailed knowledge of the structure ", "of dictionary entries, and is not for the average user. If the entry ", "is not valid, reloading the dictionary will raise and exception, and ", "the invalid entry will be rejected, but the program will continue ", "without that word. Any invalid entries can be corrected or deleted ", "off-line with a text editor on the local dictionary file. If one does", "not want to enter a word when this option is on, a simple RETURN at ", "the STEM=> prompt will ignore and continue the program. This option ", "is only for very experienced users and should normally be off. ", " The default is N(o). ", " ------ NOT AVAILABLE IN THIS VERSION ------- "); Update_Meanings_Help : constant Help_Type := ( "This option instructs the program to invite the user to modify the ", "meaning displayed on a word translation. This is only active if the ", "program is not using an (@) Input file! These changes are Put into ", "the dictionary right then and permanently, and are available from ", "then on, in this session, and all later sessions. Unfortunately, ", "these changes will not survive the replacement of the dictionary by a ", "new version from the developer. Changes can only be recovered by ", "considerable processing by the developer, and should be left there. ", "This option is only for experienced users and should remain off. ", " The default is N(o). ", " ------ NOT AVAILABLE IN THIS VERSION ------- "); Minimize_Output_Help : constant Help_Type := ( "This option instructs the program to minimize the Output. This is a ", "somewhat flexible term, but the use of this option will probably lead ", "to less Output. The default is Y(es). "); Save_Parameters_Help : constant Help_Type := ( "This option instructs the program, to save the current parameters, as ", "just established by the user, in a file WORD.MDV. If such a file ", "exists, the program will load those parameters at the start. If no ", "such file can be found in the current subdirectory, the program will ", "start with a default set of parameters. Since this parameter file is ", "human-readable ASCII, it may also be Created with a text editor. If ", "the file found has been improperly Created, is in the wrong format, or", "otherwise uninterpretable by the program, it will be ignored and the ", "default parameters used, until a proper parameter file in written by ", "the program. Since one may want to make temporary changes during a ", "run, but revert to the usual set, the default is N(o). "); procedure Put (Help : Help_Type) is begin New_Line; for I in Help'First .. Help'Last loop Put_Line (Help (I)); end loop; New_Line; end Put; procedure Update_Local_Dictionary_File is Blank_Line : constant String (1 .. 80) := (others => ' '); Line, Stem_Line, Part_Line, Mean_Line : String (1 .. 80) := Blank_Line; L, Sl, Pl, Ml : Integer := 0; -- SL BAD NAME !!!!!!!!!!! -- DICT_LOC : DICTIONARY; -- Def in LINE_STUFF Dict_Loc_File : File_Type; Dummy : File_Type; -- Omit when Put name here Dict_Loc_Name : constant String := Dictionary_File_Name & ".LOC"; procedure Ready_Dict_Loc_File is -- Effectively goes to the end of DICT_LOC to ready for appending -- Does this by making a new file and writing the old DICT_LOC into it -- If there is not already a DICT_LOC, it Creates one begin Open (Dict_Loc_File, In_File, Latin_Utils.Config.Path (Dict_Loc_Name)); Create (Dummy, Out_File); while not End_Of_File (Dict_Loc_File) loop Get_Line (Dict_Loc_File, Line, L); Put_Line (Dummy, Line (1 .. L)); end loop; Reset (Dummy, In_File); -- Might RESET, but environment might not support Delete (Dict_Loc_File); Create (Dict_Loc_File, Out_File, Dict_Loc_Name); while not End_Of_File (Dummy) loop Get_Line (Dummy, Line, L); Put_Line (Dict_Loc_File, Line (1 .. L)); end loop; Delete (Dummy); exception when Name_Error => Create (Dict_Loc_File, Out_File, Dict_Loc_Name); end Ready_Dict_Loc_File; procedure Append_To_Dict_Loc_File is -- This just appends the 3 lines of a dictionary entry to DICT_LOC -- It prepares the file to Write at the end, Writes, then Closes it begin Ready_Dict_Loc_File; Put_Line (Dict_Loc_File, Stem_Line (1 .. Sl)); -- SL bad name Put (Dict_Loc_File, Part_Line (1 .. Pl)); Put_Line (Dict_Loc_File, " X X X X X "); Put_Line (Dict_Loc_File, Mean_Line (1 .. Ml)); Close (Dict_Loc_File); end Append_To_Dict_Loc_File; begin loop Ada.Text_IO.Put ("STEMS =>"); Get_Line (Stem_Line, Sl); if Sl > 0 then -- if no Input for stems, then just skip the entry Ada.Text_IO.Put ("PART =>"); Get_Line (Part_Line, Pl); Ada.Text_IO.Put ("MEAN =>"); Get_Line (Mean_Line, Ml); else exit; -- on no entry, just CR end if; begin Append_To_Dict_Loc_File; Dict_Loc := Null_Dictionary; Load_Dictionary (Dict_Loc, Dictionary_File_Name & ".LOC"); -- Need to carry LOC through consistently on LOAD_D and LOAD_D_FILE Load_Stem_File (Local); Dictionary_Available (Local) := True; exit; -- If everything OK, otherwise loop back and try again end; end loop; end Update_Local_Dictionary_File; -- Is C one of: '!' .. '/', ':' .. '@', '[' .. '`', '{' .. '~' function Is_Special_Graphical (C : Character) return Boolean is Special_Graphical : constant array (Character) of Boolean := ('!' .. '/' => True, ':' .. '@' => True, '[' .. '`' => True, '{' .. '~' => True, others => False ); begin return Special_Graphical (C); end Is_Special_Graphical; procedure Put_Mdevs is use Mdev_Type_Io; use Reply_Type_Io; begin if Is_Open (Mdev_File) then Close (Mdev_File); end if; Create (Mdev_File, Out_File, Mdev_Full_Name); for I in Words_Mdev'Range loop Put (Mdev_File, I); Set_Col (Mdev_File, 35); Put (Mdev_File, Reply (Words_Mdev (I))); New_Line (Mdev_File); end loop; Put (Mdev_File, "START_FILE_CHARACTER '" & Start_File_Character & "'"); New_Line (Mdev_File); Put (Mdev_File, "CHANGE_PARAMETERS_CHARACTER '" & Change_Parameters_Character & "'"); New_Line (Mdev_File); Put (Mdev_File, "CHANGE_DEVELOPER_MODES_CHARACTER '" & Change_Developer_Modes_Character & "'"); New_Line (Mdev_File); Close (Mdev_File); end Put_Mdevs; procedure Get_Mdevs is use Mdev_Type_Io; use Reply_Type_Io; Mo : Mdev_Type; Rep : Reply_Type; Line : String (1 .. 100) := (others => ' '); Last : Integer := 0; begin Open (Mdev_File, In_File, Latin_Utils.Config.Path (Mdev_Full_Name)); for I in Words_Mdev'Range loop Get (Mdev_File, Mo); Get (Mdev_File, Rep); Words_Mdev (Mo) := Mdev_Of_Reply (Rep); end loop; Skip_Line (Mdev_File); Get_Line (Mdev_File, Line, Last); if Line (1 .. 20) = "START_FILE_CHARACTER" then if Is_Special_Graphical (Line (35)) and (Line (35) /= Change_Parameters_Character) and (Line (35) /= Change_Developer_Modes_Character) then Start_File_Character := Line (35); else Put_Line ("Not an acceptable START_FILE_CHARACTER, may conflict"); Put_Line ("NO CHANGE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); end if; else raise Bad_Mdev_File; end if; Get_Line (Mdev_File, Line, Last); if Line (1 .. 27) = "CHANGE_PARAMETERS_CHARACTER" then if Is_Special_Graphical (Line (35)) and (Line (35) /= Start_File_Character) and (Line (35) /= Change_Developer_Modes_Character) then Change_Parameters_Character := Line (35); else Put_Line ("Not an acceptable CHANGE_PARAMETERS_CHARACTER, may conflict"); Put_Line ("NO CHANGE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); end if; else raise Bad_Mdev_File; end if; Get_Line (Mdev_File, Line, Last); if Line (1 .. 32) = "CHANGE_DEVELOPER_MODES_CHARACTER" then if Is_Special_Graphical (Line (35)) and (Line (35) /= Start_File_Character) and (Line (35) /= Change_Parameters_Character) then Change_Developer_Modes_Character := Line (35); else Put_Line ("Not an acceptable CHANGE_DEVELOPER_MODES_CHARACTER," & " may conflict"); Put_Line ("NO CHANGE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); end if; else raise Bad_Mdev_File; end if; Close (Mdev_File); exception when Name_Error => raise; when others => raise Bad_Mdev_File; end Get_Mdevs; procedure Inquire (Mo : Mdev_Type; Help : in Help_Type := No_Help) is use Mdev_Type_Io; use Reply_Type_Io; L1 : String (1 .. 100); Ll : Natural; R : Reply_Type; begin Put (Mo); Put (" ? "); Set_Col (45); Put ("(Currently "); Put (Reply (Words_Mdev (Mo))); Put (" =>"); Get_Line (L1, Ll); if Ll /= 0 then if Trim (L1 (1 .. Ll)) = "" then Put_Line ("Blank Input, skipping the rest of CHANGE_DEVELOPER_MODES"); raise Blank_Input; elsif L1 (1) = '?' then Put (Help); Inquire (Mo, Help); else Get (L1 (1 .. Ll), R, Ll); Words_Mdev (Mo) := Mdev_Of_Reply (R); end if; end if; New_Line; end Inquire; procedure Change_Developer_Modes is L1 : String (1 .. 100); Ll : Natural; R : Reply_Type; begin Put_Line ("To set developer modes reply Y/y or N/n." & " Return accepts current value."); Put_Line ("A '?' reply gives information/help on that parameter." & " A space skips the rest."); Put_Line ("Developer modes are only for special requirements and " & "may not all be operable."); New_Line; -- Interactive MDEV - lets you do things on unknown words -- You can say it is a noun and then look at the endings -- Or look all the endings and guess what part of speech -- You can look at the dictionary items that are Close to the word -- There may be cases in which the stem is found but is not of right part -- So maybe the word list is deficient and that root goes also to a ADJ -- even if it is listed only for a N. -- One can also look for ADV here with ending 'e', etc. -- You can look up the word in a paper dictionary (with the help of -- ending) -- And then enter the word into DICT.LOC, so it will hit next time -- All unknowns could be recorded in a file for later reference -- A '?' gives information (help) about the item in question -- One can change the symbol that the main program uses for change -- and file -- One can save the new parameters or let them revert to previous -- There should be a basic set of parameters that one can always go to -- There should be moods of translation, maybe to switch dictionaries -- Maybe to turn on or off pre/suffix -- Maybe to allow the user to look at just all the prefixes that match -- INQUIRE (HAVE_DEBUG_FILE, HAVE_DEBUG_FILE_HELP); -- if IS_OPEN (DBG) and then not WORDS_MDEV (HAVE_DEBUG_FILE) then -- DELETE (DBG); -- WORDS_MDEV (WRITE_DEBUG_FILE) := FALSE; -- end if; -- if not IS_OPEN (DBG) and then WORDS_MDEV (HAVE_DEBUG_FILE) then -- begin -- CREATE (DBG, OUT_FILE, DEBUG_FULL_NAME); -- exception -- when others => -- PUT_LINE ("Cannot CREATE WORD.DBG " & -- "-- Check if it is in use elsewhere"); -- end; -- end if; -- -- if WORDS_MDEV (HAVE_DEBUG_FILE) then -- INQUIRE (WRITE_DEBUG_FILE, WRITE_DEBUG_FILE_HELP); -- end if; Inquire (Have_Statistics_File, Have_Statistics_File_Help); if Is_Open (Stats) and then not Words_Mdev (Have_Statistics_File) then Delete (Stats); Words_Mdev (Write_Statistics_File) := False; end if; if not Is_Open (Stats) and then Words_Mdev (Have_Statistics_File) then begin Create (Stats, Out_File, Stats_Full_Name); exception when others => Put_Line ("Cannot CREATE WORD.STA - Check if it is in use elsewhere"); end; end if; if Words_Mdev (Have_Statistics_File) then Inquire (Write_Statistics_File, Write_Statistics_File_Help); end if; Inquire (Do_Only_Initial_Word, Do_Only_Initial_Word_Help); if Words_Mdev (Do_Only_Initial_Word) then Inquire (For_Word_List_Check, For_Word_List_Check_Help); else Words_Mdev (For_Word_List_Check) := False; end if; Inquire (Show_Dictionary, Show_Dictionary_Help); Inquire (Show_Dictionary_Line, Show_Dictionary_Line_Help); Inquire (Show_Dictionary_Codes, Show_Dictionary_Codes_Help); Inquire (Do_Pearse_Codes, Do_Pearse_Codes_Help); if Words_Mode (Do_Fixes) then Inquire (Do_Only_Fixes, Do_Only_Fixes_Help); Inquire (Do_Fixes_Anyway, Do_Fixes_Anyway_Help); end if; Inquire (Use_Prefixes, Use_Prefixes_Help); Inquire (Use_Suffixes, Use_Suffixes_Help); Inquire (Use_Tackons, Use_Tackons_Help); if Words_Mode (Do_Tricks) then Inquire (Do_Medieval_Tricks, Do_Medieval_Tricks_Help); end if; Inquire (Do_Syncope, Do_Syncope_Help); Inquire (Do_Two_Words, Do_Two_Words_Help); Inquire (Include_Unknown_Context, Include_Unknown_Context_Help); Inquire (No_Meanings, No_Meanings_Help); Inquire (Omit_Archaic, Omit_Archaic_Help); Inquire (Omit_Medieval, Omit_Medieval_Help); Inquire (Omit_Uncommon, Omit_Uncommon_Help); Inquire (Do_I_For_J, Do_I_For_J_Help); Inquire (Do_U_For_V, Do_U_For_V_Help); Inquire (Pause_In_Screen_Output, Pause_In_Screen_Output_Help); Inquire (No_Screen_Activity, No_Screen_Activity_Help); Inquire (Update_Local_Dictionary, Update_Local_Dictionary_Help); Inquire (Update_Meanings, Update_Meanings_Help); Inquire (Minimize_Output, Minimize_Output_Help); Put ("START_FILE_CHARACTER ? "); Set_Col (45); Put ("(Currently '"); Put (Start_File_Character); Put ("'"); Put (" =>"); Get_Line (L1, Ll); if Ll /= 0 then if Is_Special_Graphical (L1 (1)) and (L1 (1) /= Change_Parameters_Character) and (L1 (1) /= Change_Developer_Modes_Character) then Start_File_Character := L1 (1); else Put_Line ("Not an acceptable Character, " & "may conflict with other Input"); Put_Line ("NO CHANGE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); end if; end if; New_Line; Put ("CHANGE_PARAMETERS_CHARACTER ? "); Set_Col (45); Put ("(Currently '"); Put (Change_Parameters_Character); Put ("'"); Put (" =>"); Get_Line (L1, Ll); if Ll /= 0 then if Is_Special_Graphical (L1 (1)) and (L1 (1) /= Start_File_Character) and (L1 (1) /= Change_Developer_Modes_Character) then Change_Parameters_Character := L1 (1); else Put_Line ("Not an acceptable Character," & " may conflict with other Input"); Put_Line ("NO CHANGE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); end if; end if; New_Line; Put ("CHANGE_DEVELOPER_MODES_CHARACTER ? "); Set_Col (45); Put ("(Currently '"); Put (Change_Developer_Modes_Character); Put ("'"); Put (" =>"); Get_Line (L1, Ll); if Ll /= 0 then if Is_Special_Graphical (L1 (1)) and (L1 (1) /= Start_File_Character) and (L1 (1) /= Change_Language_Character) and (L1 (1) /= Change_Parameters_Character) then Change_Developer_Modes_Character := L1 (1); else Put_Line ("Not an acceptable Character, " & "may conflict with other Input"); Put_Line ("NO CHANGE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); end if; end if; New_Line; Put ("Do you wish to save this set of parameters? Y or N (Default) "); Put (" =>"); Get_Line (L1, Ll); if Ll /= 0 then if L1 (1) = '?' then Put (Save_Parameters_Help); Put ("Do you wish to save this set of parameters? Y or N (Default) "); Put (" =>"); Get_Line (L1, Ll); end if; Reply_Type_Io.Get (L1 (1 .. Ll), R, Ll); if Mdev_Of_Reply (R) then Put_Mdevs; Put_Line ("MDEV_ARRAY saved in file " & Mdev_Full_Name); end if; end if; New_Line; exception when Blank_Input => null; when others => Put_Line ("Bad Input - terminating CHANGE_DEVELOPER_PARAMETERS"); end Change_Developer_Modes; procedure Initialize_Developer_Parameters is begin Do_Mdev_File : begin -- Read the MDEV file Get_Mdevs; Preface.Put_Line ("MDEV_FILE found - Using those MDEVs and parameters"); exception -- If there is any problem -- Put that the MDEV file is corrupted and the options are: -- to proceed with default parameters -- to set parameters with a CHANGE (SET) PARAMETERS and save -- to examine the MDEV file with a text editor and try to repair it when Name_Error => Words_Mdev := Default_Mdev_Array; when Bad_Mdev_File => Preface.Put_Line ("MDEV_FILE exists, but empty or corupted - Default MDEVs used"); Preface.Put_Line ("You can set new parameters with CHANGE PARAMETERS and save."); Words_Mdev := Default_Mdev_Array; end Do_Mdev_File; -- if not IS_OPEN (DBG) and then WORDS_MDEV (HAVE_DEBUG_FILE) then -- CREATE (DBG, OUT_FILE, DEBUG_FULL_NAME); -- PREFACE.PUT_LINE ("WORD.DBG Created at Initialization"); -- end if; if not Is_Open (Stats) and then Words_Mdev (Have_Statistics_File) then Create (Stats, Out_File, Stats_Full_Name); Preface.Put_Line ("WORD.STA Created at Initialization"); end if; end Initialize_Developer_Parameters; end Support_Utils.Developer_Parameters;
basic/src/evaluate/ustring.asm
paulscottrobson/eris
13
165908
<gh_stars>10-100 ; ***************************************************************************** ; ***************************************************************************** ; ; Name: ustring.asm ; Purpose: Unary String functions ; Created: 4th March 2020 ; Reviewed: 17th March 2020 ; Author: <NAME> (<EMAIL>) ; ; ***************************************************************************** ; ***************************************************************************** ; ***************************************************************************** ; ; Val( ; ; ***************************************************************************** .Unary_Val ;; [val(] .Unary_Val2 ;; [to.number(] push link jsr #EvaluateString ; get string into R0. jsr #ValStrGetBase ; optional base default 10 jsr #CheckRightBracket ; check there's a right bracket ; jsr #CompactStringToInteger ; convert to integer skz r1 ; error jmp #BadNumberError ; ._ValExit stm r0,r10,#esValue1 ; save value stm r14,r10,#esType1 ; it's an integer constant stm r14,r10,#esReference1 ; pop link ret ; ***************************************************************************** ; ; Check if number, similar code to val() ; ; ***************************************************************************** .Unary_IsNumber ;; [is.number(] push link jsr #EvaluateString ; get string into R0. jsr #ValStrGetBase ; optional base default 10 jsr #CheckRightBracket ; check there's a right bracket ; jsr #CompactStringToInteger ; convert to integer clr r0 sknz r1 ; zero if error mov r0,#-1 jmp #_ValExit ; ***************************************************************************** ; ; Support function which returns base in R1 10 or n if ,n in tokens ; ; ***************************************************************************** .ValStrGetBase push r0,link ldm r0,r11,#0 ; check comma xor r0,#TOK_COMMA mov r1,#10 ; 10 if nothing skz r0 jmp #_VSGBExit inc r11 ; skip comma jsr #EvaluateInteger ; get the base mov r1,r0,#0 sub r0,#2 ; range 2..17 skge jmp #BadNumberError sub r0,#15 sklt jmp #BadNumberError ._VSGBExit pop r0,link ret ; ***************************************************************************** ; ; Convert compact string at R0 in base R1, returns R0 value R1 error ; ; ***************************************************************************** .CompactStringToInteger push r9,r10,r11,link ; these are temp reg for string extraction clr r11 ; R11 is 0 (low) #0 (high) mov r10,r0,#1 ; R10 is the string itself. ldm r9,r0,#0 ; R9 is the character count. mov r0,#StringExtract ; this is the function that gets the characters jsr #OSStrToInt ; convert to integer pop r9,r10,r11,link ret ; ***************************************************************************** ; ; String extractor function. ; State is in R9 (count) R10 (ptr) R11 (half) ; ; ***************************************************************************** .StringExtract clr r0 ; if count is zero, return zero sknz r9 ret ; dec r9 ; decrement count ldm r0,r10,#0 ; read the next character skz r11 ; if it is the upper half (r11 != 0) ror r0,#8 ; swap the bytes. and r0,#$00FF ; mask the character off. ; xor r11,#1 ; toggle the half. sknz r11 ; if it has gone from 1->0 bump ptr inc r10 ret ; ***************************************************************************** ; ; Chr$( ; ; ***************************************************************************** .Unary_Chr ;; [chr$(] push link jsr #EvaluateInteger ; get integer into R0. jsr #CheckRightBracket ; check there's a right bracket and r0,#$00FF ; make 8 bit value. .UnaryReturnCharacter mov r1,r0,#0 ; save character in R0 mov r0,#2 ; allocate space for 2 words jsr #AllocateTempMemory ; this address -> R0 stm r1,r0,#1 ; write the character out. mov r1,#1 ; set the length stm r1,r0,#0 .UnaryReturnR0 stm r0,r10,#esValue1 ; make it a constant string stm r15,r10,#esType1 stm r14,r10,#esReference1 pop link ; and exit ret ; ***************************************************************************** ; ; Get$( Inkey$( are Get/Inkey with conversion ; ; ***************************************************************************** .Unary_GetString ;; [get$(] push link jsr #Unary_Get ldm r0,r10,#esValue1 jmp #UnaryReturnCharacter .Unary_InkeyString ;; [inkey$(] push link jsr #Unary_Inkey ldm r0,r10,#esValue1 skz r0 ; no character available return "" jmp #UnaryReturnCharacter mov r0,#_UISNullString jmp #UnaryReturnR0 ._UISNullString word 0 ; ***************************************************************************** ; ; Convert Integer to String ; ; ***************************************************************************** .Unary_Str ;; [str$(] .Unary_Str2 ;; [to.string$(] push link jsr #EvaluateInteger ; get integer into R0. jsr #ValStrGetBase ; optional base default 10 jsr #CheckRightBracket ; check there's a right bracket mov r2,r1,#0 ; if base 10 print as signed xor r2,#10 sknz r2 add r1,#$8000 jsr #OSIntToStr ; mov r1,r0,#0 ; source to copy in R1 - copy so str$(x)+str$(x) works :) mov r0,#maxIStrSize ; allocate memory for the copy jsr #AllocateTempMemory ; R0 now contains the target address for the copy stm r0,r10,#esValue1 ; make it a constant string with that address stm r15,r10,#esType1 stm r14,r10,#esReference1 mov r2,#maxIStrSize ; count to copy ._USCopy ldm r3,r1,#0 ; copy string over. stm r3,r0,#0 inc r1 inc r0 dec r2 skz r2 jmp #_USCopy ; pop link ; and exit ret ; ***************************************************************************** ; ; Upper/Lower case functions ; ; ***************************************************************************** .Unary_Upper ;; [upper$(] clr r2 ; R2 = 0 => U/C skz r14 .Unary_Lower ;; [lower$(] mov r2,#1 push link jsr #EvaluateString ; R0 = string address jsr #CheckRightBracket mov r1,r0,#0 ; copy to R1 jsr #OSWordLength ; number of words in string. mov r3,r0,#0 ; save in R3 inc r0 ; add one to allow for length word jsr #AllocateTempMemory ; allocate space for it mov r4,r0,#0 ; put in R4 stm r4,r10,#esValue1 ; save as return value ; ldm r0,r1,#0 ; copy length stm r0,r4,#0 ._UCaseLoop sknz r3 ; finished ? jmp #_UCaseExit dec r3 ; decrement count. inc r1 ; next characters inc r4 ; ldm r0,r1,#0 ; do lower character sknz r2 jsr #OSUpperCase skz r2 jsr #OSLowerCase mov r5,r0,#0 ; save in R5 ; ldm r0,r1,#0 ; do upper character ror r0,#8 sknz r2 jsr #OSUpperCase skz r2 jsr #OSLowerCase ror r0,#8 ; back into position add r0,r5,#0 ; build compressed string stm r0,r4,#0 jmp #_UCaseLoop ; and go around. ._UCaseExit pop link ret
Bank_B/5_dacpersist.asm
ndf-zz/fv1testing
0
21587
; FV-1 Testing ; ; Program: DAC Persistence ; ; POT0 : WRITE? ; ; Expected output: ; - DAC holds value rdax ADCL,1.0 wrax REG0,0.0 sof 0.0,-0.5 rdax POT0,1.0 skp NEG,end ldax REG0 wrax DACL,0.0 end:
src/main/lib/path/parser/YAJS.g4
PhaedrusTheGreek/yajs
10
32
grammar YAJS; @lexer::members { private expression = false; } path : ROOT pathStep* (pathLeaf EOF)? ; pathStep : DOT DOT? actionFilter? actionField ; actionField : key=STAR | key=Identifier ; actionFilter : LSB filterExpression RSB ; pathLeaf : actionProject | actionDropKeys ; actionProject : LB filterExpression RB ; actionDropKeys : LT filterExpression GT ; filterExpression : filterExpressionTerm+ ; filterExpressionTerm : op=(AND | OR) term=filterExpressionTerm | op=NOT term=filterExpressionTerm | LP expr=filterExpression RP | key=FilterExpressionTerm ; LB : '{' { this.expression = true; }; RB : '}' { this.expression = false; }; LSB : '[' { this.expression = true; }; RSB : ']' { this.expression = false; }; LT : '<' { this.expression = true; }; GT : '>' { this.expression = false; }; Identifier : ~('.'|'!'|' '|'\t'|'('|'>'| ')'|'&'|'|'|'[' |']'|'<'| '{'|'}'|'$'|'*' )+ { this.expression === false; }? ; FilterExpressionTerm : ~('!'|' '|'\t'|'('|'>'| ')'|'&'|'|' |'['|'<'| '{'|'}'|']')+ { this.expression === true; }? ; ROOT : '$' { this.expression === false; }?; DOT : '.' { this.expression === false; }?; STAR : '*' { this.expression === false; }?; AND : '&&'; OR : '||'; NOT : '!' ; LP : '(' ; RP : ')' ; Whitespace : (' '|'\t')+ ->skip ;
programs/oeis/001/A001953.asm
neoneye/loda
22
11930
; A001953: a(n) = floor((n + 1/2) * sqrt(2)). ; 0,2,3,4,6,7,9,10,12,13,14,16,17,19,20,21,23,24,26,27,28,30,31,33,34,36,37,38,40,41,43,44,45,47,48,50,51,53,54,55,57,58,60,61,62,64,65,67,68,70,71,72,74,75,77,78,79,81,82,84,85,86,88,89,91,92,94,95,96,98,99,101,102,103,105,106,108,109,111,112,113,115,116,118,119,120,122,123,125,126,127,129,130,132,133,135,136,137,139,140 mov $1,$0 mul $0,2 pow $1,2 lpb $1 add $0,2 sub $1,1 trn $1,$0 lpe div $0,2
libsrc/sdcard/sd_send_command_string.asm
jpoikela/z88dk
640
168593
<filename>libsrc/sdcard/sd_send_command_string.asm ; ; Old School Computer Architecture - SD Card driver ; Taken from the OSCA Bootcode by <NAME> 2011 ; Port by <NAME>, 2012 ; ; set HL = location of 6 byte command string ; returns command response in A (ZF set if $00) ; ; $Id: sd_send_command_string.asm,v 1.8 2015-01-19 01:33:07 pauloscustodio Exp $ ; PUBLIC sd_send_command_string PUBLIC sd_send_command_null_args PUBLIC sd_send_command_int_args PUBLIC sd_send_command_current_args PUBLIC cmd_generic PUBLIC cmd_generic_args ; PUBLIC cmd_generic_crc EXTERN sd_select_card EXTERN sd_send_eight_clocks EXTERN sd_send_byte EXTERN sd_get_byte cmd_generic: defb $00 ; byte order:HLDE cmd_generic_args: defb $00,$00,$00,$00 ;cmd_generic_crc: defb $01 sd_send_command_null_args: ld de,0 sd_send_command_int_args: ld hl,0 sd_send_command: ld (cmd_generic_args),hl ld (cmd_generic_args+2),de sd_send_command_current_args: ld hl,cmd_generic ld (hl),a sd_send_command_string: ; set HL = location of 5 byte command string, checksum is computed ; returns command response in A (ZF set if $00) call sd_select_card ; send command always enables card select call sd_send_eight_clocks ; send 8 clocks first - seems to be necessary for SD cards.. push bc ld c,0 ; init crc checksum ld b,5 ; 5 bytes in the actual command string data sd_sclp: ld a,(hl) ; --- CRC7 ------------------------------------------------------------------------------------ ld d,8 ; Update CRC for command string with this byte sd_crclp: sla c ; crc <<= 1; ld e,a xor c and $80 ; if ((byte & 0x80) ^ (crc & 0x80)) .. jr z,sd_isz ld a,9 ; .. then crc ^= 0x09 xor c ld c,a sd_isz: ld a,e rla ; byte <<=1; dec d jr nz,sd_crclp ; -------------------------------------------------------------------------------------------- ld a,(hl) call sd_send_byte ; send this command byte to SD card inc hl djnz sd_sclp sla c ; crc = (crc << 1) | 1; ld a,1 or c call sd_send_byte ; send CRC command tail call sd_send_eight_clocks ; skip first byte of nCR. A quirk of the OSCA V6 SD card interface? ld b,0 sd_wncrl: call sd_get_byte ; read until Command Response from card bit 7,a ; If bit 7 = 0, it's a valid response jr z,sd_gcr djnz sd_wncrl sd_gcr: or a ; zero flag set if Command response = 00 pop bc ret
test/Fail/Issue118Comment9.agda
shlevy/agda
3
7125
<reponame>shlevy/agda<filename>test/Fail/Issue118Comment9.agda module Issue118Comment9 where open import Common.Level open import Common.Coinduction data Box (A : Set) : Set where [_] : A → Box A postulate I : Set data P : I → Set where c : ∀ {i} → Box (∞ (P i)) → P i F : ∀ {i} → P i → I F (c x) = _ G : ∀ {i} → Box (∞ (P i)) → I G [ x ] = _ mutual f : ∀ {i} (x : P i) → P (F x) f (c x) = c (g x) g : ∀ {i} (x : Box (∞ (P i))) → Box (∞ (P (G x))) g [ x ] = [ ♯ f (♭ x) ] -- The code above type checks, but the termination checker should -- complain because the inferred definitions of F and G are -- F (c x) = G x and G [ x ] = F (♭ x), respectively. -- 2011-04-12 freezing: now the meta-variables remain uninstantiated. -- good.
SVD2ada/svd/stm32_svd-tsc.ads
JCGobbi/Nucleo-STM32F334R8
0
4366
pragma Style_Checks (Off); -- This spec has been automatically generated from STM32F3x4.svd pragma Restrictions (No_Elaboration_Code); with HAL; with System; package STM32_SVD.TSC is pragma Preelaborate; --------------- -- Registers -- --------------- subtype CR_MCV_Field is HAL.UInt3; subtype CR_PGPSC_Field is HAL.UInt3; subtype CR_SSD_Field is HAL.UInt7; subtype CR_CTPL_Field is HAL.UInt4; subtype CR_CTPH_Field is HAL.UInt4; -- control register type CR_Register is record -- Touch sensing controller enable TSCE : Boolean := False; -- Start a new acquisition START : Boolean := False; -- Acquisition mode AM : Boolean := False; -- Synchronization pin polarity SYNCPOL : Boolean := False; -- I/O Default mode IODEF : Boolean := False; -- Max count value MCV : CR_MCV_Field := 16#0#; -- unspecified Reserved_8_11 : HAL.UInt4 := 16#0#; -- pulse generator prescaler PGPSC : CR_PGPSC_Field := 16#0#; -- Spread spectrum prescaler SSPSC : Boolean := False; -- Spread spectrum enable SSE : Boolean := False; -- Spread spectrum deviation SSD : CR_SSD_Field := 16#0#; -- Charge transfer pulse low CTPL : CR_CTPL_Field := 16#0#; -- Charge transfer pulse high CTPH : CR_CTPH_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CR_Register use record TSCE at 0 range 0 .. 0; START at 0 range 1 .. 1; AM at 0 range 2 .. 2; SYNCPOL at 0 range 3 .. 3; IODEF at 0 range 4 .. 4; MCV at 0 range 5 .. 7; Reserved_8_11 at 0 range 8 .. 11; PGPSC at 0 range 12 .. 14; SSPSC at 0 range 15 .. 15; SSE at 0 range 16 .. 16; SSD at 0 range 17 .. 23; CTPL at 0 range 24 .. 27; CTPH at 0 range 28 .. 31; end record; -- interrupt enable register type IER_Register is record -- End of acquisition interrupt enable EOAIE : Boolean := False; -- Max count error interrupt enable MCEIE : Boolean := False; -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IER_Register use record EOAIE at 0 range 0 .. 0; MCEIE at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; -- interrupt clear register type ICR_Register is record -- End of acquisition interrupt clear EOAIC : Boolean := False; -- Max count error interrupt clear MCEIC : Boolean := False; -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for ICR_Register use record EOAIC at 0 range 0 .. 0; MCEIC at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; -- interrupt status register type ISR_Register is record -- End of acquisition flag EOAF : Boolean := False; -- Max count error flag MCEF : Boolean := False; -- unspecified Reserved_2_31 : HAL.UInt30 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for ISR_Register use record EOAF at 0 range 0 .. 0; MCEF at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; -- IOHCR_G1_IO array type IOHCR_G1_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOHCR_G1_IO type IOHCR_G1_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G1_IO as a value Val : HAL.UInt4; when True => -- G1_IO as an array Arr : IOHCR_G1_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOHCR_G1_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOHCR_G2_IO array type IOHCR_G2_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOHCR_G2_IO type IOHCR_G2_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G2_IO as a value Val : HAL.UInt4; when True => -- G2_IO as an array Arr : IOHCR_G2_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOHCR_G2_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOHCR_G3_IO array type IOHCR_G3_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOHCR_G3_IO type IOHCR_G3_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G3_IO as a value Val : HAL.UInt4; when True => -- G3_IO as an array Arr : IOHCR_G3_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOHCR_G3_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOHCR_G4_IO array type IOHCR_G4_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOHCR_G4_IO type IOHCR_G4_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G4_IO as a value Val : HAL.UInt4; when True => -- G4_IO as an array Arr : IOHCR_G4_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOHCR_G4_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOHCR_G5_IO array type IOHCR_G5_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOHCR_G5_IO type IOHCR_G5_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G5_IO as a value Val : HAL.UInt4; when True => -- G5_IO as an array Arr : IOHCR_G5_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOHCR_G5_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOHCR_G6_IO array type IOHCR_G6_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOHCR_G6_IO type IOHCR_G6_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G6_IO as a value Val : HAL.UInt4; when True => -- G6_IO as an array Arr : IOHCR_G6_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOHCR_G6_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOHCR_G7_IO array type IOHCR_G7_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOHCR_G7_IO type IOHCR_G7_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G7_IO as a value Val : HAL.UInt4; when True => -- G7_IO as an array Arr : IOHCR_G7_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOHCR_G7_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOHCR_G8_IO array type IOHCR_G8_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOHCR_G8_IO type IOHCR_G8_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G8_IO as a value Val : HAL.UInt4; when True => -- G8_IO as an array Arr : IOHCR_G8_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOHCR_G8_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- I/O hysteresis control register type IOHCR_Register is record -- G1_IO1 Schmitt trigger hysteresis mode G1_IO : IOHCR_G1_IO_Field := (As_Array => False, Val => 16#1#); -- G2_IO1 Schmitt trigger hysteresis mode G2_IO : IOHCR_G2_IO_Field := (As_Array => False, Val => 16#1#); -- G3_IO1 Schmitt trigger hysteresis mode G3_IO : IOHCR_G3_IO_Field := (As_Array => False, Val => 16#1#); -- G4_IO1 Schmitt trigger hysteresis mode G4_IO : IOHCR_G4_IO_Field := (As_Array => False, Val => 16#1#); -- G5_IO1 Schmitt trigger hysteresis mode G5_IO : IOHCR_G5_IO_Field := (As_Array => False, Val => 16#1#); -- G6_IO1 Schmitt trigger hysteresis mode G6_IO : IOHCR_G6_IO_Field := (As_Array => False, Val => 16#1#); -- G7_IO1 Schmitt trigger hysteresis mode G7_IO : IOHCR_G7_IO_Field := (As_Array => False, Val => 16#1#); -- G8_IO1 Schmitt trigger hysteresis mode G8_IO : IOHCR_G8_IO_Field := (As_Array => False, Val => 16#1#); end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOHCR_Register use record G1_IO at 0 range 0 .. 3; G2_IO at 0 range 4 .. 7; G3_IO at 0 range 8 .. 11; G4_IO at 0 range 12 .. 15; G5_IO at 0 range 16 .. 19; G6_IO at 0 range 20 .. 23; G7_IO at 0 range 24 .. 27; G8_IO at 0 range 28 .. 31; end record; -- IOASCR_G1_IO array type IOASCR_G1_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOASCR_G1_IO type IOASCR_G1_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G1_IO as a value Val : HAL.UInt4; when True => -- G1_IO as an array Arr : IOASCR_G1_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOASCR_G1_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOASCR_G2_IO array type IOASCR_G2_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOASCR_G2_IO type IOASCR_G2_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G2_IO as a value Val : HAL.UInt4; when True => -- G2_IO as an array Arr : IOASCR_G2_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOASCR_G2_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOASCR_G3_IO array type IOASCR_G3_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOASCR_G3_IO type IOASCR_G3_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G3_IO as a value Val : HAL.UInt4; when True => -- G3_IO as an array Arr : IOASCR_G3_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOASCR_G3_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOASCR_G4_IO array type IOASCR_G4_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOASCR_G4_IO type IOASCR_G4_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G4_IO as a value Val : HAL.UInt4; when True => -- G4_IO as an array Arr : IOASCR_G4_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOASCR_G4_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOASCR_G5_IO array type IOASCR_G5_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOASCR_G5_IO type IOASCR_G5_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G5_IO as a value Val : HAL.UInt4; when True => -- G5_IO as an array Arr : IOASCR_G5_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOASCR_G5_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOASCR_G6_IO array type IOASCR_G6_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOASCR_G6_IO type IOASCR_G6_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G6_IO as a value Val : HAL.UInt4; when True => -- G6_IO as an array Arr : IOASCR_G6_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOASCR_G6_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOASCR_G7_IO array type IOASCR_G7_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOASCR_G7_IO type IOASCR_G7_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G7_IO as a value Val : HAL.UInt4; when True => -- G7_IO as an array Arr : IOASCR_G7_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOASCR_G7_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOASCR_G8_IO array type IOASCR_G8_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOASCR_G8_IO type IOASCR_G8_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G8_IO as a value Val : HAL.UInt4; when True => -- G8_IO as an array Arr : IOASCR_G8_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOASCR_G8_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- I/O analog switch control register type IOASCR_Register is record -- G1_IO1 analog switch enable G1_IO : IOASCR_G1_IO_Field := (As_Array => False, Val => 16#0#); -- G2_IO1 analog switch enable G2_IO : IOASCR_G2_IO_Field := (As_Array => False, Val => 16#0#); -- G3_IO1 analog switch enable G3_IO : IOASCR_G3_IO_Field := (As_Array => False, Val => 16#0#); -- G4_IO1 analog switch enable G4_IO : IOASCR_G4_IO_Field := (As_Array => False, Val => 16#0#); -- G5_IO1 analog switch enable G5_IO : IOASCR_G5_IO_Field := (As_Array => False, Val => 16#0#); -- G6_IO1 analog switch enable G6_IO : IOASCR_G6_IO_Field := (As_Array => False, Val => 16#0#); -- G7_IO1 analog switch enable G7_IO : IOASCR_G7_IO_Field := (As_Array => False, Val => 16#0#); -- G8_IO1 analog switch enable G8_IO : IOASCR_G8_IO_Field := (As_Array => False, Val => 16#0#); end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOASCR_Register use record G1_IO at 0 range 0 .. 3; G2_IO at 0 range 4 .. 7; G3_IO at 0 range 8 .. 11; G4_IO at 0 range 12 .. 15; G5_IO at 0 range 16 .. 19; G6_IO at 0 range 20 .. 23; G7_IO at 0 range 24 .. 27; G8_IO at 0 range 28 .. 31; end record; -- IOSCR_G1_IO array type IOSCR_G1_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOSCR_G1_IO type IOSCR_G1_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G1_IO as a value Val : HAL.UInt4; when True => -- G1_IO as an array Arr : IOSCR_G1_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOSCR_G1_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOSCR_G2_IO array type IOSCR_G2_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOSCR_G2_IO type IOSCR_G2_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G2_IO as a value Val : HAL.UInt4; when True => -- G2_IO as an array Arr : IOSCR_G2_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOSCR_G2_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOSCR_G3_IO array type IOSCR_G3_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOSCR_G3_IO type IOSCR_G3_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G3_IO as a value Val : HAL.UInt4; when True => -- G3_IO as an array Arr : IOSCR_G3_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOSCR_G3_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOSCR_G4_IO array type IOSCR_G4_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOSCR_G4_IO type IOSCR_G4_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G4_IO as a value Val : HAL.UInt4; when True => -- G4_IO as an array Arr : IOSCR_G4_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOSCR_G4_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOSCR_G5_IO array type IOSCR_G5_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOSCR_G5_IO type IOSCR_G5_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G5_IO as a value Val : HAL.UInt4; when True => -- G5_IO as an array Arr : IOSCR_G5_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOSCR_G5_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOSCR_G6_IO array type IOSCR_G6_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOSCR_G6_IO type IOSCR_G6_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G6_IO as a value Val : HAL.UInt4; when True => -- G6_IO as an array Arr : IOSCR_G6_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOSCR_G6_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOSCR_G7_IO array type IOSCR_G7_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOSCR_G7_IO type IOSCR_G7_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G7_IO as a value Val : HAL.UInt4; when True => -- G7_IO as an array Arr : IOSCR_G7_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOSCR_G7_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOSCR_G8_IO array type IOSCR_G8_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOSCR_G8_IO type IOSCR_G8_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G8_IO as a value Val : HAL.UInt4; when True => -- G8_IO as an array Arr : IOSCR_G8_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOSCR_G8_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- I/O sampling control register type IOSCR_Register is record -- G1_IO1 sampling mode G1_IO : IOSCR_G1_IO_Field := (As_Array => False, Val => 16#0#); -- G2_IO1 sampling mode G2_IO : IOSCR_G2_IO_Field := (As_Array => False, Val => 16#0#); -- G3_IO1 sampling mode G3_IO : IOSCR_G3_IO_Field := (As_Array => False, Val => 16#0#); -- G4_IO1 sampling mode G4_IO : IOSCR_G4_IO_Field := (As_Array => False, Val => 16#0#); -- G5_IO1 sampling mode G5_IO : IOSCR_G5_IO_Field := (As_Array => False, Val => 16#0#); -- G6_IO1 sampling mode G6_IO : IOSCR_G6_IO_Field := (As_Array => False, Val => 16#0#); -- G7_IO1 sampling mode G7_IO : IOSCR_G7_IO_Field := (As_Array => False, Val => 16#0#); -- G8_IO1 sampling mode G8_IO : IOSCR_G8_IO_Field := (As_Array => False, Val => 16#0#); end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOSCR_Register use record G1_IO at 0 range 0 .. 3; G2_IO at 0 range 4 .. 7; G3_IO at 0 range 8 .. 11; G4_IO at 0 range 12 .. 15; G5_IO at 0 range 16 .. 19; G6_IO at 0 range 20 .. 23; G7_IO at 0 range 24 .. 27; G8_IO at 0 range 28 .. 31; end record; -- IOCCR_G1_IO array type IOCCR_G1_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOCCR_G1_IO type IOCCR_G1_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G1_IO as a value Val : HAL.UInt4; when True => -- G1_IO as an array Arr : IOCCR_G1_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOCCR_G1_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOCCR_G2_IO array type IOCCR_G2_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOCCR_G2_IO type IOCCR_G2_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G2_IO as a value Val : HAL.UInt4; when True => -- G2_IO as an array Arr : IOCCR_G2_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOCCR_G2_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOCCR_G3_IO array type IOCCR_G3_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOCCR_G3_IO type IOCCR_G3_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G3_IO as a value Val : HAL.UInt4; when True => -- G3_IO as an array Arr : IOCCR_G3_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOCCR_G3_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOCCR_G4_IO array type IOCCR_G4_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOCCR_G4_IO type IOCCR_G4_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G4_IO as a value Val : HAL.UInt4; when True => -- G4_IO as an array Arr : IOCCR_G4_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOCCR_G4_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOCCR_G5_IO array type IOCCR_G5_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOCCR_G5_IO type IOCCR_G5_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G5_IO as a value Val : HAL.UInt4; when True => -- G5_IO as an array Arr : IOCCR_G5_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOCCR_G5_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOCCR_G6_IO array type IOCCR_G6_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOCCR_G6_IO type IOCCR_G6_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G6_IO as a value Val : HAL.UInt4; when True => -- G6_IO as an array Arr : IOCCR_G6_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOCCR_G6_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOCCR_G7_IO array type IOCCR_G7_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOCCR_G7_IO type IOCCR_G7_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G7_IO as a value Val : HAL.UInt4; when True => -- G7_IO as an array Arr : IOCCR_G7_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOCCR_G7_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- IOCCR_G8_IO array type IOCCR_G8_IO_Field_Array is array (1 .. 4) of Boolean with Component_Size => 1, Size => 4; -- Type definition for IOCCR_G8_IO type IOCCR_G8_IO_Field (As_Array : Boolean := False) is record case As_Array is when False => -- G8_IO as a value Val : HAL.UInt4; when True => -- G8_IO as an array Arr : IOCCR_G8_IO_Field_Array; end case; end record with Unchecked_Union, Size => 4; for IOCCR_G8_IO_Field use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- I/O channel control register type IOCCR_Register is record -- G1_IO1 channel mode G1_IO : IOCCR_G1_IO_Field := (As_Array => False, Val => 16#0#); -- G2_IO1 channel mode G2_IO : IOCCR_G2_IO_Field := (As_Array => False, Val => 16#0#); -- G3_IO1 channel mode G3_IO : IOCCR_G3_IO_Field := (As_Array => False, Val => 16#0#); -- G4_IO1 channel mode G4_IO : IOCCR_G4_IO_Field := (As_Array => False, Val => 16#0#); -- G5_IO1 channel mode G5_IO : IOCCR_G5_IO_Field := (As_Array => False, Val => 16#0#); -- G6_IO1 channel mode G6_IO : IOCCR_G6_IO_Field := (As_Array => False, Val => 16#0#); -- G7_IO1 channel mode G7_IO : IOCCR_G7_IO_Field := (As_Array => False, Val => 16#0#); -- G8_IO1 channel mode G8_IO : IOCCR_G8_IO_Field := (As_Array => False, Val => 16#0#); end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOCCR_Register use record G1_IO at 0 range 0 .. 3; G2_IO at 0 range 4 .. 7; G3_IO at 0 range 8 .. 11; G4_IO at 0 range 12 .. 15; G5_IO at 0 range 16 .. 19; G6_IO at 0 range 20 .. 23; G7_IO at 0 range 24 .. 27; G8_IO at 0 range 28 .. 31; end record; -- I/O group control status register type IOGCSR_Register is record -- Analog I/O group x enable G1E : Boolean := False; -- Analog I/O group x enable G2E : Boolean := False; -- Analog I/O group x enable G3E : Boolean := False; -- Analog I/O group x enable G4E : Boolean := False; -- Analog I/O group x enable G5E : Boolean := False; -- Analog I/O group x enable G6E : Boolean := False; -- Analog I/O group x enable G7E : Boolean := False; -- Analog I/O group x enable G8E : Boolean := False; -- unspecified Reserved_8_15 : HAL.UInt8 := 16#0#; -- Read-only. Analog I/O group x status G1S : Boolean := False; -- Read-only. Analog I/O group x status G2S : Boolean := False; -- Read-only. Analog I/O group x status G3S : Boolean := False; -- Read-only. Analog I/O group x status G4S : Boolean := False; -- Read-only. Analog I/O group x status G5S : Boolean := False; -- Read-only. Analog I/O group x status G6S : Boolean := False; -- Analog I/O group x status G7S : Boolean := False; -- Analog I/O group x status G8S : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOGCSR_Register use record G1E at 0 range 0 .. 0; G2E at 0 range 1 .. 1; G3E at 0 range 2 .. 2; G4E at 0 range 3 .. 3; G5E at 0 range 4 .. 4; G6E at 0 range 5 .. 5; G7E at 0 range 6 .. 6; G8E at 0 range 7 .. 7; Reserved_8_15 at 0 range 8 .. 15; G1S at 0 range 16 .. 16; G2S at 0 range 17 .. 17; G3S at 0 range 18 .. 18; G4S at 0 range 19 .. 19; G5S at 0 range 20 .. 20; G6S at 0 range 21 .. 21; G7S at 0 range 22 .. 22; G8S at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; subtype IOG1CR_CNT_Field is HAL.UInt14; -- I/O group x counter register type IOG1CR_Register is record -- Read-only. Counter value CNT : IOG1CR_CNT_Field; -- unspecified Reserved_14_31 : HAL.UInt18; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOG1CR_Register use record CNT at 0 range 0 .. 13; Reserved_14_31 at 0 range 14 .. 31; end record; subtype IOG2CR_CNT_Field is HAL.UInt14; -- I/O group x counter register type IOG2CR_Register is record -- Read-only. Counter value CNT : IOG2CR_CNT_Field; -- unspecified Reserved_14_31 : HAL.UInt18; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOG2CR_Register use record CNT at 0 range 0 .. 13; Reserved_14_31 at 0 range 14 .. 31; end record; subtype IOG3CR_CNT_Field is HAL.UInt14; -- I/O group x counter register type IOG3CR_Register is record -- Read-only. Counter value CNT : IOG3CR_CNT_Field; -- unspecified Reserved_14_31 : HAL.UInt18; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOG3CR_Register use record CNT at 0 range 0 .. 13; Reserved_14_31 at 0 range 14 .. 31; end record; subtype IOG4CR_CNT_Field is HAL.UInt14; -- I/O group x counter register type IOG4CR_Register is record -- Read-only. Counter value CNT : IOG4CR_CNT_Field; -- unspecified Reserved_14_31 : HAL.UInt18; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOG4CR_Register use record CNT at 0 range 0 .. 13; Reserved_14_31 at 0 range 14 .. 31; end record; subtype IOG5CR_CNT_Field is HAL.UInt14; -- I/O group x counter register type IOG5CR_Register is record -- Read-only. Counter value CNT : IOG5CR_CNT_Field; -- unspecified Reserved_14_31 : HAL.UInt18; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOG5CR_Register use record CNT at 0 range 0 .. 13; Reserved_14_31 at 0 range 14 .. 31; end record; subtype IOG6CR_CNT_Field is HAL.UInt14; -- I/O group x counter register type IOG6CR_Register is record -- Read-only. Counter value CNT : IOG6CR_CNT_Field; -- unspecified Reserved_14_31 : HAL.UInt18; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOG6CR_Register use record CNT at 0 range 0 .. 13; Reserved_14_31 at 0 range 14 .. 31; end record; subtype IOG7CR_CNT_Field is HAL.UInt14; -- I/O group x counter register type IOG7CR_Register is record -- Read-only. Counter value CNT : IOG7CR_CNT_Field; -- unspecified Reserved_14_31 : HAL.UInt18; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOG7CR_Register use record CNT at 0 range 0 .. 13; Reserved_14_31 at 0 range 14 .. 31; end record; subtype IOG8CR_CNT_Field is HAL.UInt14; -- I/O group x counter register type IOG8CR_Register is record -- Read-only. Counter value CNT : IOG8CR_CNT_Field; -- unspecified Reserved_14_31 : HAL.UInt18; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IOG8CR_Register use record CNT at 0 range 0 .. 13; Reserved_14_31 at 0 range 14 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Touch sensing controller type TSC_Peripheral is record -- control register CR : aliased CR_Register; -- interrupt enable register IER : aliased IER_Register; -- interrupt clear register ICR : aliased ICR_Register; -- interrupt status register ISR : aliased ISR_Register; -- I/O hysteresis control register IOHCR : aliased IOHCR_Register; -- I/O analog switch control register IOASCR : aliased IOASCR_Register; -- I/O sampling control register IOSCR : aliased IOSCR_Register; -- I/O channel control register IOCCR : aliased IOCCR_Register; -- I/O group control status register IOGCSR : aliased IOGCSR_Register; -- I/O group x counter register IOG1CR : aliased IOG1CR_Register; -- I/O group x counter register IOG2CR : aliased IOG2CR_Register; -- I/O group x counter register IOG3CR : aliased IOG3CR_Register; -- I/O group x counter register IOG4CR : aliased IOG4CR_Register; -- I/O group x counter register IOG5CR : aliased IOG5CR_Register; -- I/O group x counter register IOG6CR : aliased IOG6CR_Register; -- I/O group x counter register IOG7CR : aliased IOG7CR_Register; -- I/O group x counter register IOG8CR : aliased IOG8CR_Register; end record with Volatile; for TSC_Peripheral use record CR at 16#0# range 0 .. 31; IER at 16#4# range 0 .. 31; ICR at 16#8# range 0 .. 31; ISR at 16#C# range 0 .. 31; IOHCR at 16#10# range 0 .. 31; IOASCR at 16#18# range 0 .. 31; IOSCR at 16#20# range 0 .. 31; IOCCR at 16#28# range 0 .. 31; IOGCSR at 16#30# range 0 .. 31; IOG1CR at 16#34# range 0 .. 31; IOG2CR at 16#38# range 0 .. 31; IOG3CR at 16#3C# range 0 .. 31; IOG4CR at 16#40# range 0 .. 31; IOG5CR at 16#44# range 0 .. 31; IOG6CR at 16#48# range 0 .. 31; IOG7CR at 16#4C# range 0 .. 31; IOG8CR at 16#50# range 0 .. 31; end record; -- Touch sensing controller TSC_Periph : aliased TSC_Peripheral with Import, Address => TSC_Base; end STM32_SVD.TSC;
old/Base.agda
UlrikBuchholtz/HoTT-Agda
294
11994
{-# OPTIONS --without-K #-} module Base where open import Types public open import Functions public open import Paths public open import HLevel public open import Equivalences public open import Univalence public open import Funext public open import EquivalenceLemmas public open import HLevelBis public open import FiberEquivalences public
Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca_notsx.log_3580_1574.asm
ljhsiun2/medusa
9
23096
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r8 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x1c85c, %r12 and %rsi, %rsi and $0xffffffffffffffc0, %r12 vmovaps (%r12), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $0, %xmm5, %rbx nop nop nop nop cmp $22831, %r13 lea addresses_D_ht+0x1befa, %rcx nop nop nop nop nop and %r13, %r13 mov (%rcx), %r9d nop add $43907, %rbx lea addresses_WT_ht+0x169c2, %rbx xor %r8, %r8 mov (%rbx), %si nop nop nop add %r13, %r13 lea addresses_A_ht+0x775a, %r9 nop nop nop xor $47031, %rcx mov (%r9), %r13d nop and $35216, %r12 lea addresses_D_ht+0x1dfba, %rsi lea addresses_D_ht+0xec7a, %rdi nop nop add %r9, %r9 mov $93, %rcx rep movsb nop nop nop nop nop xor $58559, %r12 lea addresses_D_ht+0x1af3f, %r8 nop and $52076, %rsi mov (%r8), %r12w nop nop nop nop nop add $5518, %rdi lea addresses_UC_ht+0x5f1a, %rdi clflush (%rdi) nop nop nop sub %r12, %r12 movl $0x61626364, (%rdi) nop nop nop nop nop sub %r8, %r8 lea addresses_normal_ht+0x1957a, %rsi lea addresses_D_ht+0x70b2, %rdi nop nop nop xor %r12, %r12 mov $1, %rcx rep movsl nop nop nop nop add %rbx, %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r15 push %r8 push %r9 push %rbx push %rcx push %rdx // Faulty Load lea addresses_US+0xd2fa, %r15 nop nop add $59619, %r8 mov (%r15), %cx lea oracles, %r8 and $0xff, %rcx shlq $12, %rcx mov (%r8,%rcx,1), %rcx pop %rdx pop %rcx pop %rbx pop %r9 pop %r8 pop %r15 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'src': {'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'00': 3580} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
inc/dpl.asm
minblock/msdos
0
24722
<filename>inc/dpl.asm ; ; Microsoft Confidential ; Copyright (C) Microsoft Corporation 1991 ; All Rights Reserved. ; ; SCCSID = @(#)dpl.asm 1.1 85/04/10 ; SCCSID = @(#)dpl.asm 1.1 85/04/10 DPL STRUC DPL_AX DW ? ; AX register DPL_BX DW ? ; BX register DPL_CX DW ? ; CX register DPL_DX DW ? ; DX register DPL_SI DW ? ; SI register DPL_DI DW ? ; DI register DPL_DS DW ? ; DS register DPL_ES DW ? ; ES register DPL_reserved DW ? ; Reserved DPL_UID DW ? ; User (Machine) ID (0 = local macine) DPL_PID DW ? ; Process ID (0 = local user PID) DPL ENDS 
oeis/276/A276400.asm
neoneye/loda-programs
11
164417
; A276400: Denominator of n!/(n^n-n). ; Submitted by <NAME>(w3) ; 1,4,21,26,1555,817,299593,134521,12345679,43229041,67546215517,4622635937,61054982558011,18617937516193,5118976599431,4224061794762749,128583032925805678351,655879001624535409,275941052631578947368421,286115209221463953761,2707038020425761202263187,156309647860880884195375441,2416188001540369790668625856601,3987010790149955255417767967,34439829819340740200261114900141,1735334242208438096600958136169617,85464492283314703586571181692308461,7528988251117790096650915478333967061 mov $1,1 mov $2,1 mov $3,$0 add $0,2 lpb $3 mul $1,$0 add $1,1 mul $2,$3 sub $3,1 lpe gcd $2,$1 div $1,$2 mov $0,$1
smsq/sbas/procs/machine.asm
olifink/smsqe
0
171585
<reponame>olifink/smsqe ; SBAS_PROCS_MACHINE - SBASIC Info on Machine V2.00  1994 <NAME> section exten xdef machine xdef processor xref ut_rtint xref err_bp include 'dev8_keys_qdos_sms' include 'dev8_keys_sys' ;+++ ; MACHINE ;--- machine moveq #sys_mtyp-$70,d1 bsr.s mc_fetch and.w #sys.mtyp+sys.blit,d1 ; machine type and blitter bits only jmp ut_rtint ;+++ ; PROCESSOR ;--- processor moveq #sys_ptyp-$70,d1 bsr.s mc_fetch lsr.b #4,d1 ; hex 0x0 / 4 ext.w d1 mulu #10,d1 ; return decimal jmp ut_rtint mc_fetch cmp.l a3,a5 bne.l err_bp moveq #sms.xtop,d0 ; xtop trap #do.smsq move.b $70(a6,d1.w),d1 moveq #0,d0 rts end
programs/oeis/181/A181709.asm
neoneye/loda
22
175517
<reponame>neoneye/loda ; A181709: Indices of primes in A007310. ; 2,3,4,5,6,7,8,10,11,13,14,15,16,18,20,21,23,24,25,27,28,30,33,34,35,36,37,38,43,44,46,47,50,51,53,55,56,58,60,61,64,65,66,67,71,75,76,77,78,80,81,84,86,88,90,91,93,94,95,98,103,104,105,106,111,113,116,117,118,120,123,125,127,128,130,133,134,137,140,141,144,145,147,148,150,153,154,155,156,160,163,164,167,168,170,174,175,181,183,186 add $0,1 seq $0,98090 ; Numbers k such that 2k-3 is prime. mul $0,2 div $0,3
src/Categories/Category/Instance/FamilyOfSets.agda
bblfish/agda-categories
5
13659
{-# OPTIONS --without-K --safe #-} module Categories.Category.Instance.FamilyOfSets where -- The Category of "Families of Sets" open import Level open import Relation.Binary using (Rel) open import Data.Product open import Relation.Binary.PropositionalEquality as ≡ open import Function renaming (id to idf; _∘_ to _⊚_) import Relation.Binary.Reasoning.Setoid as SetoidR open import Categories.Category module _ {a b : Level} where record Fam : Set (suc a ⊔ suc b) where field U : Set a T : U → Set b open Fam record Hom (A B : Fam) : Set (a ⊔ b) where field f : U A → U B φ : (x : U A) → T A x → T B (f x) -- it is more convenient if we have g≡f than f≡g record _≡Fam_ {X Y} (f g : (Hom X Y)) : Set (a ⊔ b) where field g≡f : {x : U X} → Hom.f g x ≡ Hom.f f x φ≡γ : {x : U X} {bx : T X x} → Hom.φ f x bx ≡ subst (T Y) (g≡f {x}) (Hom.φ g x bx) module Eq = _≡Fam_ Cat : Category (suc a ⊔ suc b) (a ⊔ b) (a ⊔ b) Cat = record { Obj = Fam ; _⇒_ = Hom ; _≈_ = _≡Fam_ ; id = record { f = idf ; φ = λ _ → idf } ; _∘_ = λ H I → record { f = Hom.f H ⊚ Hom.f I ; φ = λ ua → Hom.φ H (Hom.f I ua) ⊚ Hom.φ I ua } ; assoc = record { g≡f = refl ; φ≡γ = refl } ; sym-assoc = record { g≡f = refl ; φ≡γ = refl } ; identityˡ = record { g≡f = refl ; φ≡γ = refl } ; identityʳ = record { g≡f = refl ; φ≡γ = refl } ; identity² = record { g≡f = refl ; φ≡γ = refl } ; equiv = λ {A} {B} → record { refl = record { g≡f = refl ; φ≡γ = refl } ; sym = λ {i} {j} i≡j → record { g≡f = sym (Eq.g≡f i≡j) ; φ≡γ = λ {x} {bx} → let open SetoidR (setoid (T B (Hom.f j x) )) in let eq = Eq.g≡f i≡j in begin Hom.φ j x bx ≈⟨ sym (subst-sym-subst eq) ⟩ subst (T B) (sym eq) (subst (T B) eq (Hom.φ j x bx)) ≈⟨ cong (subst (T B) (sym eq)) (sym (Eq.φ≡γ i≡j)) ⟩ subst (T B) (sym eq) (Hom.φ i x bx) ∎ } ; trans = λ {i} {j} {k} i≡j j≡k → record { g≡f = trans (Eq.g≡f j≡k) (Eq.g≡f i≡j) ; φ≡γ = λ {x} {bx} → let eq₁ = Eq.g≡f i≡j in let eq₂ = Eq.g≡f j≡k in let eq₃ = Eq.φ≡γ i≡j in let y = Hom.φ i x bx in let z = Hom.φ j x bx in let w = Hom.φ k x bx in let open SetoidR (setoid (T B (Hom.f i _))) in begin y ≈⟨ eq₃ ⟩ subst (T B) eq₁ z ≈⟨ cong (subst (T B) eq₁) (Eq.φ≡γ j≡k) ⟩ subst (T B) eq₁ (subst (T B) eq₂ w) ≈⟨ subst-subst eq₂ ⟩ subst (T B) ((trans eq₂ eq₁)) w ∎ } } ; ∘-resp-≈ = λ {A} {B} {C} {ff} {hh} {g} {i} f≡h g≡i → record { g≡f = λ {x} → trans (cong (Hom.f hh) (Eq.g≡f g≡i)) (Eq.g≡f f≡h) ; φ≡γ = λ {x} {bx} → let eq₁ = Eq.g≡f f≡h in let eq₂ = Eq.g≡f g≡i in let eq₃ = Eq.φ≡γ f≡h in let eq₄ = Eq.φ≡γ g≡i in let y = Hom.φ i x bx in let z = Hom.φ g x bx in let ix = Hom.f i x in let gx = Hom.f g x in let φgx = Hom.φ g x bx in let φhy = Hom.φ hh ix y in let ST₁ {z} x = subst (T C) (eq₁ {z}) x in let ST₂ {z} x = subst (T B) (eq₂ {z}) x in let open SetoidR (setoid (T C _)) in begin Hom.φ ff (Hom.f g x) z ≈⟨ eq₃ ⟩ ST₁ (Hom.φ hh gx φgx) ≈⟨ cong (λ q → ST₁ (Hom.φ hh gx q)) eq₄ ⟩ ST₁ (Hom.φ hh gx (ST₂ y)) ≈⟨ cong ST₁ (subst-app (T B) (Hom.φ hh) eq₂) ⟩ ST₁ (subst (T C) (cong (Hom.f hh) eq₂) φhy) ≈⟨ subst-subst (cong (Hom.f hh) eq₂) ⟩ subst (T C) (trans (cong (Hom.f hh) eq₂) eq₁) φhy ∎ } } where -- this is almost like subst-application from stdlib subst-app : ∀ {a₁ a₂ b₁ b₂} {A₁ : Set a₁} {A₂ : Set a₂} (B₁ : A₁ → Set b₁) {B₂ : A₂ → Set b₂} {f : A₁ → A₂} {x₁ x₂ : A₁} {y : B₁ x₁} (g : ∀ x → B₁ x → B₂ (f x)) (eq : x₁ ≡ x₂) → g x₂ (subst B₁ eq y) ≡ subst B₂ (cong f eq) (g x₁ y) subst-app _ _ refl = refl open Category Cat public FamilyOfSets : ∀ a b → Category (suc a ⊔ suc b) (a ⊔ b) (a ⊔ b) FamilyOfSets a b = Cat {a} {b}
oeis/166/A166636.asm
neoneye/loda-programs
11
27851
; A166636: Totally multiplicative sequence with a(p) = 6*(p-1) for prime p. ; Submitted by <NAME>(s2) ; 1,6,12,36,24,72,36,216,144,144,60,432,72,216,288,1296,96,864,108,864,432,360,132,2592,576,432,1728,1296,168,1728,180,7776,720,576,864,5184,216,648,864,5184,240,2592,252,2160,3456,792,276,15552,1296,3456,1152,2592,312,10368,1440,7776,1296,1008,348,10368,360,1080,5184,46656,1728,4320,396,3456,1584,5184,420,31104,432,1296,6912,3888,2160,5184,468,31104,20736,1440,492,15552,2304,1512,2016,12960,528,20736,2592,4752,2160,1656,2592,93312,576,7776,8640,20736 add $0,1 mov $1,1 mov $2,2 mov $4,1 lpb $0 mul $1,6 mul $1,$4 mov $3,$0 lpb $3 mov $4,$0 mod $4,$2 add $2,1 cmp $4,0 cmp $4,0 sub $3,$4 lpe div $0,$2 mov $4,$2 sub $4,1 lpe mov $0,$1 div $0,6
src/algebra/group/classifying.agda
pcapriotti/agda-base
20
15774
{-# OPTIONS --without-K #-} module algebra.group.classifying where open import level open import algebra.group.core open import algebra.group.morphism open import equality.core open import function.isomorphism open import pointed.core open import sets.unit open import sum open import hott.level.core open import hott.loop.core open import hott.truncation.core open import hott.equivalence module _ {i}(G : Set i) ⦃ gG : IsGroup G ⦄ where open import algebra.group.gset G open IsGroup ⦃ ... ⦄ -- G as a G-Set G' : GSet i G' = (G , GisGSet) -- G as a pointed set G* : PSet i G* = (G , e) 𝑩 : Set (lsuc i) 𝑩 = Σ (GSet i) λ X → Trunc 1 (X ≡ G') base : 𝑩 base = (G' , [ refl ]) 𝑩* : PSet (lsuc i) 𝑩* = (𝑩 , base) 𝑩-Ω : (base ≡ base) ≅ G 𝑩-Ω = begin (base ≡ base) ≅⟨ sym≅ Σ-split-iso ⟩ ( Σ (G' ≡ G') λ p → subst (λ X → Trunc 1 (X ≡ G')) p [ refl ] ≡ [ refl ] ) ≅⟨ (Σ-ap-iso refl≅ λ p → contr-⊤-iso (Trunc-level 1 _ _)) ·≅ ×-right-unit ⟩ (G' ≡ G') ≅⟨ GSet-univalence G ⦃ xG = GisGSet ⦄ G ⦃ yG = GisGSet ⦄ ⟩ ( Σ (GSetMorphism G ⦃ xG = GisGSet ⦄ G ⦃ yG = GisGSet ⦄) λ { (f , _) → weak-equiv f } ) ≅⟨ (Σ-ap-iso' (GSet-repr-iso is-set ⦃ xG = GisGSet ⦄) λ _ → refl≅) ⟩ ( Σ G λ { g → weak-equiv (λ x → x * g) } ) ≅⟨ ( Σ-ap-iso refl≅ λ g → contr-⊤-iso ( lem g , h1⇒prop (we-h1 _) _ ) ) ·≅ ×-right-unit ⟩ G ∎ where open ≅-Reasoning lem : (g : G) → weak-equiv (λ x → x * g) lem g = proj₂ (≅'⇒≈ (≅⇒≅' (right-translation-iso g)))
music/volume-down.applescript
asbjornu/macos-scripts
0
4494
set volume output volume (get (output volume of (get volume settings)) - 2)
src/Categories/Functor/Hom/Properties/Covariant.agda
Trebor-Huang/agda-categories
279
7612
{-# OPTIONS --without-K --safe #-} open import Categories.Category module Categories.Functor.Hom.Properties.Covariant {o ℓ e} (C : Category o ℓ e) where open import Level open import Function.Equality using (Π) open import Relation.Binary using (Setoid) open import Categories.Category.Construction.Cones open import Categories.Category.Instance.Setoids open import Categories.Diagram.Cone.Properties open import Categories.Diagram.Limit open import Categories.Functor open import Categories.Functor.Limits open import Categories.Functor.Hom import Categories.Morphism.Reasoning as MR private variable o′ ℓ′ e′ : Level J : Category o′ ℓ′ e′ module C = Category C open Category C open Hom C open Π -- Hom functor preserves limits in C module _ (W : Obj) {F : Functor J C} (lim : Limit F) where private module F = Functor F module lim = Limit lim open lim HomF : Functor J (Setoids ℓ e) HomF = Hom[ W ,-] ∘F F open HomReasoning open MR C ⊤ : Cone HomF ⊤ = F-map-Coneˡ Hom[ W ,-] limit module _ (K : Cone HomF) where private module K = Cone _ K KW : Setoid.Carrier (Cone.N K) → Cone F KW x = record { N = W ; apex = record { ψ = λ X → K.ψ X ⟨$⟩ x ; commute = λ f → ⟺ (∘-resp-≈ʳ identityʳ) ○ K.commute f (Setoid.refl K.N) } } ! : Cones HomF [ K , ⊤ ] ! = record { arr = record { _⟨$⟩_ = λ x → rep (KW x) ; cong = λ {x y} eq → ψ-≈⇒rep-≈ F W (Cone.apex (KW x)) (Cone.apex (KW y)) lim (λ A → cong (K.ψ A) eq) } ; commute = λ {X} {x y} eq → begin proj X ∘ rep (KW x) ∘ C.id ≈⟨ refl⟩∘⟨ C.identityʳ ⟩ proj X ∘ rep (KW x) ≈⟨ lim.commute ⟩ K.ψ X ⟨$⟩ x ≈⟨ cong (K.ψ X) eq ⟩ K.ψ X ⟨$⟩ y ∎ } !-unique : ∀ {K : Cone HomF} (f : Cones HomF [ K , ⊤ ]) → Cones HomF [ ! K ≈ f ] !-unique {K} f {x} {y} x≈y = begin rep (KW K x) ≈⟨ terminal.!-unique f′ ⟩ f.arr ⟨$⟩ x ≈⟨ cong f.arr x≈y ⟩ f.arr ⟨$⟩ y ∎ where module K = Cone _ K module f = Cone⇒ _ f f′ : Cones F [ KW K x , limit ] f′ = record { arr = f.arr ⟨$⟩ x ; commute = ⟺ (∘-resp-≈ʳ C.identityʳ) ○ f.commute (Setoid.refl K.N) } hom-resp-limit : Limit HomF hom-resp-limit = record { terminal = record { ⊤ = ⊤ ; ⊤-is-terminal = record { ! = ! _ ; !-unique = !-unique } } } Hom-Continuous : ∀ X o′ ℓ′ e′ → Continuous o′ ℓ′ e′ Hom[ X ,-] Hom-Continuous X _ _ _ L = terminal.⊤-is-terminal where open Limit (hom-resp-limit X L)
tests/function_simple/err_wrong_number_args1.asm
dommilosz/customasm
0
173845
<reponame>dommilosz/customasm<filename>tests/function_simple/err_wrong_number_args1.asm #fn add(value1, value2, value3) => { value1 + value2 + value3 } #d8 add(0) ; error: failed / error: wrong number #d8 add(0, 1) ; error: failed / error: wrong number #d8 add(0, 1, 2, 3) ; error: failed / error: wrong number
programs/oeis/120/A120134.asm
karttu/loda
0
83462
<reponame>karttu/loda<filename>programs/oeis/120/A120134.asm ; A120134: a(1)=4; a(n) = floor((8 + Sum_{k=1..n-1} a(k))/2). ; 4,6,9,13,20,30,45,67,101,151,227,340,510,765,1148,1722,2583,3874,5811,8717,13075,19613,29419,44129,66193,99290,148935,223402,335103,502655,753982,1130973,1696460,2544690,3817035,5725552,8588328,12882492 mov $5,$0 mov $6,2 lpb $6,1 mov $0,$5 sub $6,1 add $0,$6 sub $0,1 mov $2,$0 mov $0,3 mov $3,3 lpb $2,1 sub $2,1 add $3,$0 mul $3,$0 div $3,2 lpe add $3,1 mov $4,$6 mov $7,$3 lpb $4,1 mov $1,$7 sub $4,1 lpe lpe lpb $5,1 sub $1,$7 mov $5,0 lpe
libsrc/_DEVELOPMENT/arch/zx/display/c/sccz80/zx_aaddr2py.asm
jpoikela/z88dk
38
163148
<reponame>jpoikela/z88dk<gh_stars>10-100 ; uchar zx_aaddr2py(void *attraddr) SECTION code_clib SECTION code_arch PUBLIC zx_aaddr2py EXTERN asm_zx_aaddr2py defc zx_aaddr2py = asm_zx_aaddr2py
alloy4fun_models/trashltl/models/5/8Ahum3ebt4HddRZKD.als
Kaixi26/org.alloytools.alloy
0
1807
open main pred id8Ahum3ebt4HddRZKD_prop6 { always all p : File | always p in Trash since p in Trash } pred __repair { id8Ahum3ebt4HddRZKD_prop6 } check __repair { id8Ahum3ebt4HddRZKD_prop6 <=> prop6o }
applescript/androo.scpt
z-------------/Androo
2
3167
<reponame>z-------------/Androo set phrases to {"Were you born in a barn?", "Get some work done", "Useless scrub", "Stop jacking off", "I'll bust your chops", "Are you born in a water park?", "Stop fapping around", "Are you born in a barn?", "Later, shizlord", "Oy!", "You should know when to give up."} set dialogs to {"WERE U BORN IN A BARN???", "GET SUM WERK DUN", "Useless scrub...", "Stop jacking off", "I'LL BUST YOUR CHOPS", "R U BORN IN A WATER PARK??", "Stop fapping around", "R U BORN IN A BARN???", "LATER, SHIZLORD", "OI!!", "U shuld know when 2 give up..."} set actions to {"*snaps fingers*", "*shakes head*", "UGHHHHHHH SCRUB", "BURRRRPPP", "And stop fapping around"} set remarks to {"Scrub", "Useless twerp", "Uhh Uhh Uhh", "Uhh"} repeat set rnd_num to random number from 1 to length of phrases set front_app to (path to frontmost application as Unicode text) set act_num to random number from 1 to length of actions set rem_num to random number from 1 to length of remarks say (item rnd_num of phrases) tell application front_app display dialog (item rnd_num of dialogs) with title (item act_num of actions) end tell say (item rem_num of remarks) delay (random number from 2 to 3) end repeat
source/web/servlet/http/servlet-http_parameters.adb
svn2github/matreshka
24
12209
<filename>source/web/servlet/http/servlet-http_parameters.adb ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 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 Ada.Streams.Stream_IO; package body Servlet.HTTP_Parameters is ---------------------- -- Get_Content_Type -- ---------------------- function Get_Content_Type (Self : HTTP_Parameter'Class) return League.Strings.Universal_String is begin if Self.Parameter /= null then return Self.Parameter.Get_Content_Type; else return League.Strings.Empty_Universal_String; end if; end Get_Content_Type; ---------------- -- Get_Header -- ---------------- function Get_Header (Self : HTTP_Parameter'Class; Name : League.Strings.Universal_String) return League.Strings.Universal_String is Headers : League.String_Vectors.Universal_String_Vector; begin if Self.Parameter /= null then Headers := Self.Parameter.Get_Headers (Name); if not Headers.Is_Empty then return Headers (1); end if; end if; return League.Strings.Empty_Universal_String; end Get_Header; ----------------- -- Get_Headers -- ----------------- function Get_Headers (Self : HTTP_Parameter'Class; Name : League.Strings.Universal_String) return League.String_Vectors.Universal_String_Vector is begin if Self.Parameter /= null then return Self.Parameter.Get_Headers (Name); else return League.String_Vectors.Empty_Universal_String_Vector; end if; end Get_Headers; ---------------------- -- Get_Header_Names -- ---------------------- function Get_Header_Names (Self : HTTP_Parameter'Class) return League.String_Vectors.Universal_String_Vector is begin if Self.Parameter /= null then return Self.Parameter.Get_Header_Names; else return League.String_Vectors.Empty_Universal_String_Vector; end if; end Get_Header_Names; ---------------------- -- Get_Input_Stream -- ---------------------- function Get_Input_Stream (Self : HTTP_Parameter'Class) return access Ada.Streams.Root_Stream_Type'Class is begin if Self.Parameter /= null then return Self.Parameter.Get_Input_Stream; else return null; end if; end Get_Input_Stream; -------------- -- Get_Name -- -------------- function Get_Name (Self : HTTP_Parameter'Class) return League.Strings.Universal_String is begin if Self.Parameter /= null then return Self.Parameter.Get_Name; else return League.Strings.Empty_Universal_String; end if; end Get_Name; -------------- -- Get_Size -- -------------- function Get_Size (Self : HTTP_Parameter'Class) return Ada.Streams.Stream_Element_Count is begin if Self.Parameter /= null then return Self.Parameter.Get_Size; else return 0; end if; end Get_Size; ----------------------------- -- Get_Submitted_File_Name -- ----------------------------- function Get_Submitted_File_Name (Self : HTTP_Parameter'Class) return League.Strings.Universal_String is begin if Self.Parameter /= null then return Self.Parameter.Get_Submitted_File_Name; else return League.Strings.Empty_Universal_String; end if; end Get_Submitted_File_Name; ----------- -- Write -- ----------- not overriding procedure Write (Self : Abstract_Parameter; File_Name : League.Strings.Universal_String) is use type Ada.Streams.Stream_Element_Offset; Input : constant access Ada.Streams.Root_Stream_Type'Class := Abstract_Parameter'Class (Self).Get_Input_Stream; Output : Ada.Streams.Stream_IO.File_Type; Buffer : Ada.Streams.Stream_Element_Array (1 .. 4096); Last : Ada.Streams.Stream_Element_Offset; begin if Input /= null then Ada.Streams.Stream_IO.Create (Output, Ada.Streams.Stream_IO.Out_File, File_Name.To_UTF_8_String); -- File name is converted to UTF-8. Should works with GNAT on UNIX -- with UTF-8 locales and Windows. loop Input.Read (Buffer, Last); exit when Last < Buffer'First; Ada.Streams.Stream_IO.Write (Output, Buffer (Buffer'First .. Last)); end loop; Ada.Streams.Stream_IO.Close (Output); end if; end Write; ----------- -- Write -- ----------- procedure Write (Self : HTTP_Parameter'Class; File_Name : League.Strings.Universal_String) is begin if Self.Parameter /= null then Self.Parameter.Write (File_Name); end if; end Write; end Servlet.HTTP_Parameters;
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/varsize3_pkg3.ads
best08618/asylo
7
9026
<reponame>best08618/asylo generic type T is private; package Varsize3_Pkg3 is type Object is record E : T; end record; function True return Object; end Varsize3_Pkg3;
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_1590.asm
ljhsiun2/medusa
9
174104
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x2c58, %rsi lea addresses_WC_ht+0x137ea, %rdi inc %r11 mov $46, %rcx rep movsl nop nop nop sub %rdx, %rdx lea addresses_WC_ht+0x15c9a, %rdi nop nop xor $60175, %r12 and $0xffffffffffffffc0, %rdi vmovaps (%rdi), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $0, %xmm3, %rcx nop nop nop sub %r11, %r11 lea addresses_WT_ht+0x1964a, %r11 nop nop inc %rbx mov $0x6162636465666768, %r12 movq %r12, %xmm7 movups %xmm7, (%r11) nop nop and %rdx, %rdx lea addresses_WT_ht+0x63ea, %r11 nop dec %rsi mov (%r11), %r12w nop nop nop add $8696, %r11 lea addresses_WC_ht+0x7ea, %rbx nop nop nop nop nop sub $26312, %rcx vmovups (%rbx), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $1, %xmm1, %rsi nop nop nop lfence pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %r9 push %rax push %rcx push %rdi push %rsi // Load lea addresses_normal+0x163ea, %rdi nop nop nop nop nop add %r10, %r10 mov (%rdi), %r9d nop nop nop dec %rax // Faulty Load lea addresses_UC+0x1fea, %rsi add %rcx, %rcx movups (%rsi), %xmm4 vpextrq $0, %xmm4, %r13 lea oracles, %rcx and $0xff, %r13 shlq $12, %r13 mov (%rcx,%r13,1), %r13 pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 6, 'size': 4, 'same': False, 'NT': True}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': True, 'congruent': 4, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}} {'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 */
programs/oeis/054/A054147.asm
karttu/loda
0
85202
; A054147: a(n) = T(2n,n), array T as in A054144. ; 0,3,21,108,492,2100,8604,34272,133728,513648,1948560,7318080,27256896,100815936,370684608,1355996160,4938304512,17914202880,64760732928,233390693376,838784916480,3006980379648,10755352869888,38390211256320,136771179061248,486422931763200,1727181841502208,6123774116708352 mov $1,$0 mov $2,$0 lpb $2,1 add $0,$1 add $1,$0 mul $0,2 sub $2,1 lpe mov $1,$0 div $1,4 mul $1,3
gcc-gcc-7_3_0-release/gcc/ada/exp_ch3.ads
best08618/asylo
7
27244
<reponame>best08618/asylo ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- E X P _ C H 3 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- -- -- 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 Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- 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 GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Expand routines for chapter 3 constructs with Types; use Types; with Elists; use Elists; with Uintp; use Uintp; package Exp_Ch3 is procedure Expand_N_Object_Declaration (N : Node_Id); procedure Expand_N_Subtype_Indication (N : Node_Id); procedure Expand_N_Variant_Part (N : Node_Id); procedure Expand_N_Full_Type_Declaration (N : Node_Id); procedure Expand_Previous_Access_Type (Def_Id : Entity_Id); -- For a full type declaration that contains tasks, or that is a task, -- check whether there exists an access type whose designated type is an -- incomplete declarations for the current composite type. If so, build the -- master for that access type, now that it is known to denote an object -- with tasks. procedure Expand_Record_Extension (T : Entity_Id; Def : Node_Id); -- Add a field _parent in the extension part of the record procedure Build_Discr_Checking_Funcs (N : Node_Id); -- Builds function which checks whether the component name is consistent -- with the current discriminants. N is the full type declaration node, -- and the discriminant checking functions are inserted after this node. function Build_Initialization_Call (Loc : Source_Ptr; Id_Ref : Node_Id; Typ : Entity_Id; In_Init_Proc : Boolean := False; Enclos_Type : Entity_Id := Empty; Discr_Map : Elist_Id := New_Elmt_List; With_Default_Init : Boolean := False; Constructor_Ref : Node_Id := Empty) return List_Id; -- Builds a call to the initialization procedure for the base type of Typ, -- passing it the object denoted by Id_Ref, plus additional parameters as -- appropriate for the type (the _Master, for task types, for example). -- Loc is the source location for the constructed tree. In_Init_Proc has -- to be set to True when the call is itself in an init proc in order to -- enable the use of discriminals. Enclos_Type is the enclosing type when -- initializing a component in an outer init proc, and it is used for -- various expansion cases including the case where Typ is a task type -- which is an array component, the indexes of the enclosing type are -- used to build the string that identifies each task at runtime. -- -- Discr_Map is used to replace discriminants by their discriminals in -- expressions used to constrain record components. In the presence of -- entry families bounded by discriminants, protected type discriminants -- can appear within expressions in array bounds (not as stand-alone -- identifiers) and a general replacement is necessary. -- -- Ada 2005 (AI-287): With_Default_Init is used to indicate that the -- initialization call corresponds to a default initialized component -- of an aggregate. -- -- Constructor_Ref is a call to a constructor subprogram. It is currently -- used only to support C++ constructors. function Freeze_Type (N : Node_Id) return Boolean; -- This function executes the freezing actions associated with the given -- freeze type node N and returns True if the node is to be deleted. We -- delete the node if it is present just for front end purpose and we don't -- want Gigi to see the node. This function can't delete the node itself -- since it would confuse any remaining processing of the freeze node. procedure Init_Secondary_Tags (Typ : Entity_Id; Target : Node_Id; Stmts_List : List_Id; Fixed_Comps : Boolean := True; Variable_Comps : Boolean := True); -- Ada 2005 (AI-251): Initialize the tags of the secondary dispatch tables -- of Typ. The generated code referencing tag fields of Target is appended -- to Stmts_List. If Fixed_Comps is True then the tag components located at -- fixed positions of Target are initialized; if Variable_Comps is True -- then tags components located at variable positions of Target are -- initialized. function Make_Tag_Assignment (N : Node_Id) return Node_Id; -- An object declaration that has an initialization for a tagged object -- requires a separate reassignment of the tag of the given type, because -- the expression may include an unchecked conversion. This tag assignment -- is inserted after the declaration, but if the object has an address -- clause the assignment is handled as part of the freezing of the object, -- see Check_Address_Clause. function Needs_Simple_Initialization (T : Entity_Id; Consider_IS : Boolean := True) return Boolean; -- Certain types need initialization even though there is no specific -- initialization routine: -- Access types (which need initializing to null) -- All scalar types if Normalize_Scalars mode set -- Descendants of standard string types if Normalize_Scalars mode set -- Scalar types having a Default_Value attribute -- Regarding Initialize_Scalars mode, this is ignored if Consider_IS is -- set to False, but if Consider_IS is set to True, then the cases above -- mentioning Normalize_Scalars also apply for Initialize_Scalars mode. function Get_Simple_Init_Val (T : Entity_Id; N : Node_Id; Size : Uint := No_Uint) return Node_Id; -- For a type which Needs_Simple_Initialization (see above), prepares the -- tree for an expression representing the required initial value. N is a -- node whose source location used in constructing this tree which is -- returned as the result of the call. The Size parameter indicates the -- target size of the object if it is known (indicated by a value that is -- not No_Uint and is greater than zero). If Size is not given (Size set to -- No_Uint, or non-positive), then the Esize of T is used as an estimate of -- the Size. The object size is needed to prepare a known invalid value for -- use by Normalize_Scalars. A call to this routine where T is a scalar -- type is only valid if we are in Normalize_Scalars or Initialize_Scalars -- mode, or if N is the node for a 'Invalid_Value attribute node. end Exp_Ch3;
mc-sema/validator/x86_64/tests/SHL8ri.asm
randolphwong/mcsema
2
179947
<reponame>randolphwong/mcsema BITS 64 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS=FLAG_AF|FLAG_OF ;TEST_FILE_META_END ; SHL8ri mov ch, 0xa ;TEST_BEGIN_RECORDING shl ch, 0x2 ;TEST_END_RECORDING