Skip to main content

IoOracle

Struct IoOracle 

Source
pub struct IoOracle { /* private fields */ }
Expand description

Default I/O-based verification oracle

Implementations§

Source§

impl IoOracle

Source

pub fn new() -> Self

Create a new I/O oracle with default settings (Python source)

Source

pub fn with_timeout(self, timeout_ms: u64) -> Self

Create an I/O oracle with custom timeout

Source

pub fn with_diff_options(self, options: DiffOptions) -> Self

Set diff options for comparison

Source

pub fn with_source_executor(self, executor: Box<dyn Executor>) -> Self

Set the source language executor

Source

pub fn with_target_executor(self, executor: Box<dyn Executor>) -> Self

Set the target language executor

Source

pub fn verify( &self, source_code: &str, target_code: &str, input: &str, source_lang: Language, target_lang: Language, ) -> Result<VerificationResult>

Verify transpilation correctness

§Errors

Returns an error if verification fails

Source

pub fn verify_python( &self, code: &str, expected_output: &str, ) -> Result<DiffResult>

Execute Python code and verify against expected output

§Errors

Returns an error if execution fails

Source

pub fn verify_python_with_input( &self, code: &str, input: &str, expected_output: &str, ) -> Result<DiffResult>

Execute Python code and verify against expected output with input

§Errors

Returns an error if execution fails

Source

pub fn execute_python(&self, code: &str, input: &str) -> Result<ExecutionResult>

Execute code and return raw result

§Errors

Returns an error if execution fails

Source

pub fn diff_options(&self) -> &DiffOptions

Get diff options

Trait Implementations§

Source§

impl Debug for IoOracle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IoOracle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Oracle for IoOracle

Source§

fn execute_source(&self, code: &str, input: &str) -> Result<ExecutionResult>

Execute source code and return result Read more
Source§

fn execute_target(&self, code: &str, input: &str) -> Result<ExecutionResult>

Execute target code and return result Read more
Source§

fn compare(&self, source: &ExecutionResult, target: &ExecutionResult) -> Verdict

Compare source and target execution results
Source§

fn timeout_ms(&self) -> u64

Get the timeout for execution in milliseconds

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V