int main (int argc, char** argv) { while (gets (in)) { ltl_formula *formula = getAST(in); print_formula(formula); puts(""); destroy_formula(formula); } return (EXIT_SUCCESS); }
void print_status(){ printf("Assignment:\n"); int i; for (i=1; i<=sat_st.num_vars; i++){ printf(" (%d, %d)\n", i, sat_st.model[i]); } printf("\n"); printf("Watchers:\n"); for (i=0; i<sat_st.num_clauses; i++){ printf(" (%d) (%d, %d)\n", i, *(sat_st.formula[i].head_watcher), *(sat_st.formula[i].tail_watcher)); } printf("\n"); printf("Formula:\n"); print_formula(); printf("---------------------------------------------------------------\n"); }
void size_rtems( int mode ) { int uninitialized = 0; int initialized = 0; /* * The following data is allocated for each Manager: * * + Per Manager Object Information * - local pointer table * - local name table * - the object's control blocks * - global name chains * * The following is the data allocate from the RTEMS Workspace Area. * The order indicates the order in which RTEMS allocates it. * * + Object MP * - Global Object CB's * + Thread MP * - Proxies Chain * + Scheduler * - Ready queue * + Interrupt Manager * - Interrupt Stack * + Timer Manager * - per Manager Object Data * + Extension Manager * - per Manager Object Data * + Message Queue Manager * - per Manager Object Data * - Message Buffers * + Semaphore Manager * - per Manager Object Data * + Partition Manager * - per Manager Object Data * + Region Manager * - per Manager Object Data * + Dual Ported Memory Manager * - per Manager Object Data * + Rate Monotonic Manager * - per Manager Object Data * + Internal Threads Handler * - MPCI Receive Server Thread TCB * - IDLE Thread TCB * - MPCI Receive Server Thread stack * - MPCI Receive Server Thread FP area (if CPU requires this) * - IDLE Thread stack * - IDLE Thread FP area (if CPU requires this) * * This does not take into account any CPU dependent alignment requirements. * * The following calculates the overhead needed by RTEMS from the * Workspace Area. */ sys_req = SYSTEM_TASKS + /* MPCI Receive Server and IDLE */ NAME_PTR_SIZE + /* Task Overhead */ SCHEDULER_WKSP_SIZE + /* Scheduler Overhead */ NAME_PTR_SIZE + /* Timer Overhead */ NAME_PTR_SIZE + /* Semaphore Overhead */ NAME_PTR_SIZE + /* Message Queue Overhead */ NAME_PTR_SIZE + /* Region Overhead */ NAME_PTR_SIZE + /* Partition Overhead */ NAME_PTR_SIZE + /* Dual-Ported Memory Overhead */ NAME_PTR_SIZE + /* Rate Monotonic Overhead */ NAME_PTR_SIZE + /* Extension Overhead */ PER_NODE; /* Extra Gobject Table */ uninitialized = /*address.h*/ 0 + /*apiext.h*/ (sizeof _API_extensions_List) + /*asr.h*/ 0 + /*attr.h*/ 0 + /*bitfield.h*/ 0 + /*chain.h*/ 0 + /*clock.h*/ 0 + /*config.h*/ #if defined(RTEMS_MULTIPROCESSING) (sizeof _Configuration_MP_table) + #endif /*context.h*/ (sizeof _Thread_Dispatch_necessary) + /*copyrt.h*/ 0 + /*debug.h*/ (sizeof _Debug_Level) + /*dpmem.h*/ (sizeof _Dual_ported_memory_Information) + /*event.h*/ (sizeof _Event_Sync_state) + #if defined(RTEMS_MULTIPROCESSING) /*eventmp.h*/ 0 + #endif /*eventset.h*/ 0 + /*extension.h*/ (sizeof _Extension_Information) + /*fatal.h*/ 0 + /*heap.h*/ 0 + /*init.h*/ 0 + /*interr.h*/ (sizeof _Internal_errors_What_happened) + /*intr.h*/ 0 + /*io.h*/ (sizeof _IO_Number_of_drivers) + (sizeof _IO_Driver_address_table) + /*isr.h*/ (sizeof _ISR_Nest_level) + #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) (sizeof _ISR_Vector_table) + #endif /*message.h*/ (sizeof _Message_queue_Information) + /*modes.h*/ 0 + #if defined(RTEMS_MULTIPROCESSING) /*mp.h*/ 0 + #endif #if defined(RTEMS_MULTIPROCESSING) /*mpci.h*/ (sizeof _MPCI_Remote_blocked_threads) + (sizeof _MPCI_Semaphore) + (sizeof _MPCI_table) + (sizeof _MPCI_Receive_server_tcb) + (sizeof _MPCI_Packet_processors) + #endif #if defined(RTEMS_MULTIPROCESSING) /*mppkt.h*/ 0 + #endif #if defined(RTEMS_MULTIPROCESSING) /*mptables.h*/ 0 + #endif #if defined(RTEMS_MULTIPROCESSING) /*msgmp.h*/ 0 + #endif /*object.h*/ (sizeof _Objects_Local_node) + (sizeof _Objects_Maximum_nodes) + (sizeof _Objects_Information_table) + #if defined(RTEMS_MULTIPROCESSING) /*objectmp.h*/ (sizeof _Objects_MP_Maximum_global_objects) + (sizeof _Objects_MP_Inactive_global_objects) + #endif /*options.h*/ 0 + /*part.h*/ (sizeof _Partition_Information) + #if defined(RTEMS_MULTIPROCESSING) /*partmp.h*/ 0 + #endif #if defined(RTEMS_SMP) /*percpu.h*/ (_SMP_Processor_count * sizeof(Per_CPU_Control)) + #else /*percpu.h*/ (sizeof (Per_CPU_Control) ) + #endif /*ratemon.h*/ (sizeof _Rate_monotonic_Information) + /*region.h*/ (sizeof _Region_Information) + #if defined(RTEMS_MULTIPROCESSING) /*regionmp.h*/ 0 + #endif /*rtems.h*/ /* Not applicable */ /*scheduler.h*/ SCHEDULER_OVHD + /*sem.h*/ (sizeof _Semaphore_Information) + #if defined(RTEMS_MULTIPROCESSING) /*semmp.h*/ 0 + #endif /*signal.h*/ 0 + /*signalmp.h*/ 0 + /*stack.h*/ 0 + /*states.h*/ 0 + /*status.h*/ 0 + /*sysstate.h*/ (sizeof _System_state_Current) + #if defined(RTEMS_MULTIPROCESSING) (sizeof _System_state_Is_multiprocessing) + #endif #if defined(RTEMS_MULTIPROCESSING) /*taskmp.h*/ 0 + #endif /*tasks.h*/ (sizeof _RTEMS_tasks_Information) + /*thread.h*/ (sizeof _Thread_BSP_context) + (sizeof _Thread_Dispatch_disable_level) + (sizeof _Thread_Maximum_extensions) + (sizeof _Thread_Ticks_per_timeslice) + (sizeof _Thread_Executing) + (sizeof _Thread_Heir) + #if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) (sizeof _Thread_Allocated_fp) + #endif (sizeof _Thread_Internal_information) + #if defined(RTEMS_MULTIPROCESSING) /*threadmp.h*/ (sizeof _Thread_MP_Active_proxies) + (sizeof _Thread_MP_Inactive_proxies) + #endif /*threadq.h*/ /*timer.h*/ (sizeof _Timer_Information) + /*tod.h*/ (sizeof _TOD.now) + (sizeof _TOD.uptime) + /*tqdata.h*/ 0 + /*types.h*/ 0 + /*userext.h*/ (sizeof _User_extensions_List) + /*watchdog.h*/ (sizeof _Watchdog_Sync_level) + (sizeof _Watchdog_Sync_count) + (sizeof _Watchdog_Ticks_since_boot) + (sizeof _Watchdog_Ticks_chain) + (sizeof _Watchdog_Seconds_chain) + /*wkspace.h*/ (sizeof _Workspace_Area); #ifndef unix /* make sure this is not a native compile */ #ifdef __i386__ /* cpu.h */ uninitialized += (sizeof _CPU_Null_fp_context); #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) uninitialized += (sizeof _CPU_Interrupt_stack_low) + (sizeof _CPU_Interrupt_stack_high); #endif #endif #ifdef __mc68000__ /* cpu.h */ uninitialized += (sizeof _CPU_Interrupt_stack_low) + (sizeof _CPU_Interrupt_stack_high); #endif #ifdef __sparc__ /* cpu.h */ uninitialized += (sizeof _CPU_Interrupt_stack_low) + (sizeof _CPU_Interrupt_stack_high) + (sizeof _CPU_Null_fp_context); #endif #ifdef no_cpu /* cpu.h */ uninitialized += (sizeof _CPU_Null_fp_context) + (sizeof _CPU_Interrupt_stack_low) + (sizeof _CPU_Interrupt_stack_high) + (sizeof _CPU_Thread_dispatch_pointer); #endif #ifdef __PPC__ /* cpu.h */ uninitialized += (sizeof _CPU_Interrupt_stack_low) + (sizeof _CPU_Interrupt_stack_high) + (sizeof _CPU_IRQ_info); #endif #endif /* !unix */ initialized += /*copyrt.h*/ (strlen(_Copyright_Notice)+1) + #if defined(RTEMS_MULTIPROCESSING) /*sptables.h*/ (sizeof _Initialization_Default_multiprocessing_table) + #endif (strlen(_RTEMS_version)+1); #ifndef unix /* make sure this is not native */ #ifdef __sparc__ initialized += (sizeof _CPU_Trap_slot_template); #endif #endif /* !unix */ puts( "" ); if ( mode == 0 ) help_size(); else print_formula(); printf( "\n" ); printf( "RTEMS uninitialized data consumes %d bytes\n", uninitialized ); printf( "RTEMS initialized data consumes %d bytes\n", initialized ); }